From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Christopher Thorne Newsgroups: gmane.emacs.bugs Subject: bug#34621: Patch Update Date: Mon, 04 Mar 2019 11:13:07 +0000 Organization: Reckon Digital Message-ID: References: <08e7108149ce2374fd0c9b7fc3e6ae38@reckondigital.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="252589"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Roundcube Webmail/1.1.2 To: 34621@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Mar 04 12:14:21 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h0lY4-0013X6-2m for geb-bug-gnu-emacs@m.gmane.org; Mon, 04 Mar 2019 12:14:20 +0100 Original-Received: from localhost ([127.0.0.1]:52015 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h0lY2-0001Wu-Lp for geb-bug-gnu-emacs@m.gmane.org; Mon, 04 Mar 2019 06:14:18 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:35451) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h0lXn-0001VB-Ot for bug-gnu-emacs@gnu.org; Mon, 04 Mar 2019 06:14:04 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h0lXn-0004hg-1F for bug-gnu-emacs@gnu.org; Mon, 04 Mar 2019 06:14:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:45469) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h0lXm-0004hO-Rq for bug-gnu-emacs@gnu.org; Mon, 04 Mar 2019 06:14:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1h0lXm-0006BE-M4 for bug-gnu-emacs@gnu.org; Mon, 04 Mar 2019 06:14:02 -0500 X-Loop: help-debbugs@gnu.org In-Reply-To: <08e7108149ce2374fd0c9b7fc3e6ae38@reckondigital.com> Resent-From: Christopher Thorne Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 04 Mar 2019 11:14:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 34621 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 34621-submit@debbugs.gnu.org id=B34621.155169799223670 (code B ref 34621); Mon, 04 Mar 2019 11:14:02 +0000 Original-Received: (at 34621) by debbugs.gnu.org; 4 Mar 2019 11:13:12 +0000 Original-Received: from localhost ([127.0.0.1]:59010 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h0lWy-00069h-Hu for submit@debbugs.gnu.org; Mon, 04 Mar 2019 06:13:12 -0500 Original-Received: from relay3-d.mail.gandi.net ([217.70.183.195]:40035) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h0lWw-00069Y-Ka for 34621@debbugs.gnu.org; Mon, 04 Mar 2019 06:13:11 -0500 Original-Received: from webmail.gandi.net (webmail4.sd4.0x35.net [10.200.201.4]) (Authenticated sender: c.thorne@reckondigital.com) by relay3-d.mail.gandi.net (Postfix) with ESMTPA id BE90760016 for <34621@debbugs.gnu.org>; Mon, 4 Mar 2019 11:13:07 +0000 (UTC) X-Sender: c.thorne@reckondigital.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.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" Xref: news.gmane.org gmane.emacs.bugs:156025 Archived-At: 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