From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Thierry Volpiatto Newsgroups: gmane.emacs.bugs 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 Message-ID: <87r4wicghx.fsf@gmail.com> References: <87vclucwxr.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1332593355 29223 80.91.229.3 (24 Mar 2012 12:49:15 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 24 Mar 2012 12:49:15 +0000 (UTC) To: 11084@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Mar 24 13:49:12 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1SBQP9-0002nC-CT for geb-bug-gnu-emacs@m.gmane.org; Sat, 24 Mar 2012 13:49:11 +0100 Original-Received: from localhost ([::1]:52911 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SBQP8-0000Nf-LE for geb-bug-gnu-emacs@m.gmane.org; Sat, 24 Mar 2012 08:49:10 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:49006) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SBQP5-0000NB-GH for bug-gnu-emacs@gnu.org; Sat, 24 Mar 2012 08:49:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SBQP3-0005dG-PD for bug-gnu-emacs@gnu.org; Sat, 24 Mar 2012 08:49:07 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:57819) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SBQP3-0005d1-Lb for bug-gnu-emacs@gnu.org; Sat, 24 Mar 2012 08:49:05 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1SBQt0-0006bU-BE for bug-gnu-emacs@gnu.org; Sat, 24 Mar 2012 09:20:02 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: <87vclucwxr.fsf@gmail.com> Resent-From: Thierry Volpiatto Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 24 Mar 2012 13:20:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 11084 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.133259517125341 (code B ref -1); Sat, 24 Mar 2012 13:20:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 24 Mar 2012 13:19:31 +0000 Original-Received: from localhost ([127.0.0.1]:36417 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SBQsS-0006ac-5W for submit@debbugs.gnu.org; Sat, 24 Mar 2012 09:19:31 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:41964) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SBQsB-0006aH-WB for submit@debbugs.gnu.org; Sat, 24 Mar 2012 09:19:26 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SBQOC-0005Vr-6h for submit@debbugs.gnu.org; Sat, 24 Mar 2012 08:48:13 -0400 Original-Received: from lists.gnu.org ([208.118.235.17]:48407) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SBQOC-0005VQ-40 for submit@debbugs.gnu.org; Sat, 24 Mar 2012 08:48:12 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:48097) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SBQOA-0000Dh-CC for bug-gnu-emacs@gnu.org; Sat, 24 Mar 2012 08:48:11 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SBQO8-0005O4-Cc for bug-gnu-emacs@gnu.org; Sat, 24 Mar 2012 08:48:09 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:36376) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SBQO8-0005Md-5v for bug-gnu-emacs@gnu.org; Sat, 24 Mar 2012 08:48:08 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1SBQO4-0001yo-80 for bug-gnu-emacs@gnu.org; Sat, 24 Mar 2012 13:48:04 +0100 Original-Received: from lbe83-2-78-243-104-167.fbx.proxad.net ([78.243.104.167]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 24 Mar 2012 13:48:04 +0100 Original-Received: from thierry.volpiatto by lbe83-2-78-243-104-167.fbx.proxad.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 24 Mar 2012 13:48:04 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 42 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: lbe83-2-78-243-104-167.fbx.proxad.net User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.94 (gnu/linux) Cancel-Lock: sha1:wjFmMXoM19RNwcmJXwskmiCwV7c= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:58079 Archived-At: Thierry Volpiatto 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 @@ default-extension (car grep-files-history) (car (car grep-files-aliases)))) + (def-lst (delete-dups + (delq nil (append (list default default-alias default-extension) + (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 default-extension) - (mapcar 'car grep-files-aliases))))))) + default))) (and files (or (cdr (assoc files grep-files-aliases)) files)))) --8<---------------cut here---------------end--------------->8--- Not using a list as DEF arg for completing-read is better. -- Thierry Get my Gnupg key: gpg --keyserver pgp.mit.edu --recv-keys 59F29997