Subject: bug#34621: Patch Update

From: Christopher Thorne <[email-masked]>
Date: Mon, 04 Mar 2019 11:13:07 +0000

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