[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
emacs-27 b99848c 2/2: Bind default-directory to the project root
From: |
Dmitry Gutov |
Subject: |
emacs-27 b99848c 2/2: Bind default-directory to the project root |
Date: |
Thu, 4 Feb 2021 15:06:32 -0500 (EST) |
branch: emacs-27
commit b99848c72cb2570cfcab98443be9156b66dee830
Author: Dmitry Gutov <dgutov@yandex.ru>
Commit: Dmitry Gutov <dgutov@yandex.ru>
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.
(cherry picked from commit c07ebfcbe084e8219d8c2588f23f77ba4ef39087)
---
lisp/progmodes/project.el | 2 ++
1 file changed, 2 insertions(+)
diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el
index 1caf8be..2b35ea4 100644
--- a/lisp/progmodes/project.el
+++ b/lisp/progmodes/project.el
@@ -441,6 +441,7 @@ requires quoting, e.g. `\\[quoted-insert]<space>'."
(require 'xref)
(require 'grep)
(let* ((pr (project-current t))
+ (default-directory (project-root pr))
(files
(if (not current-prefix-arg)
(project-files pr (project-roots pr))
@@ -473,6 +474,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 (append
(project-roots pr)