consult-projectile-switch-project hangs when there is a unavailable tramp project in recent list

alvaro
2024-10-29T10:38:39Z

To reproduce, add a ssh tramp project to `.emacs.d/projectile-bookmarks.eld` ``` ("~/.emacs.d/" "/ssh:sample-unavailable-host.local:~/repos/my-project/" .... ) ``` Then, invoke `consult-projectile-switch-project`. It get stuck until `C-g`. This is a sample stack trace: ``` Debugger entered--Lisp error: (quit) redisplay_internal\ \(C\ function\)() #("Switch to: " #f(compiled-function (str pred action) #) #f(compiled-function (&rest args2) #) nil nil consult-projectile--project-history nil nil) apply((# "Switch to: " #f(compiled-function (str pred action) #) #f(compiled-function (&rest args2) #) nil nil consult-projectile--project-history nil nil)) #f(compiled-function (&rest app) #)(# "Switch to: " #f(compiled-function (str pred action) #) #f(compiled-function (&rest args2) #) nil nil consult-projectile--project-history nil nil) apply(#f(compiled-function (&rest app) #) (# "Switch to: " #f(compiled-function (str pred action) #) #f(compiled-function (&rest args2) #) nil nil consult-projectile--project-history nil nil)) vertico--advice(# "Switch to: " #f(compiled-function (str pred action) #) #f(compiled-function (&rest args2) #) nil nil consult-projectile--project-history nil nil) apply(vertico--advice # ("Switch to: " #f(compiled-function (str pred action) #) #f(compiled-function (&rest args2) #) nil nil consult-projectile--project-history nil nil)) completing-read-default("Switch to: " #f(compiled-function (str pred action) #) #f(compiled-function (&rest args2) #) nil nil consult-projectile--project-history nil nil) completing-read("Switch to: " #f(compiled-function (str pred action) #) #f(compiled-function (&rest args2) #) nil nil consult-projectile--project-history nil nil) #f(compiled-function () #)() consult--with-preview-1((:predicate # :keys (any)) nil #f(compiled-function (narrow input cand) #) #f(compiled-function (&rest args2) #) nil #f(compiled-function () #)) consult--read-1((#("/datos-luks/datos-alvaro/a..." 0 48 (face consult-projectile-projects multi-category ...) 48 49 (invisible t consult-strip t)) #("/datos-luks/datos-alvaro/c..." 0 65 (face consult-projectile-projects multi-category ...) 65 66 (invisible t consult-strip t)) #("/datos-luks/datos-alvaro/a..." 0 39 (face consult-projectile-projects multi-category ...) 39 40 (invisible t consult-strip t)) #("~/ " 0 2 (face consult-projectile-projects multi-category ...) 2 3 (invisible t consult-strip t)) #("/datos-luks/datos-alvaro/2..." 0 56 (face consult-projectile-projects multi-category ...) 56 57 (invisible t consult-strip t)) #("/ssh:debian12-docker.local..." 0 49 (face consult-projectile-projects multi-category ...) 49 50 (invisible t consult-strip t)) #("~/.emacs.d/straight/repos/..." 0 57 (face consult-projectile-projects multi-category ...) 57 58 (invisible t consult-strip t)) #("~/repos/grading-questionna..." 0 30 (face consult-projectile-projects multi-category ...) 30 31 (invisible t consult-strip t)) #("~/repos/coder-offline/ " 0 22 (face consult-projectile-projects multi-category ...) 22 23 (invisible t consult-strip t)) #("~/repos/iesavellaneda/ " 0 22 (face consult-projectile-projects multi-category ...) 22 23 (invisible t consult-strip t)) #("~/repos/alvarogonzalezsoti..." 0 40 (face consult-projectile-projects multi-category ...) 40 41 (invisible t consult-strip t)) #("~/repos/emacs/ " 0 14 (face consult-projectile-projects multi-category ...) 14 15 (invisible t consult-strip t)) #("~/.emacs.d/straight/repos/..." 0 34 (face consult-projectile-projects multi-category ...) 34 35 (invisible t consult-strip t)) #("/datos-luks/datos-alvaro/c..." 0 65 (face consult-projectile-projects multi-category ...) 65 66 (invisible t consult-strip t)) #("/datos-luks/datos-alvaro/2..." 0 51 (face consult-projectile-projects multi-category ...) 51 52 (invisible t consult-strip t)) #("~/repos/opencv-js-gradder/..." 0 26 (face consult-projectile-projects multi-category ...) 26 27 (invisible t consult-strip t)) #("~/repos/zxing/browser/ " 0 22 (face consult-projectile-projects multi-category ...) 22 23 (invisible t consult-strip t)) #("~/.oh-my-zsh/ " 0 13 (face consult-projectile-projects multi-category ...) 13 14 (invisible t consult-strip t)) #("/datos-luks/datos-alvaro/c..." 0 65 (face consult-projectile-projects multi-category ...) 65 66 (invisible t consult-strip t)) #("~/repos/opencv/ " 0 15 (face consult-projectile-projects multi-category ...) 15 16 (invisible t consult-strip t)) #("~/repos/bibllm/ " 0 15 (face consult-projectile-projects multi-category ...) 15 16 (invisible t consult-strip t)) #("~/repos/pruebas-rust/ " 0 21 (face consult-projectile-projects multi-category ...) 21 22 (invisible t consult-strip t)) #("~/.rustup/toolchains/stabl..." 0 87 (face consult-projectile-projects multi-category ...) 87 88 (invisible t consult-strip t)) #("~/.rustup/toolchains/stabl..." 0 86 (face consult-projectile-projects multi-category ...) 86 87 (invisible t consult-strip t)) #("~/.cargo/registry/src/inde..." 0 68 (face consult-projectile-projects multi-category ...) 68 69 (invisible t consult-strip t)) #("~/repos/advent-of-code/ " 0 23 (face consult-projectile-projects multi-category ...) 23 24 (invisible t consult-strip t)) ...) :prompt "Switch to: " :history consult-projectile--project-history :sort nil :category multi-category :predicate #f(compiled-function (&rest args2) #) :annotate #f(compiled-function (&rest args2) #) :group #f(compiled-function (&rest args2) #) :lookup #f(compiled-function (&rest args2) #) :preview-key (:predicate # :keys (any)) :narrow ((112 . "Project")) :state nil :prompt "Select: " :preview-key ...) consult--read((#("/datos-luks/datos-alvaro/a..." 0 48 (face consult-projectile-projects multi-category ...) 48 49 (invisible t consult-strip t)) #("/datos-luks/datos-alvaro/c..." 0 65 (face consult-projectile-projects multi-category ...) 65 66 (invisible t consult-strip t)) #("/datos-luks/datos-alvaro/a..." 0 39 (face consult-projectile-projects multi-category ...) 39 40 (invisible t consult-strip t)) #("~/ " 0 2 (face consult-projectile-projects multi-category ...) 2 3 (invisible t consult-strip t)) #("/datos-luks/datos-alvaro/2..." 0 56 (face consult-projectile-projects multi-category ...) 56 57 (invisible t consult-strip t)) #("/ssh:debian12-docker.local..." 0 49 (face consult-projectile-projects multi-category ...) 49 50 (invisible t consult-strip t)) #("~/.emacs.d/straight/repos/..." 0 57 (face consult-projectile-projects multi-category ...) 57 58 (invisible t consult-strip t)) #("~/repos/grading-questionna..." 0 30 (face consult-projectile-projects multi-category ...) 30 31 (invisible t consult-strip t)) #("~/repos/coder-offline/ " 0 22 (face consult-projectile-projects multi-category ...) 22 23 (invisible t consult-strip t)) #("~/repos/iesavellaneda/ " 0 22 (face consult-projectile-projects multi-category ...) 22 23 (invisible t consult-strip t)) #("~/repos/alvarogonzalezsoti..." 0 40 (face consult-projectile-projects multi-category ...) 40 41 (invisible t consult-strip t)) #("~/repos/emacs/ " 0 14 (face consult-projectile-projects multi-category ...) 14 15 (invisible t consult-strip t)) #("~/.emacs.d/straight/repos/..." 0 34 (face consult-projectile-projects multi-category ...) 34 35 (invisible t consult-strip t)) #("/datos-luks/datos-alvaro/c..." 0 65 (face consult-projectile-projects multi-category ...) 65 66 (invisible t consult-strip t)) #("/datos-luks/datos-alvaro/2..." 0 51 (face consult-projectile-projects multi-category ...) 51 52 (invisible t consult-strip t)) #("~/repos/opencv-js-gradder/..." 0 26 (face consult-projectile-projects multi-category ...) 26 27 (invisible t consult-strip t)) #("~/repos/zxing/browser/ " 0 22 (face consult-projectile-projects multi-category ...) 22 23 (invisible t consult-strip t)) #("~/.oh-my-zsh/ " 0 13 (face consult-projectile-projects multi-category ...) 13 14 (invisible t consult-strip t)) #("/datos-luks/datos-alvaro/c..." 0 65 (face consult-projectile-projects multi-category ...) 65 66 (invisible t consult-strip t)) #("~/repos/opencv/ " 0 15 (face consult-projectile-projects multi-category ...) 15 16 (invisible t consult-strip t)) #("~/repos/bibllm/ " 0 15 (face consult-projectile-projects multi-category ...) 15 16 (invisible t consult-strip t)) #("~/repos/pruebas-rust/ " 0 21 (face consult-projectile-projects multi-category ...) 21 22 (invisible t consult-strip t)) #("~/.rustup/toolchains/stabl..." 0 87 (face consult-projectile-projects multi-category ...) 87 88 (invisible t consult-strip t)) #("~/.rustup/toolchains/stabl..." 0 86 (face consult-projectile-projects multi-category ...) 86 87 (invisible t consult-strip t)) #("~/.cargo/registry/src/inde..." 0 68 (face consult-projectile-projects multi-category ...) 68 69 (invisible t consult-strip t)) #("~/repos/advent-of-code/ " 0 23 (face consult-projectile-projects multi-category ...) 23 24 (invisible t consult-strip t)) ...) :prompt "Switch to: " :history consult-projectile--project-history :sort nil :category multi-category :predicate #f(compiled-function (&rest args2) #) :annotate #f(compiled-function (&rest args2) #) :group #f(compiled-function (&rest args2) #) :lookup #f(compiled-function (&rest args2) #) :preview-key (:predicate # :keys (any)) :narrow ((112 . "Project")) :state nil) consult--multi((consult-projectile--source-projectile-project) :prompt "Switch to: " :history consult-projectile--project-history :sort nil) consult-projectile((consult-projectile--source-projectile-project)) consult-projectile-switch-project() funcall-interactively(consult-projectile-switch-project) #(consult-projectile-switch-project record nil) elmacro-record-command(# consult-projectile-switch-project record nil) apply(elmacro-record-command # (consult-projectile-switch-project record nil)) call-interactively(consult-projectile-switch-project record nil) command-execute(consult-projectile-switch-project record) execute-extended-command(nil "consult-projectile-switch-project" nil) funcall-interactively(execute-extended-command nil "consult-projectile-switch-project" nil) #(execute-extended-command t nil) elmacro-record-command(# execute-extended-command nil nil) apply(elmacro-record-command # (execute-extended-command nil nil)) call-interactively(execute-extended-command nil nil) command-execute(execute-extended-command) ``` As a workaround, I'm removing all tramp projects from `.emacs.d/projectile-bookmarks.eld`.