From 4502284adc58922e7ac6572ac0ae2564c079f9e1 Mon Sep 17 00:00:00 2001 From: Alexander Rosenberg Date: Sun, 25 Jan 2026 17:58:18 -0800 Subject: [PATCH] Fix consult preview --- init.el | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/init.el b/init.el index 828084f..ea98d3d 100644 --- a/init.el +++ b/init.el @@ -1715,7 +1715,15 @@ COMMAND and COMINT are like `compile'." (defun my/project-try-dotfile (dir) (if-let (root (locate-dominating-file dir my/project-root-marker)) (list 'vc nil root))) - (add-hook 'project-find-functions #'my/project-try-dotfile)) + (add-hook 'project-find-functions #'my/project-try-dotfile) + ;; `project-try-vc' causes consult file previews to break! + (defun my/project-try-vc-safe (dir) + (ignore-error file-error + (project-try-vc dir))) + (let ((cur-val (default-toplevel-value 'project-find-functions))) + (setq-default project-find-functions + (cl-nsubstitute 'my/project-try-vc-safe 'project-try-vc + cur-val)))) ;; comint (use-package comint