[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#11084: 24.0.94; [PATCH] Completion on DEF arg in grep-read-files is

From: Thierry Volpiatto
Subject: bug#11084: 24.0.94; [PATCH] Completion on DEF arg in grep-read-files is wrong.
Date: Sat, 24 Mar 2012 13:47:54 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.94 (gnu/linux)

Thierry Volpiatto <address@hidden> writes:

> Hi,
> it seem completion in grep-read-files is wrong for the default arg.
> It use (mapcar 'car grep-files-aliases) where it should use the cdr.
My bad, this is wrong the car should be used.
So here the patch:

--8<---------------cut here---------------start------------->8---
diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el
--- a/lisp/progmodes/grep.el
+++ b/lisp/progmodes/grep.el
@@ -855,16 +855,17 @@
               (car grep-files-history)
               (car (car grep-files-aliases))))
+         (def-lst (delete-dups
+                   (delq nil (append (list default default-alias 
+                                     (mapcar 'car grep-files-aliases))))) 
         (files (completing-read
                 (concat "Search for \"" regexp
                         "\" in files"
                         (if default (concat " (default " default ")"))
                         ": ")
-                'read-file-name-internal
+                (append def-lst (all-completions "" 'read-file-name-internal))
                 nil nil nil 'grep-files-history
-                (delete-dups
-                 (delq nil (append (list default default-alias 
-                                   (mapcar 'car grep-files-aliases)))))))
+                 default)))
     (and files
         (or (cdr (assoc files grep-files-aliases))
--8<---------------cut here---------------end--------------->8---

Not using a list as DEF arg for completing-read is better.

Get my Gnupg key:
gpg --keyserver pgp.mit.edu --recv-keys 59F29997 

reply via email to

[Prev in Thread] Current Thread [Next in Thread]