From: Dmitry Gutov Date: Thu, 4 Feb 2021 01:38:27 +0000 (+0200) Subject: Bind default-directory to the project root X-Git-Tag: emacs-28.0.90~3955 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=c07ebfcbe084e8219d8c2588f23f77ba4ef39087;p=emacs.git Bind default-directory to the project root * lisp/progmodes/project.el (project-find-regexp): Bind default-directory to the project root, to save this value in the resulting buffer (esp. if the project selector was used, (https://lists.gnu.org/archive/html/emacs-devel/2021-02/msg00140.html). (project-or-external-find-regexp): Same. --- diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index fc5e30111e5..abe563bec04 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -725,6 +725,7 @@ requires quoting, e.g. `\\[quoted-insert]'." (require 'xref) (require 'grep) (let* ((pr (project-current t)) + (default-directory (project-root pr)) (files (if (not current-prefix-arg) (project-files pr) @@ -756,6 +757,7 @@ pattern to search for." (interactive (list (project--read-regexp))) (require 'xref) (let* ((pr (project-current t)) + (default-directory (project-root pr)) (files (project-files pr (cons (project-root pr)