From 34d5dd1ff8a2f4d7ce4a3840e7be7926152e1e04 Mon Sep 17 00:00:00 2001 From: David Morgan Date: Thu, 26 Sep 2024 13:20:05 +0100 Subject: Make consult-ripgrep-parent work when there's no project/perspective --- .emacs.d/lisp/init-minibuffer.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to '.emacs.d') 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) -- cgit 1.4.1-2-gfad0