GNU bug report logs -
#34621
[PATCH] lisp/progmodes/grep.el (grep-read-files): Add file-directory-p check
Previous Next
Full log
View this message in rfc822 format
I've changed the patch to check if the buffer is in dired mode. I think
this makes more sense than looking at the file system and addresses the
edge case described in the previous email.
Also, I think I could have been clearer in explaining how to reproduce:
1. Create directory called django-1.11 on the filesystem
2. Open this directory in dired buffer
3. Run rgrep with this dired buffer open
4. Search for any string
5. Observe unexpected default extension suggestion of (*.11)
Patch below:
diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el
index 3fd2a7e701..22e7ec11d8 100644
--- a/lisp/progmodes/grep.el
+++ b/lisp/progmodes/grep.el
@@ -963,6 +963,7 @@ grep-read-files
(file-name-nondirectory bn)))
(default-alias
(and fn
+ (not (eq major-mode 'dired-mode))
(let ((aliases (remove (assoc "all" grep-files-aliases)
grep-files-aliases))
alias)
@@ -979,6 +980,7 @@ grep-read-files
(cdr alias))))
(default-extension
(and fn
+ (not (eq major-mode 'dired-mode))
(let ((ext (file-name-extension fn)))
(and ext (concat "*." ext)))))
(default
Changelog entry:
* lisp/progmodes/grep.el (grep-read-files): Disable default extension in
dired buffers
This bug report was last modified 6 years and 36 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.