From 4798dc0c51381f36cd45160640c4f55a7792750b Mon Sep 17 00:00:00 2001 From: Dmitry Gutov Date: Fri, 2 Apr 2021 01:24:57 +0300 Subject: [PATCH] Fix C-u project-find-regexp's default dir * lisp/progmodes/project.el (project-find-regexp): Default read-directory-name to the current default-directory when called with C-u (bug#47012). --- lisp/progmodes/project.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index 4101962f06a..3dd11118ea1 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -732,13 +732,14 @@ requires quoting, e.g. `\\[quoted-insert]'." (interactive (list (project--read-regexp))) (require 'xref) (require 'grep) - (let* ((pr (project-current t)) + (let* ((caller-dir default-directory) + (pr (project-current t)) (default-directory (project-root pr)) (files (if (not current-prefix-arg) (project-files pr) (let ((dir (read-directory-name "Base directory: " - nil default-directory t))) + caller-dir nil t))) (project--files-in-directory dir nil (grep-read-files regexp)))))) -- 2.39.2