; (grep-read-files): Fix completion table
authorEshel Yaron <me@eshelyaron.com>
Tue, 2 Jul 2024 12:03:01 +0000 (14:03 +0200)
committerEshel Yaron <me@eshelyaron.com>
Tue, 2 Jul 2024 12:12:40 +0000 (14:12 +0200)
* lisp/progmodes/grep.el (grep-read-files): Cease returning
some completion candidates unconditionally.  Use
'completion-file-name-table' over 'read-file-name-internal'
because the latter uses 'completion-table-with-quoting', and
that doesn't blend well with other tables in
'completion-table-merge'.

https://lists.gnu.org/archive/html/emacs-devel/2024-06/msg01194.html

lisp/progmodes/grep.el

index 459f00e680574aabe230e0c8f81cebf83f451070..e8d1e692d0f45758ccdd7505219c655195642f9d 100644 (file)
@@ -1181,9 +1181,7 @@ REGEXP is used as a string in the prompt."
          (files (completing-read
                  (format-prompt "Search for \"%s\" in files matching wildcard"
                                 default regexp)
-                 (completion-table-merge
-                  (lambda (_string _pred _action) defaults)
-                  #'read-file-name-internal)
+                 (completion-table-merge defaults #'completion-file-name-table)
                 nil nil nil 'grep-files-history defaults)))
     (and files
         (or (cdr (assoc files grep-files-aliases))