about summary refs log tree commit diff stats
path: root/.emacs.d/lisp
diff options
context:
space:
mode:
authorDavid Morgan <djm_uk@protonmail.com>2021-09-18 15:32:09 +0100
committerDavid Morgan <djm_uk@protonmail.com>2021-09-18 15:32:09 +0100
commitf785ddb8468e77f17f178f5a687684702feb8529 (patch)
treec290e67e3efa8274996c94bc7e231b676515cd5b /.emacs.d/lisp
parentdddd349714e282a0bcf5b9593e90d38d22ce1616 (diff)
downloaddotfiles-f785ddb8468e77f17f178f5a687684702feb8529.tar.gz
Fall back to perspective name for finding project root
Diffstat (limited to '.emacs.d/lisp')
-rw-r--r--.emacs.d/lisp/init-minibuffer.el6
1 files changed, 4 insertions, 2 deletions
diff --git a/.emacs.d/lisp/init-minibuffer.el b/.emacs.d/lisp/init-minibuffer.el
index fcad4fa..90cb79b 100644
--- a/.emacs.d/lisp/init-minibuffer.el
+++ b/.emacs.d/lisp/init-minibuffer.el
@@ -282,8 +282,10 @@ DEFS is a plist associating completion categories to commands."
 
   (setq consult-project-root-function
         (lambda ()
-          (when-let (project (project-current))
-            (project-root project))))
+          (if-let (project (project-current))
+            (project-root project)
+            (when-let (persp (persp-name (persp-curr)))
+              (car (seq-filter (lambda (pr) (string-match-p persp pr)) (project-known-project-roots)))))))
 
   ;; Switches perspective if we select a buffer from another perspective, but note that previewing
   ;; a buffer adds it to the current perspective, so preview should be disabled before removing