about summary refs log tree commit diff stats
path: root/.emacs.d
diff options
context:
space:
mode:
authorDavid Morgan <djm_uk@protonmail.com>2024-09-26 13:20:05 +0100
committerDavid Morgan <djm_uk@protonmail.com>2024-09-26 13:20:05 +0100
commit34d5dd1ff8a2f4d7ce4a3840e7be7926152e1e04 (patch)
treec5f52f66a800b7087db4fb35342dd584714f13ea /.emacs.d
parent9c8cd626151246d1245e7f5c6d89afcf4f4a476c (diff)
downloaddotfiles-34d5dd1ff8a2f4d7ce4a3840e7be7926152e1e04.tar.gz
Make consult-ripgrep-parent work when there's no project/perspective
Diffstat (limited to '.emacs.d')
-rw-r--r--.emacs.d/lisp/init-minibuffer.el4
1 files changed, 3 insertions, 1 deletions
diff --git a/.emacs.d/lisp/init-minibuffer.el b/.emacs.d/lisp/init-minibuffer.el
index eec2a28..10ccfe9 100644
--- a/.emacs.d/lisp/init-minibuffer.el
+++ b/.emacs.d/lisp/init-minibuffer.el
@@ -310,7 +310,9 @@ DEFS is a plist associating completion categories to commands."
     (consult-buffer))
   (defun consult-ripgrep-parent (&optional initial)
     (interactive "P")
-    (consult-ripgrep (file-name-directory (directory-file-name (persp-current-project-root))) initial))
+    (consult-ripgrep (file-name-directory
+                      (directory-file-name (or (persp-current-project-root) default-directory)))
+                     initial))
 
   (defalias 'consult-line-thing-at-point 'consult-line)
   (defalias 'consult-ripgrep-thing-at-point 'consult-ripgrep)