aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Kangas2025-03-01 03:22:30 +0100
committerStefan Kangas2025-03-01 03:24:48 +0100
commitc0ca272bd7cbab5a2013e112f171e1d7fda65216 (patch)
tree884c394a934ef6890556ea8e15b5b80ac426fe9c
parent22c98747601dfdc7ac90b22168a6ec1ca13e0e59 (diff)
downloademacs-c0ca272bd7cbab5a2013e112f171e1d7fda65216.tar.gz
emacs-c0ca272bd7cbab5a2013e112f171e1d7fda65216.zip
grep: Signal error if unable to access directory
* lisp/progmodes/grep.el (lgrep, rgrep): grep: Signal error if unable to access directory, instead of just trying to use default-directory, because that level of DWIMishness is confusing. (Bug#71078)
-rw-r--r--lisp/progmodes/grep.el4
1 files changed, 2 insertions, 2 deletions
diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el
index 951663e049a..b0105f08ea2 100644
--- a/lisp/progmodes/grep.el
+++ b/lisp/progmodes/grep.el
@@ -1332,7 +1332,7 @@ command before it's run."
1332 (list regexp files dir confirm)))))) 1332 (list regexp files dir confirm))))))
1333 (when (and (stringp regexp) (> (length regexp) 0)) 1333 (when (and (stringp regexp) (> (length regexp) 0))
1334 (unless (and dir (file-accessible-directory-p dir)) 1334 (unless (and dir (file-accessible-directory-p dir))
1335 (setq dir default-directory)) 1335 (user-error "Unable to open directory: %s" dir))
1336 (unless (string-equal (file-remote-p dir) (file-remote-p default-directory)) 1336 (unless (string-equal (file-remote-p dir) (file-remote-p default-directory))
1337 (let ((default-directory dir)) 1337 (let ((default-directory dir))
1338 (grep-compute-defaults))) 1338 (grep-compute-defaults)))
@@ -1437,7 +1437,7 @@ to indicate whether the grep should be case sensitive or not."
1437 (grep-compute-defaults)) 1437 (grep-compute-defaults))
1438 (when (and (stringp regexp) (> (length regexp) 0)) 1438 (when (and (stringp regexp) (> (length regexp) 0))
1439 (unless (and dir (file-accessible-directory-p dir)) 1439 (unless (and dir (file-accessible-directory-p dir))
1440 (setq dir default-directory)) 1440 (user-error "Unable to open directory: %s" dir))
1441 (unless (string-equal (file-remote-p dir) (file-remote-p default-directory)) 1441 (unless (string-equal (file-remote-p dir) (file-remote-p default-directory))
1442 (let ((default-directory dir)) 1442 (let ((default-directory dir))
1443 (grep-compute-defaults))) 1443 (grep-compute-defaults)))