From unknown Fri Jun 13 11:47:28 2025 X-Loop: help-debbugs@gnu.org Subject: bug#34621: [PATCH] lisp/progmodes/grep.el (grep-read-files): Add file-directory-p check Resent-From: Christopher Thorne Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 22 Feb 2019 21:16:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 34621 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: 34621@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.155087011027644 (code B ref -1); Fri, 22 Feb 2019 21:16:01 +0000 Received: (at submit) by debbugs.gnu.org; 22 Feb 2019 21:15:10 +0000 Received: from localhost ([127.0.0.1]:48602 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gxIA1-0007Bm-VH for submit@debbugs.gnu.org; Fri, 22 Feb 2019 16:15:10 -0500 Received: from eggs.gnu.org ([209.51.188.92]:58553) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gxEdb-0001qb-Ph for submit@debbugs.gnu.org; Fri, 22 Feb 2019 12:29:28 -0500 Received: from lists.gnu.org ([209.51.188.17]:33799) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gxEdU-0004eT-AW for submit@debbugs.gnu.org; Fri, 22 Feb 2019 12:29:20 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44681) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gxEdT-0004PJ-C6 for bug-gnu-emacs@gnu.org; Fri, 22 Feb 2019 12:29:20 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.1 required=5.0 tests=BAYES_50,RCVD_IN_DNSWL_LOW autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gxEdR-0004aE-Mt for bug-gnu-emacs@gnu.org; Fri, 22 Feb 2019 12:29:18 -0500 Received: from relay4-d.mail.gandi.net ([217.70.183.196]:50385) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gxEdR-0004RI-F6 for bug-gnu-emacs@gnu.org; Fri, 22 Feb 2019 12:29:17 -0500 Received: from webmail.gandi.net (webmail8.sd4.0x35.net [10.200.201.8]) (Authenticated sender: c.thorne@reckondigital.com) by relay4-d.mail.gandi.net (Postfix) with ESMTPA id 988A5E0011 for ; Fri, 22 Feb 2019 17:29:10 +0000 (UTC) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Fri, 22 Feb 2019 17:29:10 +0000 From: Christopher Thorne Organization: Reckon Digital Message-ID: <08e7108149ce2374fd0c9b7fc3e6ae38@reckondigital.com> X-Sender: c.thorne@reckondigital.com User-Agent: Roundcube Webmail/1.1.2 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 217.70.183.196 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Spam-Score: 0.7 (/) X-Mailman-Approved-At: Fri, 22 Feb 2019 16:15:09 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.3 (/) Hello, This patch fixes a bug in the rgrep command which causes certain directory names to be mistaken for files with extensions. For example, when running rgrep in a directory called "django-1.11", rgrep will prompt with 'Search for "x" in files (default *.11):', under the assumption that .11 is a file extension. Similarly, creating a directory called "test.c" and running rgrep inside it results in the prompt 'Search for "x" in files (default *.[ch])'. With this patch, the default file extension for directories is either taken from the rgrep history or set to "all". Changelog entry: * lisp/progmodes/grep.el (grep-read-files): Add file-directory-p check Patch: diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el index 3fd2a7e701..fe0fb5b30c 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 (file-directory-p (concat "../" fn))) (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 (file-directory-p (concat "../" fn))) (let ((ext (file-name-extension fn))) (and ext (concat "*." ext))))) (default Regards, Christopher Thorne From unknown Fri Jun 13 11:47:28 2025 X-Loop: help-debbugs@gnu.org Subject: bug#34621: Update References: <08e7108149ce2374fd0c9b7fc3e6ae38@reckondigital.com> In-Reply-To: <08e7108149ce2374fd0c9b7fc3e6ae38@reckondigital.com> Resent-From: c.thorne@reckondigital.com Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 25 Feb 2019 09: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 To: 34621@debbugs.gnu.org Received: via spool by 34621-submit@debbugs.gnu.org id=B34621.15510860228631 (code B ref 34621); Mon, 25 Feb 2019 09:14:02 +0000 Received: (at 34621) by debbugs.gnu.org; 25 Feb 2019 09:13:42 +0000 Received: from localhost ([127.0.0.1]:50824 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gyCKU-0002F9-LO for submit@debbugs.gnu.org; Mon, 25 Feb 2019 04:13:42 -0500 Received: from relay2-d.mail.gandi.net ([217.70.183.194]:46399) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gyCKS-0002F0-O9 for 34621@debbugs.gnu.org; Mon, 25 Feb 2019 04:13:41 -0500 Received: from sogo8.bi1.0x35.net (sogo8.bi1.0x35.net [10.150.1.78]) (Authenticated sender: c.thorne@reckondigital.com) by relay2-d.mail.gandi.net (Postfix) with ESMTPA id 3F3A140018 for <34621@debbugs.gnu.org>; Mon, 25 Feb 2019 09:13:36 +0000 (UTC) Content-Type: multipart/alternative; boundary="----=_=-_OpenGroupware_org_NGMime-15978-1551086016.694836-2------" User-Agent: SOGoMail 3.2.10 MIME-Version: 1.0 Date: Mon, 25 Feb 2019 10:13:36 +0100 Message-ID: <3e6a-5c73b200-3-1df9bfc0@134215777> X-Forward: 81.152.190.20, 10.200.201.193 From: c.thorne@reckondigital.com X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) ------=_=-_OpenGroupware_org_NGMime-15978-1551086016.694836-2------ Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Content-Length: 180 The initial patch misses an edge case where a non-file buffer has the s= ame name as a directory. I'll send a new patch with a more robust solut= ion in the next couple of days. ------=_=-_OpenGroupware_org_NGMime-15978-1551086016.694836-2------ Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable Content-Length: 192 The initial patch misses an edge case where a non-file buffer has= the same name as a directory. I'll send a new patch with a more robust= solution in the next couple of days. ------=_=-_OpenGroupware_org_NGMime-15978-1551086016.694836-2-------- From unknown Fri Jun 13 11:47:28 2025 X-Loop: help-debbugs@gnu.org Subject: bug#34621: Patch Update References: <08e7108149ce2374fd0c9b7fc3e6ae38@reckondigital.com> 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 To: 34621@debbugs.gnu.org Received: via spool by 34621-submit@debbugs.gnu.org id=B34621.155169799223670 (code B ref 34621); Mon, 04 Mar 2019 11:14:02 +0000 Received: (at 34621) by debbugs.gnu.org; 4 Mar 2019 11:13:12 +0000 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 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 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) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Mon, 04 Mar 2019 11:13:07 +0000 From: Christopher Thorne Organization: Reckon Digital Message-ID: X-Sender: c.thorne@reckondigital.com User-Agent: Roundcube Webmail/1.1.2 X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) 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 From unknown Fri Jun 13 11:47:28 2025 X-Loop: help-debbugs@gnu.org Subject: bug#34621: Patch Update Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 04 Mar 2019 15:27: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 To: Christopher Thorne , 34621@debbugs.gnu.org Received: via spool by 34621-submit@debbugs.gnu.org id=B34621.155171320524896 (code B ref 34621); Mon, 04 Mar 2019 15:27:02 +0000 Received: (at 34621) by debbugs.gnu.org; 4 Mar 2019 15:26:45 +0000 Received: from localhost ([127.0.0.1]:60074 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h0pUL-0006TT-6j for submit@debbugs.gnu.org; Mon, 04 Mar 2019 10:26:45 -0500 Received: from userp2120.oracle.com ([156.151.31.85]:48942) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h0pUK-0006TF-12 for 34621@debbugs.gnu.org; Mon, 04 Mar 2019 10:26:44 -0500 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x24FOTvb097683; Mon, 4 Mar 2019 15:26:36 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=mime-version : message-id : date : from : sender : to : subject : references : in-reply-to : content-type : content-transfer-encoding; s=corp-2018-07-02; bh=AWvUxGgVgk4OWTM2fAegE7LX0teJpxtAlWYAHUgs6Yc=; b=GX1C1j1wUNl60mMyMq624iskAtGC9uIyW9h5WAD3A0WROGuZeOXitcT+0aMpYz1XROxN EPNh1WkER+hqEWHZRvzOUrHTJSRYkgy0iPLYF3WMNLQo72w6rsFUZCmpBMZlSPtiGjnQ ztdcoTa1+HHGNK5spLY5vtAMla+G2n6WV6O3MikY+TSCcbXXGhDRBsE/yrorOSJ3IIDK dgPusaSg4B4Ae9TJS4IN1oycAllY1GiBXoQ3DYPyH6yCml7TFUV4tSfZssEwH2i3n3AW 7tZRSGYIUx7G0b3zBL1vYTpTu3pGS2CNUmh5kcOs2pkw5DpvrvY1LcNw08Pf9yqJEl0r 3A== Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by userp2120.oracle.com with ESMTP id 2qyjfr7br7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 04 Mar 2019 15:26:36 +0000 Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id x24FQUd3001125 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 4 Mar 2019 15:26:30 GMT Received: from abhmp0019.oracle.com (abhmp0019.oracle.com [141.146.116.25]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id x24FQSgF008174; Mon, 4 Mar 2019 15:26:30 GMT MIME-Version: 1.0 Message-ID: Date: Mon, 4 Mar 2019 07:26:27 -0800 (PST) From: Drew Adams References: <08e7108149ce2374fd0c9b7fc3e6ae38@reckondigital.com> In-Reply-To: X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 16.0.4810.0 (x86)] Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9184 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=944 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1903040112 X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > + (not (eq major-mode 'dired-mode)) > + (not (eq major-mode 'dired-mode)) I haven't followed this thread at all - dunno what the problem is that you're trying to solve. But I'm a bit surprised that Dired needs to be special-cased for grep in any way. Anyway, the reasom I'm writing is to suggest that you probably don't want (eq major-mode 'dired-mode). You probably want (derived-mode-p 'dired-mode). From unknown Fri Jun 13 11:47:28 2025 X-Loop: help-debbugs@gnu.org Subject: bug#34621: Patch Update Resent-From: Christopher Thorne Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 05 Mar 2019 10:50:01 +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 To: 34621@debbugs.gnu.org Cc: Drew Adams Received: via spool by 34621-submit@debbugs.gnu.org id=B34621.155178296520208 (code B ref 34621); Tue, 05 Mar 2019 10:50:01 +0000 Received: (at 34621) by debbugs.gnu.org; 5 Mar 2019 10:49:25 +0000 Received: from localhost ([127.0.0.1]:60604 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h17dU-0005Fr-Ow for submit@debbugs.gnu.org; Tue, 05 Mar 2019 05:49:25 -0500 Received: from relay1-d.mail.gandi.net ([217.70.183.193]:39511) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h17dS-0005Fg-4k for 34621@debbugs.gnu.org; Tue, 05 Mar 2019 05:49:23 -0500 Received: from webmail.gandi.net (webmail4.sd4.0x35.net [10.200.201.4]) (Authenticated sender: c.thorne@reckondigital.com) by relay1-d.mail.gandi.net (Postfix) with ESMTPA id 0499F24001A; Tue, 5 Mar 2019 10:49:18 +0000 (UTC) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Tue, 05 Mar 2019 10:49:18 +0000 From: Christopher Thorne Organization: Reckon Digital In-Reply-To: References: <08e7108149ce2374fd0c9b7fc3e6ae38@reckondigital.com> Message-ID: X-Sender: c.thorne@reckondigital.com User-Agent: Roundcube Webmail/1.1.2 X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Thanks Drew, I agree derived-mode-p is better. The reason for special casing dired is to stop rgrep taking extension suggestions from dired buffers, e.g. suggesting "*.11" as the rgrep file pattern in a dired buffer called "django-1.11". Here is the same fix but using derived-mode-p: diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el index 3fd2a7e701..83154872aa 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 (derived-mode-p '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 (derived-mode-p '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 On 2019-03-04 15:26, Drew Adams wrote: >> + (not (eq major-mode 'dired-mode)) >> + (not (eq major-mode 'dired-mode)) > > I haven't followed this thread at all - dunno > what the problem is that you're trying to solve. > But I'm a bit surprised that Dired needs to be > special-cased for grep in any way. > > Anyway, the reasom I'm writing is to suggest > that you probably don't want > (eq major-mode 'dired-mode). You probably > want (derived-mode-p 'dired-mode). From unknown Fri Jun 13 11:47:28 2025 X-Loop: help-debbugs@gnu.org Subject: bug#34621: Patch Update Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 05 Mar 2019 17:49: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 To: Christopher Thorne , 34621@debbugs.gnu.org Received: via spool by 34621-submit@debbugs.gnu.org id=B34621.155180813812002 (code B ref 34621); Tue, 05 Mar 2019 17:49:02 +0000 Received: (at 34621) by debbugs.gnu.org; 5 Mar 2019 17:48:58 +0000 Received: from localhost ([127.0.0.1]:33418 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h1EBW-00037W-8m for submit@debbugs.gnu.org; Tue, 05 Mar 2019 12:48:58 -0500 Received: from userp2120.oracle.com ([156.151.31.85]:45714) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h1EBV-00037I-6Y for 34621@debbugs.gnu.org; Tue, 05 Mar 2019 12:48:57 -0500 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x25HcZTG024084; Tue, 5 Mar 2019 17:48:48 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=mime-version : message-id : date : from : sender : to : subject : references : in-reply-to : content-type : content-transfer-encoding; s=corp-2018-07-02; bh=qscqYvNFgocBgUNo2HDz6sRzXoO5ikNCp0NPGSidYzU=; b=ar+AeikgJSbHHopDJpeTjxR1vjEf3XdHpjcIAxyRSkzbys0CoApwbT3FJTf2H8UmYv4i xOFvS2m9yq0xoA5cp/UHuTmrdLWkh7/QYqcoYoaXFymAUgKh0XHVbuOQo9xWKEO+gv3/ Hn04muYoVUuI07T7vl1QAbljLkIJQLnHZDC9yy09F2itniBoFMl0fcje1ZT6p/xFZnEb /+LmqPCkPP5+NvA+UhHMPoRDAx/FSchXVlMABNVB03DSAI3Xu3lzozctlyDfaHzzW18p na73HDghOGjtSMgnOTtMc/94hU8Hg2tyKqTkpYxQCO81trG3q0tYg0YR6Bo6n4iUaGkI 7g== Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by userp2120.oracle.com with ESMTP id 2qyjfreugp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 05 Mar 2019 17:48:48 +0000 Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id x25Hml8b006298 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 5 Mar 2019 17:48:47 GMT Received: from abhmp0019.oracle.com (abhmp0019.oracle.com [141.146.116.25]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id x25HmjMn015785; Tue, 5 Mar 2019 17:48:46 GMT MIME-Version: 1.0 Message-ID: Date: Tue, 5 Mar 2019 09:48:45 -0800 (PST) From: Drew Adams References: <08e7108149ce2374fd0c9b7fc3e6ae38@reckondigital.com> In-Reply-To: X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 16.0.4810.0 (x86)] Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9186 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1903050116 X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > The reason for special casing dired is to stop rgrep taking extension > suggestions from dired buffers, e.g. suggesting "*.11" as the rgrep > file pattern in a dired buffer called "django-1.11". I see. It sounds like `rgrep' should itself be changed to be more flexible or smarter, or to let users more easily control the default file-name pattern. It doesn't sound to me like this has anything, per se, to do with Dired. It has to do with how the default is determined, and that's apparently now being picked up from the buffer name. From unknown Fri Jun 13 11:47:28 2025 X-Loop: help-debbugs@gnu.org Subject: bug#34621: Patch Update Resent-From: Christopher Thorne Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 05 Mar 2019 18:23: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 To: 34621@debbugs.gnu.org Cc: Drew Adams Received: via spool by 34621-submit@debbugs.gnu.org id=B34621.155181014115372 (code B ref 34621); Tue, 05 Mar 2019 18:23:02 +0000 Received: (at 34621) by debbugs.gnu.org; 5 Mar 2019 18:22:21 +0000 Received: from localhost ([127.0.0.1]:33433 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h1Ehp-0003zs-A4 for submit@debbugs.gnu.org; Tue, 05 Mar 2019 13:22:21 -0500 Received: from relay10.mail.gandi.net ([217.70.178.230]:55039) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h1Ehn-0003zj-9U for 34621@debbugs.gnu.org; Tue, 05 Mar 2019 13:22:19 -0500 Received: from webmail.gandi.net (webmail4.sd4.0x35.net [10.200.201.4]) (Authenticated sender: c.thorne@reckondigital.com) by relay10.mail.gandi.net (Postfix) with ESMTPA id C74B4240008; Tue, 5 Mar 2019 18:22:15 +0000 (UTC) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Tue, 05 Mar 2019 18:22:15 +0000 From: Christopher Thorne Organization: Reckon Digital In-Reply-To: References: <08e7108149ce2374fd0c9b7fc3e6ae38@reckondigital.com> Message-ID: X-Sender: c.thorne@reckondigital.com User-Agent: Roundcube Webmail/1.1.2 X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) > It doesn't sound to me like this has anything, per se, > to do with Dired. It has to do with how the default is > determined, and that's apparently now being picked up > from the buffer name. Hmm, I think you're right that this isn't just isolated to dired. For example, I can start a shell-mode buffer, rename it to shell.txt and rgrep will now suggest "*.txt" as the default extension even though my buffer is unrelated to .txt files. An alternative I considered is only showing extension suggestions for buffers that are associated with a file (i.e. buffer-file-name is a non-empty string). Can you think of any cases where this would fall down? From unknown Fri Jun 13 11:47:28 2025 X-Loop: help-debbugs@gnu.org Subject: bug#34621: Patch Update Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 05 Mar 2019 18:45: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 To: Christopher Thorne , 34621@debbugs.gnu.org Received: via spool by 34621-submit@debbugs.gnu.org id=B34621.155181146117485 (code B ref 34621); Tue, 05 Mar 2019 18:45:02 +0000 Received: (at 34621) by debbugs.gnu.org; 5 Mar 2019 18:44:21 +0000 Received: from localhost ([127.0.0.1]:33441 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h1F37-0004Xx-4c for submit@debbugs.gnu.org; Tue, 05 Mar 2019 13:44:21 -0500 Received: from userp2130.oracle.com ([156.151.31.86]:45440) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h1F34-0004Xg-Au for 34621@debbugs.gnu.org; Tue, 05 Mar 2019 13:44:19 -0500 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x25IXcOP071579; Tue, 5 Mar 2019 18:44:12 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=mime-version : message-id : date : from : sender : to : subject : references : in-reply-to : content-type : content-transfer-encoding; s=corp-2018-07-02; bh=4lDeQx16TCdudzYPjs7iakY6TEudtB894hAHxerwPPs=; b=ej6PuqTE4QgTaPNWY3PRqwjJ4+m9ABbb/6uE29WrWNmfu3MHq/pxEc6E027IvKXLcPLQ 8lu2nQ2JwChQB1+muEVeyQC1Tm38W3LVRyqe6sMezdnzpuyDD2rWl9SpX3595G/jl781 kUoqYUKqhgxnGpgqg0123JhEiHkr614aqlg4u+V9p7XDkyZxoNP7VldfKsDz+ELvVhvM 0LyNWUFcQR0u2hYPjlPeC3KCibhJzbTgM0uB7IJe4V8L2dTzkYAKOvuXMKutJtk9LTpB cZw++xXW2zLG6xnxOyA43DFVK5NOExt2iD7XvRh8KsjJF7kjaU/oc9yAKTeq5rY3UPN1 aw== Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by userp2130.oracle.com with ESMTP id 2qyh8u78ph-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 05 Mar 2019 18:44:12 +0000 Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id x25IiBCS008119 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 5 Mar 2019 18:44:12 GMT Received: from abhmp0019.oracle.com (abhmp0019.oracle.com [141.146.116.25]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id x25IiAN6013215; Tue, 5 Mar 2019 18:44:11 GMT MIME-Version: 1.0 Message-ID: <40839b67-bce7-4a01-89f1-c14643b18b32@default> Date: Tue, 5 Mar 2019 10:44:10 -0800 (PST) From: Drew Adams References: <08e7108149ce2374fd0c9b7fc3e6ae38@reckondigital.com> In-Reply-To: X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 16.0.4810.0 (x86)] Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9186 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1903050122 X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > > It doesn't sound to me like this has anything, per se, > > to do with Dired. It has to do with how the default is > > determined, and that's apparently now being picked up > > from the buffer name. >=20 > Hmm, I think you're right that this isn't just isolated to dired. For > example, I can start a shell-mode buffer, rename it to shell.txt and > rgrep will now suggest "*.txt" as the default extension even though my > buffer is unrelated to .txt files. >=20 > An alternative I considered is only showing extension suggestions for > buffers that are associated with a file (i.e. buffer-file-name is a > non-empty string). Can you think of any cases where this would fall > down? I don't think it's a question of falling down. It's not obvious what a reasonable or smart default filename pattern is in most cases. Just because your current buffer is visiting a file does not at all imply that you want to search files with the same extension. I think you need to (for yourself) specify just what relation (if any) you want between the current buffer and the default filename pattern. If it's a question of improving `rgrep` then the determination of the default needs to be such that it's useful generally and typically, and perhaps user configurable. As an example, but for the search pattern only (not the filename pattern(s)), in `grep+.el' there is user option `grepp-default-regexp-fn` and a default function of the same name, as follows. (If the option value is not a function then the default function is used.) https://www.emacswiki.org/emacs/grep%2b.el I mention this only as an example of how you can provide some flexibility and user control. For filename pattern(s) obviously the ways of picking a default would be different. ------------8<-------------- grepp-default-regexp-fn is a variable defined in `grep+.el'. Its value is non-nil-symbol-name-nearest-point Documentation: Function of 0 args called to provide default search regexp to \\[grep]. Some reasonable choices are defined in `thingatpt+.el': `word-nearest-point', `non-nil-symbol-name-nearest-point', `region-or-non-nil-symbol-name-nearest-point', `sexp-nearest-point'. This is ignored if Transient Mark mode is on and the region is active and non-empty. In that case, the quoted (") region text is used as the default regexp. If `grepp-default-regexp-fn' is nil and no prefix arg is given to `grep', then no defaulting is done. Otherwise, if the value is not a function, then function `grepp-default-regexp-fn' does the defaulting. You can customize this variable. ------------8<-------------- (defun grepp-default-regexp-fn () "*Function of 0 args called to provide default search regexp to \\[grep]. This is used only if both of the following are true: - Transient Mark mode is off or the region is inactive or empty. - The value of option `grepp-default-regexp-fn' is `grepp-default-regexp-fn'. When this is used, the default regexp is provided by calling the first of these that references a defined function: - variable `grepp-default-regexp-fn' - variable `find-tag-default-function' - the `find-tag-default-function' property of the `major-mode' - function `non-nil-symbol-name-nearest-point', if bound - function `grep-tag-default'" (cond ((functionp grepp-default-regexp-fn) grepp-default-regexp-fn) (find-tag-default-function) ((get major-mode 'find-tag-default-function)) ((fboundp 'non-nil-symbol-name-nearest-point) 'non-nil-symbol-name-= nearest-point) (t 'find-tag-default))) From unknown Fri Jun 13 11:47:28 2025 X-Loop: help-debbugs@gnu.org Subject: bug#34621: Patch Update Resent-From: Christopher Thorne Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 06 Mar 2019 11:11: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 To: 34621@debbugs.gnu.org Cc: Drew Adams Received: via spool by 34621-submit@debbugs.gnu.org id=B34621.155187060930439 (code B ref 34621); Wed, 06 Mar 2019 11:11:02 +0000 Received: (at 34621) by debbugs.gnu.org; 6 Mar 2019 11:10:09 +0000 Received: from localhost ([127.0.0.1]:33772 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h1UR6-0007uq-Ue for submit@debbugs.gnu.org; Wed, 06 Mar 2019 06:10:09 -0500 Received: from relay4-d.mail.gandi.net ([217.70.183.196]:49429) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h1UR5-0007uf-24 for 34621@debbugs.gnu.org; Wed, 06 Mar 2019 06:10:08 -0500 Received: from webmail.gandi.net (webmail11.sd4.0x35.net [10.200.201.11]) (Authenticated sender: c.thorne@reckondigital.com) by relay4-d.mail.gandi.net (Postfix) with ESMTPA id 78035E0018; Wed, 6 Mar 2019 11:10:03 +0000 (UTC) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Wed, 06 Mar 2019 11:10:03 +0000 From: Christopher Thorne Organization: Reckon Digital In-Reply-To: <40839b67-bce7-4a01-89f1-c14643b18b32@default> References: <08e7108149ce2374fd0c9b7fc3e6ae38@reckondigital.com> <40839b67-bce7-4a01-89f1-c14643b18b32@default> Message-ID: <80f4335be923e21fe782780c6812a03f@reckondigital.com> X-Sender: c.thorne@reckondigital.com User-Agent: Roundcube Webmail/1.1.2 X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Thanks for the input, Drew. > It's not obvious what a reasonable or smart default > filename pattern is in most cases. Just because > your current buffer is visiting a file does not at > all imply that you want to search files with the > same extension. > > I think you need to (for yourself) specify just > what relation (if any) you want between the current > buffer and the default filename pattern. Personally I think the current behaviour of searching files with the same extension works quite well in most cases. There is also some flexibility with aliases which means that if you're in a "*.c" file the default pattern becomes "*.[ch]". However, I like the idea of providing more flexibility like `grepp-default-regexp-fn`. This would mean a buffer in c-mode could always suggest *.[ch] regardless of its buffer/file name. More importantly, dired could implement this so that no default patterns are suggested for dired buffers. I will consider both (1) using only buffer-file-name instead of buffer-name (2) enabling rgrep to delegate extension suggestions to major modes. (1) would fix the case I'm personally encountering with dired, but (2) may be better in the long term and could cover more cases that I'm currently imagining. From unknown Fri Jun 13 11:47:28 2025 X-Loop: help-debbugs@gnu.org Subject: bug#34621: [PATCH] lisp/progmodes/grep.el (grep-read-files): Add file-directory-p check Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 17 Mar 2019 21:39:01 +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 To: Christopher Thorne Cc: 34621@debbugs.gnu.org Received: via spool by 34621-submit@debbugs.gnu.org id=B34621.155285870717354 (code B ref 34621); Sun, 17 Mar 2019 21:39:01 +0000 Received: (at 34621) by debbugs.gnu.org; 17 Mar 2019 21:38:27 +0000 Received: from localhost ([127.0.0.1]:47838 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h5dUB-0004Vp-Ib for submit@debbugs.gnu.org; Sun, 17 Mar 2019 17:38:27 -0400 Received: from bird.maple.relay.mailchannels.net ([23.83.214.17]:36690) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h5dU9-0004Vg-EY for 34621@debbugs.gnu.org; Sun, 17 Mar 2019 17:38:26 -0400 X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 2F3EE5E0C80; Sun, 17 Mar 2019 21:38:24 +0000 (UTC) Received: from pdx1-sub0-mail-a47.g.dreamhost.com (100-96-7-26.trex.outbound.svc.cluster.local [100.96.7.26]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id EAEB85E011E; Sun, 17 Mar 2019 21:38:23 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Received: from pdx1-sub0-mail-a47.g.dreamhost.com ([TEMPUNAVAIL]. [64.90.62.162]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.16.3); Sun, 17 Mar 2019 21:38:24 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-Stretch-Snatch: 0fcf311a2b614cf2_1552858704035_3452015522 X-MC-Loop-Signature: 1552858704035:396747015 X-MC-Ingress-Time: 1552858704034 Received: from pdx1-sub0-mail-a47.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a47.g.dreamhost.com (Postfix) with ESMTP id A5F678042D; Sun, 17 Mar 2019 14:38:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=linkov.net; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=linkov.net; bh=+A7Zhs3GG0KWqQuKwUcIPQuez8M=; b= 3YkQG7HvbiR8Y5vhEKRjM4uwVXj76iTgi1jsDTCcgLLpK/dYU2EIVNr1fVZDM3G3 7/VNsDofwBOzV1PMXUvCVG9U+FB+rsMV342uCQEHOHt40Do1X+2fO6nbAJGmarSd T6/SeSX+VKDTrq5x7WIA3K6edhKBGRtCG3y8N79ST5k= Received: from mail.jurta.org (m91-129-106-13.cust.tele2.ee [91.129.106.13]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by pdx1-sub0-mail-a47.g.dreamhost.com (Postfix) with ESMTPSA id 820B48042B; Sun, 17 Mar 2019 14:38:16 -0700 (PDT) X-DH-BACKEND: pdx1-sub0-mail-a47 From: Juri Linkov Organization: LINKOV.NET References: <08e7108149ce2374fd0c9b7fc3e6ae38@reckondigital.com> <40839b67-bce7-4a01-89f1-c14643b18b32@default> <80f4335be923e21fe782780c6812a03f@reckondigital.com> Date: Sun, 17 Mar 2019 23:28:51 +0200 In-Reply-To: <80f4335be923e21fe782780c6812a03f@reckondigital.com> (Christopher Thorne's message of "Wed, 06 Mar 2019 11:10:03 +0000") Message-ID: <878sxd248k.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: -100 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedutddrheelgdduheegucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuggftfghnshhusghstghrihgsvgdpffftgfetoffjqffuvfenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvufhofhffjgfkfgggtgesthdtredttdertdenucfhrhhomheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqeenucfkphepledurdduvdelrddutdeirddufeenucfrrghrrghmpehmohguvgepshhmthhppdhhvghlohepmhgrihhlrdhjuhhrthgrrdhorhhgpdhinhgvthepledurdduvdelrddutdeirddufedprhgvthhurhhnqdhprghthheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqedpmhgrihhlfhhrohhmpehjuhhriheslhhinhhkohhvrdhnvghtpdhnrhgtphhtthhopegtrdhthhhorhhnvgesrhgvtghkohhnughighhithgrlhdrtghomhenucevlhhushhtvghrufhiiigvpedt X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > More importantly, dired could implement this so that no default > patterns are suggested for dired buffers. For Dired, it would make more sense to use a default based on the filename under point by using dired-get-filename, so for example when in the Dired buffer in a directory called "django-1.11" the cursor is on a file called "test.c" then the default could be *.[ch] From unknown Fri Jun 13 11:47:28 2025 X-Loop: help-debbugs@gnu.org Subject: bug#34621: [PATCH] Fix rgrep in dired taking default search file pattern from directory name (e.g. *.11 for django-1.11) Resent-From: Christopher Thorne Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 08 Apr 2019 10:42: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 To: 34621@debbugs.gnu.org Received: via spool by 34621-submit@debbugs.gnu.org id=B34621.155472009011266 (code B ref 34621); Mon, 08 Apr 2019 10:42:02 +0000 Received: (at 34621) by debbugs.gnu.org; 8 Apr 2019 10:41:30 +0000 Received: from localhost ([127.0.0.1]:49027 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hDRiQ-0002vZ-Vn for submit@debbugs.gnu.org; Mon, 08 Apr 2019 06:41:29 -0400 Received: from relay9-d.mail.gandi.net ([217.70.183.199]:38621) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hDRiO-0002vP-ME for 34621@debbugs.gnu.org; Mon, 08 Apr 2019 06:41:25 -0400 Received: from webmail.gandi.net (webmail18.sd4.0x35.net [10.200.201.18]) (Authenticated sender: c.thorne@reckondigital.com) by relay9-d.mail.gandi.net (Postfix) with ESMTPA id EF1BEFF810 for <34621@debbugs.gnu.org>; Mon, 8 Apr 2019 10:41:20 +0000 (UTC) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Mon, 08 Apr 2019 11:41:20 +0100 From: Christopher Thorne Organization: Reckon Digital In-Reply-To: <878sxd248k.fsf@mail.linkov.net> References: <08e7108149ce2374fd0c9b7fc3e6ae38@reckondigital.com> <40839b67-bce7-4a01-89f1-c14643b18b32@default> <80f4335be923e21fe782780c6812a03f@reckondigital.com> <878sxd248k.fsf@mail.linkov.net> Message-ID: <82347809b60dfc4e18a822d2d604475c@reckondigital.com> X-Sender: c.thorne@reckondigital.com User-Agent: Roundcube Webmail/1.3.8 X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) I've updated the patch following input from Drew and Juri. This now adds 'grep-default-file-pattern-function' which major modes can implement. Dired implements this to take the extension of the file at point, with a default of 'all', thus solving the issue I was having with the django-1.11 directory mentioned earlier in the thread. Behaviour for major modes that don't implement 'grep-default-file-pattern-function' will remain as before. diff --git a/lisp/dired.el b/lisp/dired.el index 3cb645eea7..219acbf148 100644 --- a/lisp/dired.el +++ b/lisp/dired.el @@ -4138,6 +4138,19 @@ dired-restore-desktop-buffer (add-to-list 'desktop-buffer-mode-handlers '(dired-mode . dired-restore-desktop-buffer)) +(defun dired-grep-default-file-pattern () + "Use extension of file at point as the default file pattern for grep. +If a directory or nothing is found at point, fallback to 'all'." + (let* ((dired-file-name (ignore-errors (dired-get-filename))) + (dired-file-extension (if (and dired-file-name + (not (file-directory-p dired-file-name))) + (file-name-extension dired-file-name)))) + (if dired-file-extension + (concat "*." dired-file-extension) + "all"))) +(put 'dired-mode 'grep-default-file-pattern-function 'dired-grep-default-file-pattern) + + (provide 'dired) (run-hooks 'dired-load-hook) ; for your customizations diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el index 3fd2a7e701..54d1412a66 100644 --- a/lisp/progmodes/grep.el +++ b/lisp/progmodes/grep.el @@ -961,6 +961,8 @@ grep-read-files (fn (and bn (stringp bn) (file-name-nondirectory bn))) + (default-file-pattern-function + (get major-mode 'grep-default-file-pattern-function)) (default-alias (and fn (let ((aliases (remove (assoc "all" grep-files-aliases) @@ -982,10 +984,12 @@ grep-read-files (let ((ext (file-name-extension fn))) (and ext (concat "*." ext))))) (default - (or default-alias - default-extension - (car grep-files-history) - (car (car grep-files-aliases)))) + (if default-file-pattern-function + (funcall default-file-pattern-function) + (or default-alias + default-extension + (car grep-files-history) + (car (car grep-files-aliases))))) (files (completing-read (concat "Search for \"" regexp "\" in files matching wildcard" Changelog entry: * lisp/progmodes/grep.el (grep-read-files): Allow major modes to define default search file pattern * lisp/dired.el (dired-grep-default-file-pattern): Define default search file pattern for grep Thanks for the input so far. Any further suggestions are welcome. From unknown Fri Jun 13 11:47:28 2025 X-Loop: help-debbugs@gnu.org Subject: bug#34621: [PATCH] Fix rgrep in dired taking default search file pattern from directory name (e.g. *.11 for django-1.11) Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 08 Apr 2019 20:29:03 +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 To: Christopher Thorne Cc: 34621@debbugs.gnu.org Received: via spool by 34621-submit@debbugs.gnu.org id=B34621.155475531419663 (code B ref 34621); Mon, 08 Apr 2019 20:29:03 +0000 Received: (at 34621) by debbugs.gnu.org; 8 Apr 2019 20:28:34 +0000 Received: from localhost ([127.0.0.1]:50207 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hDasa-000574-Pw for submit@debbugs.gnu.org; Mon, 08 Apr 2019 16:28:33 -0400 Received: from ostrich.birch.relay.mailchannels.net ([23.83.209.138]:14517) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hDasY-00056u-KI for 34621@debbugs.gnu.org; Mon, 08 Apr 2019 16:28:31 -0400 X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 7C7F51258C2; Mon, 8 Apr 2019 20:28:29 +0000 (UTC) Received: from pdx1-sub0-mail-a91.g.dreamhost.com (unknown [100.96.28.55]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id BEE991241F2; Mon, 8 Apr 2019 20:28:28 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Received: from pdx1-sub0-mail-a91.g.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.17.2); Mon, 08 Apr 2019 20:28:29 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-Minister-Tangy: 278ac5d871b6354a_1554755308966_3864133044 X-MC-Loop-Signature: 1554755308966:3645918888 X-MC-Ingress-Time: 1554755308965 Received: from pdx1-sub0-mail-a91.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a91.g.dreamhost.com (Postfix) with ESMTP id 3C69E7FA61; Mon, 8 Apr 2019 13:28:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=linkov.net; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=linkov.net; bh=G2mbncMnNTHEUhfYlc/9yWD3/+c=; b= aKTJcKe0Uy/FvjVvxiT9Eh1v/4fgll03UbCgWBppUv9/+yOhz4tqJWpmeGllx55/ aEhr6hRueMYEJ3RQY5ss8DdzKUHDvNnSDsSrWZxCboaJHYOVIc5dmtyvQ9BZHGXY TZi9LhNFJV1flpR+qav4qBV2EI68BvaBAp2Z284jvXs= Received: from mail.jurta.org (m91-129-99-202.cust.tele2.ee [91.129.99.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by pdx1-sub0-mail-a91.g.dreamhost.com (Postfix) with ESMTPSA id DB5E37FA57; Mon, 8 Apr 2019 13:28:25 -0700 (PDT) X-DH-BACKEND: pdx1-sub0-mail-a91 From: Juri Linkov Organization: LINKOV.NET References: <08e7108149ce2374fd0c9b7fc3e6ae38@reckondigital.com> <40839b67-bce7-4a01-89f1-c14643b18b32@default> <80f4335be923e21fe782780c6812a03f@reckondigital.com> <878sxd248k.fsf@mail.linkov.net> <82347809b60dfc4e18a822d2d604475c@reckondigital.com> Date: Mon, 08 Apr 2019 22:44:20 +0300 In-Reply-To: <82347809b60dfc4e18a822d2d604475c@reckondigital.com> (Christopher Thorne's message of "Mon, 08 Apr 2019 11:41:20 +0100") Message-ID: <87mul0wacr.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: -100 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgeduuddrudefgdduhedvucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuggftfghnshhusghstghrihgsvgdpffftgfetoffjqffuvfenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvufhofhffjgfkfgggtgesthdtredttdertdenucfhrhhomheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqeenucfkphepledurdduvdelrdelledrvddtvdenucfrrghrrghmpehmohguvgepshhmthhppdhhvghlohepmhgrihhlrdhjuhhrthgrrdhorhhgpdhinhgvthepledurdduvdelrdelledrvddtvddprhgvthhurhhnqdhprghthheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqedpmhgrihhlfhhrohhmpehjuhhriheslhhinhhkohhvrdhnvghtpdhnrhgtphhtthhopegtrdhthhhorhhnvgesrhgvtghkohhnughighhithgrlhdrtghomhenucevlhhushhtvghrufhiiigvpedv X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > I've updated the patch following input from Drew and Juri. > This now adds 'grep-default-file-pattern-function' which major modes > can implement. > Dired implements this to take the extension of the file at point, with > a default of 'all', > thus solving the issue I was having with the django-1.11 directory > mentioned earlier in the thread. > Behaviour for major modes that don't implement > 'grep-default-file-pattern-function' will remain as before. Thanks, this is better than previous versions. Even more, you don't need any changes in dired.el. Just use in grep.el (run-hook-with-args-until-success 'file-name-at-point-functions) because 'file-name-at-point-functions' already has the right value in Dired. You can call it at the very beginning of grep-read-files in the same 'or' before buffer-file-name, so the existing code will take care about getting its file extension. From unknown Fri Jun 13 11:47:28 2025 X-Loop: help-debbugs@gnu.org Subject: bug#34621: [PATCH] Fix rgrep in dired taking default search file pattern from directory name (e.g. *.11 for django-1.11) Resent-From: Christopher Thorne Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 09 Apr 2019 11:10: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 To: 34621@debbugs.gnu.org Cc: juri@linkov.net Received: via spool by 34621-submit@debbugs.gnu.org id=B34621.15548081747914 (code B ref 34621); Tue, 09 Apr 2019 11:10:02 +0000 Received: (at 34621) by debbugs.gnu.org; 9 Apr 2019 11:09:34 +0000 Received: from localhost ([127.0.0.1]:50620 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hDodB-00023V-Rw for submit@debbugs.gnu.org; Tue, 09 Apr 2019 07:09:34 -0400 Received: from relay12.mail.gandi.net ([217.70.178.232]:48869) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hDod9-000239-82 for 34621@debbugs.gnu.org; Tue, 09 Apr 2019 07:09:32 -0400 Received: from webmail.gandi.net (webmail18.sd4.0x35.net [10.200.201.18]) (Authenticated sender: c.thorne@reckondigital.com) by relay12.mail.gandi.net (Postfix) with ESMTPA id 4410B20000D; Tue, 9 Apr 2019 11:09:27 +0000 (UTC) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Tue, 09 Apr 2019 12:09:27 +0100 From: Christopher Thorne Organization: Reckon Digital In-Reply-To: <87mul0wacr.fsf@mail.linkov.net> References: <08e7108149ce2374fd0c9b7fc3e6ae38@reckondigital.com> <40839b67-bce7-4a01-89f1-c14643b18b32@default> <80f4335be923e21fe782780c6812a03f@reckondigital.com> <878sxd248k.fsf@mail.linkov.net> <82347809b60dfc4e18a822d2d604475c@reckondigital.com> <87mul0wacr.fsf@mail.linkov.net> Message-ID: <336a681ce53ad7623fc5f98936577d82@reckondigital.com> X-Sender: c.thorne@reckondigital.com User-Agent: Roundcube Webmail/1.3.8 X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) > Even more, you don't need any changes in dired.el. Just use in grep.el > > (run-hook-with-args-until-success 'file-name-at-point-functions) > > because 'file-name-at-point-functions' already has the right value in > Dired. > > You can call it at the very beginning of grep-read-files in the same > 'or' > before buffer-file-name, so the existing code will take care about > getting > its file extension. Thanks, Juri. I tried this: diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el index 3fd2a7e701..4fb4490104 100644 --- a/lisp/progmodes/grep.el +++ b/lisp/progmodes/grep.el @@ -956,11 +956,17 @@ grep-read-files The pattern can include shell wildcards. As whitespace triggers completion when entering a pattern, including it requires quoting, e.g. `\\[quoted-insert]'." - (let* ((bn (or (buffer-file-name) + (let* ((file-name-at-point (run-hook-with-args-until-success 'file-name-at-point-functions)) + (bn (or (if (and (stringp file-name-at-point) + (not (file-directory-p file-name-at-point))) + file-name-at-point) + (buffer-file-name) (replace-regexp-in-string "<[0-9]+>\\'" "" (buffer-name)))) (fn (and bn However, it doesn't cover the case where emacs is in a dired buffer called django-1.11 with nothing at point. In this case, *.11 will be suggested because buffer-name is used. I'm not sure how to fix this in grep.el without an "if is dired" check. That said, I do like the fact that this approach preserves the existing aliasing behaviour (e.g. *.c -> *.[ch]), so I've changed the approach of the previous patch to let major modes define the file-name grep should use rather than extension: diff --git a/lisp/dired.el b/lisp/dired.el index 3cb645eea7..d66f12b3a6 100644 --- a/lisp/dired.el +++ b/lisp/dired.el @@ -4138,6 +4138,16 @@ dired-restore-desktop-buffer (add-to-list 'desktop-buffer-mode-handlers '(dired-mode . dired-restore-desktop-buffer)) +(defun dired-grep-file-name-for-default-pattern () + "Use file at point as the file for grep's default file-name pattern suggestion. +If a directory or nothing is found at point, return nil." + (let ((dired-file-name (run-hook-with-args-until-success 'file-name-at-point-functions))) + (if (and dired-file-name + (not (file-directory-p dired-file-name))) + dired-file-name))) +(put 'dired-mode 'grep-file-name-for-default-pattern-function 'dired-grep-file-name-for-default-pattern) + + (provide 'dired) (run-hooks 'dired-load-hook) ; for your customizations diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el index 3fd2a7e701..5fb56a33be 100644 --- a/lisp/progmodes/grep.el +++ b/lisp/progmodes/grep.el @@ -956,8 +956,12 @@ grep-read-files The pattern can include shell wildcards. As whitespace triggers completion when entering a pattern, including it requires quoting, e.g. `\\[quoted-insert]'." - (let* ((bn (or (buffer-file-name) - (replace-regexp-in-string "<[0-9]+>\\'" "" (buffer-name)))) + (let* ((file-name-for-default-pattern-function + (get major-mode 'grep-file-name-for-default-pattern-function)) + (bn (if file-name-for-default-pattern-function + (funcall file-name-for-default-pattern-function) + (or (buffer-file-name) + (replace-regexp-in-string "<[0-9]+>\\'" "" (buffer-name))))) (fn (and bn (stringp bn) (file-name-nondirectory bn))) Changelog entry: * lisp/progmodes/grep.el (grep-read-files): Allow major modes to define file name to use for default search pattern * lisp/dired.el (dired-grep-file-name-for-default-pattern): Use file at point for grep file name pattern Let me know if there are any further improvements I can make. Regards, Chris From unknown Fri Jun 13 11:47:28 2025 X-Loop: help-debbugs@gnu.org Subject: bug#34621: [PATCH] Fix rgrep in dired taking default search file pattern from directory name (e.g. *.11 for django-1.11) Resent-From: Noam Postavsky Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 09 Apr 2019 11:53: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 To: Christopher Thorne Cc: 34621@debbugs.gnu.org, juri@linkov.net Received: via spool by 34621-submit@debbugs.gnu.org id=B34621.155481075419929 (code B ref 34621); Tue, 09 Apr 2019 11:53:02 +0000 Received: (at 34621) by debbugs.gnu.org; 9 Apr 2019 11:52:34 +0000 Received: from localhost ([127.0.0.1]:50648 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hDpIn-0005BN-Rd for submit@debbugs.gnu.org; Tue, 09 Apr 2019 07:52:34 -0400 Received: from mail-qk1-f195.google.com ([209.85.222.195]:35129) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hDpIl-0005BB-TI for 34621@debbugs.gnu.org; Tue, 09 Apr 2019 07:52:32 -0400 Received: by mail-qk1-f195.google.com with SMTP id a71so10001363qkg.2 for <34621@debbugs.gnu.org>; Tue, 09 Apr 2019 04:52:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=7U8+OGNMVR+1VbVjXPIcxutdGW1jo15AeelVHB7IivE=; b=vOFTbFnSp9bXRx1nSSdjWSiXQghXdU+KCGea0hiGXqUKojzX4UrypKVCHTRAqnd2DE Br/Jd0apLYDXfTPnjmvKZZxMAd2nh/h5NL73yDYZkRfP/NjGb9lfbZuXk2blJGdWZXyU csdnXZ7ycBxQE9678RfsyxlSrhdfod6xUIXV5vhVB6fNBrh/FbSihPUEnuhsl2LiE+TQ +kNThs2r5Nx+pvo4UeMvi6BSGPMNmVeL65I2hR4Wmo/Ug50b+rm4QKl4r4kke1wlAEoO oMmkr+RSaiB5e+LFMWAcBcQ5Vi2AwIsVb+EG/yE8kHR9KBZCyDVPN/eereRkWpMZ0teD 4OvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=7U8+OGNMVR+1VbVjXPIcxutdGW1jo15AeelVHB7IivE=; b=emsMfQl3AOZTldUETWaoNGroRvO/jFlZNAMCscLbhhLUrAc9CxvyUyMoHgazVUNg0f WtqN4f3znIi1F02Iss9LzuXJtIiOFFY2t7x3EIKLnGElnImn5XQqSYlhDN5LwOAjVLzv mDxIPQx+uVWbyphviZjQJ7f7IiISPS1ECuZlIe8F0duUeGtm18CxAZDyEeOQry/8fq6M UZieu4UibT9mKQlkqPMvy0KF91P3Mv3WO1vaTD7lK3AUI1r9iTj47xEmc3PTSWBd21m9 fhv/+/0qjvmMZcFtmdBAFIOozuSCjQGGsVbuHf0fjJvRwcAs3IZJl32QruHzJoJELPGY zPEw== X-Gm-Message-State: APjAAAVbd87SypZjRN8W8rYyZBJ6/G2K1J0tEdS1Xc/TAi3xRKN9IKFE 50okOuEOVYfisLV3Dv82uY7sWPsS X-Google-Smtp-Source: APXvYqy4S/QGOVKwmvoNNEfMjlnL/b5mT0ruwM0NkxB5fOruFlqQ3Qct9KEsqOgctfE13Z13Wy45hw== X-Received: by 2002:a05:620a:1472:: with SMTP id j18mr27387449qkl.63.1554810746330; Tue, 09 Apr 2019 04:52:26 -0700 (PDT) Received: from minid (cbl-45-2-119-34.yyz.frontiernetworks.ca. [45.2.119.34]) by smtp.googlemail.com with ESMTPSA id x28sm21741738qtx.71.2019.04.09.04.52.24 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 09 Apr 2019 04:52:25 -0700 (PDT) From: Noam Postavsky References: <08e7108149ce2374fd0c9b7fc3e6ae38@reckondigital.com> <40839b67-bce7-4a01-89f1-c14643b18b32@default> <80f4335be923e21fe782780c6812a03f@reckondigital.com> <878sxd248k.fsf@mail.linkov.net> <82347809b60dfc4e18a822d2d604475c@reckondigital.com> <87mul0wacr.fsf@mail.linkov.net> <336a681ce53ad7623fc5f98936577d82@reckondigital.com> Date: Tue, 09 Apr 2019 07:52:24 -0400 In-Reply-To: <336a681ce53ad7623fc5f98936577d82@reckondigital.com> (Christopher Thorne's message of "Tue, 09 Apr 2019 12:09:27 +0100") Message-ID: <8736mrcs5j.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1.91 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.3 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.3 (-) > + (let* ((file-name-at-point (run-hook-with-args-until-success > 'file-name-at-point-functions)) Just a minor suggestion meta suggestion: post your patches by attaching the output from 'git format-patch', rather than inlining the output of git diff. That will avoid patch corruption due to line-wrapping, like in the above quote (although that line is also a bit long, and you should break it manually). > Changelog entry: > * lisp/progmodes/grep.el (grep-read-files): Allow major modes to > define file name to use for default search pattern > * lisp/dired.el (dired-grep-file-name-for-default-pattern): Use file > at point > for grep file name pattern And the ChangeLog entry then goes in the git commit message. It's much easier for other people to apply your patch that way. From unknown Fri Jun 13 11:47:28 2025 X-Loop: help-debbugs@gnu.org Subject: bug#34621: [PATCH] Fix rgrep in dired taking default search file pattern from directory name (e.g. *.11 for django-1.11) Resent-From: Christopher Thorne Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 09 Apr 2019 12:24: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 To: 34621@debbugs.gnu.org Cc: Noam Postavsky Received: via spool by 34621-submit@debbugs.gnu.org id=B34621.155481259722748 (code B ref 34621); Tue, 09 Apr 2019 12:24:02 +0000 Received: (at 34621) by debbugs.gnu.org; 9 Apr 2019 12:23:17 +0000 Received: from localhost ([127.0.0.1]:50668 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hDpmX-0005up-C4 for submit@debbugs.gnu.org; Tue, 09 Apr 2019 08:23:17 -0400 Received: from relay10.mail.gandi.net ([217.70.178.230]:33511) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hDpmV-0005ug-7x for 34621@debbugs.gnu.org; Tue, 09 Apr 2019 08:23:16 -0400 Received: from webmail.gandi.net (webmail18.sd4.0x35.net [10.200.201.18]) (Authenticated sender: c.thorne@reckondigital.com) by relay10.mail.gandi.net (Postfix) with ESMTPA id B6E85240002; Tue, 9 Apr 2019 12:23:11 +0000 (UTC) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=_a1906ca09d371dbf4c6cc7f05bf2f5c5" Date: Tue, 09 Apr 2019 13:23:11 +0100 From: Christopher Thorne Organization: Reckon Digital In-Reply-To: <8736mrcs5j.fsf@gmail.com> References: <08e7108149ce2374fd0c9b7fc3e6ae38@reckondigital.com> <40839b67-bce7-4a01-89f1-c14643b18b32@default> <80f4335be923e21fe782780c6812a03f@reckondigital.com> <878sxd248k.fsf@mail.linkov.net> <82347809b60dfc4e18a822d2d604475c@reckondigital.com> <87mul0wacr.fsf@mail.linkov.net> <336a681ce53ad7623fc5f98936577d82@reckondigital.com> <8736mrcs5j.fsf@gmail.com> Message-ID: <873a32455e7fd2288e3280ecaebc5f00@reckondigital.com> X-Sender: c.thorne@reckondigital.com User-Agent: Roundcube Webmail/1.3.8 X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --=_a1906ca09d371dbf4c6cc7f05bf2f5c5 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; format=flowed > Just a minor suggestion meta suggestion: post your patches by attaching > the output from 'git format-patch', rather than inlining the output of > git diff. That will avoid patch corruption due to line-wrapping, like > in the above quote (although that line is also a bit long, and you > should break it manually). Thanks, Noam. Trying this now. Patch should be attached. --=_a1906ca09d371dbf4c6cc7f05bf2f5c5 Content-Transfer-Encoding: base64 Content-Type: text/x-diff; name=0001-Fix-rgrep-in-dired-using-directory-for-search-file-p.patch Content-Disposition: attachment; filename=0001-Fix-rgrep-in-dired-using-directory-for-search-file-p.patch; size=2316 RnJvbSBhZjU1MTY4M2Y5ZmY2YzliY2RkOTY3MTM1YTcyYTI2OGVkYTYxNzdhIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBDaHJpc3RvcGhlciBUaG9ybmUgPGMudGhvcm5lQHJlY2tvbmRp Z2l0YWwuY29tPgpEYXRlOiBUdWUsIDkgQXByIDIwMTkgMTM6MTI6MzkgKzAxMDAKU3ViamVjdDog W1BBVENIXSBGaXggcmdyZXAgaW4gZGlyZWQgdXNpbmcgZGlyZWN0b3J5IGZvciBzZWFyY2ggZmls ZSBwYXR0ZXJuCiAoQnVnIzM0NjIxKQoKKiBsaXNwL3Byb2dtb2Rlcy9ncmVwLmVsIChncmVwLXJl YWQtZmlsZXMpOiBBbGxvdyBtYWpvciBtb2RlcyB0bwpkZWZpbmUgZmlsZSBuYW1lIHRvIHVzZSBm b3IgZGVmYXVsdCBzZWFyY2ggcGF0dGVybgoqIGxpc3AvZGlyZWQuZWwgKGRpcmVkLWdyZXAtZmls ZS1uYW1lLWZvci1kZWZhdWx0LXBhdHRlcm4pOiBVc2UgZmlsZQphdCBwb2ludCBmb3IgZ3JlcCBm aWxlIG5hbWUgcGF0dGVybgotLS0KIGxpc3AvZGlyZWQuZWwgICAgICAgICAgfCAxMSArKysrKysr KysrKwogbGlzcC9wcm9nbW9kZXMvZ3JlcC5lbCB8ICA4ICsrKysrKy0tCiAyIGZpbGVzIGNoYW5n ZWQsIDE3IGluc2VydGlvbnMoKyksIDIgZGVsZXRpb25zKC0pCgpkaWZmIC0tZ2l0IGEvbGlzcC9k aXJlZC5lbCBiL2xpc3AvZGlyZWQuZWwKaW5kZXggZmMwYjcxMjM4Yi4uMzNhYmNhNTUwYSAxMDA2 NDQKLS0tIGEvbGlzcC9kaXJlZC5lbAorKysgYi9saXNwL2RpcmVkLmVsCkBAIC00MTYyLDYgKzQx NjIsMTcgQEAgZGlyZWQtcmVzdG9yZS1kZXNrdG9wLWJ1ZmZlcgogKGFkZC10by1saXN0ICdkZXNr dG9wLWJ1ZmZlci1tb2RlLWhhbmRsZXJzCiAJICAgICAnKGRpcmVkLW1vZGUgLiBkaXJlZC1yZXN0 b3JlLWRlc2t0b3AtYnVmZmVyKSkKIAorKGRlZnVuIGRpcmVkLWdyZXAtZmlsZS1uYW1lLWZvci1k ZWZhdWx0LXBhdHRlcm4gKCkKKyAgIlVzZSBmaWxlIGF0IHBvaW50IGFzIHRoZSBmaWxlIGZvciBn cmVwJ3MgZGVmYXVsdCBmaWxlLW5hbWUgcGF0dGVybiBzdWdnZXN0aW9uLgorSWYgYSBkaXJlY3Rv cnkgb3Igbm90aGluZyBpcyBmb3VuZCBhdCBwb2ludCwgcmV0dXJuIG5pbC4iCisgIChsZXQgKChk aXJlZC1maWxlLW5hbWUKKwkgIChydW4taG9vay13aXRoLWFyZ3MtdW50aWwtc3VjY2VzcyAnZmls ZS1uYW1lLWF0LXBvaW50LWZ1bmN0aW9ucykpKQorICAgIChpZiAoYW5kIGRpcmVkLWZpbGUtbmFt ZQorCSAgICAgKG5vdCAoZmlsZS1kaXJlY3RvcnktcCBkaXJlZC1maWxlLW5hbWUpKSkKKwlkaXJl ZC1maWxlLW5hbWUpKSkKKyhwdXQgJ2RpcmVkLW1vZGUgJ2dyZXAtZmlsZS1uYW1lLWZvci1kZWZh dWx0LXBhdHRlcm4tZnVuY3Rpb24gJ2RpcmVkLWdyZXAtZmlsZS1uYW1lLWZvci1kZWZhdWx0LXBh dHRlcm4pCisKKwogKHByb3ZpZGUgJ2RpcmVkKQogCiAocnVuLWhvb2tzICdkaXJlZC1sb2FkLWhv b2spCQk7IGZvciB5b3VyIGN1c3RvbWl6YXRpb25zCmRpZmYgLS1naXQgYS9saXNwL3Byb2dtb2Rl cy9ncmVwLmVsIGIvbGlzcC9wcm9nbW9kZXMvZ3JlcC5lbAppbmRleCBjMGY0NzE1OWM5Li5iMGJi OGU2OTI0IDEwMDY0NAotLS0gYS9saXNwL3Byb2dtb2Rlcy9ncmVwLmVsCisrKyBiL2xpc3AvcHJv Z21vZGVzL2dyZXAuZWwKQEAgLTk1OSw4ICs5NTksMTIgQEAgZ3JlcC1yZWFkLWZpbGVzCiBUaGUg cGF0dGVybiBjYW4gaW5jbHVkZSBzaGVsbCB3aWxkY2FyZHMuICBBcyB3aGl0ZXNwYWNlIHRyaWdn ZXJzCiBjb21wbGV0aW9uIHdoZW4gZW50ZXJpbmcgYSBwYXR0ZXJuLCBpbmNsdWRpbmcgaXQgcmVx dWlyZXMKIHF1b3RpbmcsIGUuZy4gYFxcW3F1b3RlZC1pbnNlcnRdPHNwYWNlPicuIgotICAobGV0 KiAoKGJuIChvciAoYnVmZmVyLWZpbGUtbmFtZSkKLQkJIChyZXBsYWNlLXJlZ2V4cC1pbi1zdHJp bmcgIjxbMC05XSs+XFwnIiAiIiAoYnVmZmVyLW5hbWUpKSkpCisgIChsZXQqICgoZmlsZS1uYW1l LWZvci1kZWZhdWx0LXBhdHRlcm4tZnVuY3Rpb24KKwkgICAoZ2V0IG1ham9yLW1vZGUgJ2dyZXAt ZmlsZS1uYW1lLWZvci1kZWZhdWx0LXBhdHRlcm4tZnVuY3Rpb24pKQorCSAoYm4gKGlmIGZpbGUt bmFtZS1mb3ItZGVmYXVsdC1wYXR0ZXJuLWZ1bmN0aW9uCisJCSAoZnVuY2FsbCBmaWxlLW5hbWUt Zm9yLWRlZmF1bHQtcGF0dGVybi1mdW5jdGlvbikKKwkgICAgICAgKG9yIChidWZmZXItZmlsZS1u YW1lKQorCQkgKHJlcGxhY2UtcmVnZXhwLWluLXN0cmluZyAiPFswLTldKz5cXCciICIiIChidWZm ZXItbmFtZSkpKSkpCiAJIChmbiAoYW5kIGJuCiAJCSAgKHN0cmluZ3AgYm4pCiAJCSAgKGZpbGUt bmFtZS1ub25kaXJlY3RvcnkgYm4pKSkKLS0gCjIuMTEuMAoK --=_a1906ca09d371dbf4c6cc7f05bf2f5c5-- From unknown Fri Jun 13 11:47:28 2025 X-Loop: help-debbugs@gnu.org Subject: bug#34621: [PATCH] Fix rgrep in dired taking default search file pattern from directory name (e.g. *.11 for django-1.11) Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 09 Apr 2019 14:20:01 +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 To: Christopher Thorne Cc: 34621@debbugs.gnu.org, npostavs@gmail.com Received: via spool by 34621-submit@debbugs.gnu.org id=B34621.155481954610952 (code B ref 34621); Tue, 09 Apr 2019 14:20:01 +0000 Received: (at 34621) by debbugs.gnu.org; 9 Apr 2019 14:19:06 +0000 Received: from localhost ([127.0.0.1]:51816 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hDrab-0002qa-KW for submit@debbugs.gnu.org; Tue, 09 Apr 2019 10:19:05 -0400 Received: from eggs.gnu.org ([209.51.188.92]:59122) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hDraZ-0002q5-O3 for 34621@debbugs.gnu.org; Tue, 09 Apr 2019 10:19:04 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:40428) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hDraT-00030g-NO; Tue, 09 Apr 2019 10:18:57 -0400 Received: from [176.228.60.248] (port=3333 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1hDraT-0005u6-0N; Tue, 09 Apr 2019 10:18:57 -0400 Date: Tue, 09 Apr 2019 17:18:54 +0300 Message-Id: <83d0lv6z3l.fsf@gnu.org> From: Eli Zaretskii In-reply-to: <873a32455e7fd2288e3280ecaebc5f00@reckondigital.com> (message from Christopher Thorne on Tue, 09 Apr 2019 13:23:11 +0100) References: <08e7108149ce2374fd0c9b7fc3e6ae38@reckondigital.com> <40839b67-bce7-4a01-89f1-c14643b18b32@default> <80f4335be923e21fe782780c6812a03f@reckondigital.com> <878sxd248k.fsf@mail.linkov.net> <82347809b60dfc4e18a822d2d604475c@reckondigital.com> <87mul0wacr.fsf@mail.linkov.net> <336a681ce53ad7623fc5f98936577d82@reckondigital.com> <8736mrcs5j.fsf@gmail.com> <873a32455e7fd2288e3280ecaebc5f00@reckondigital.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > Date: Tue, 09 Apr 2019 13:23:11 +0100 > From: Christopher Thorne > Cc: Noam Postavsky > > > Just a minor suggestion meta suggestion: post your patches by attaching > > the output from 'git format-patch', rather than inlining the output of > > git diff. That will avoid patch corruption due to line-wrapping, like > > in the above quote (although that line is also a bit long, and you > > should break it manually). > > Thanks, Noam. Trying this now. Patch should be attached. One more nit to a well-formatted patch: > * lisp/progmodes/grep.el (grep-read-files): Allow major modes to > define file name to use for default search pattern > * lisp/dired.el (dired-grep-file-name-for-default-pattern): Use file > at point for grep file name pattern Please end each sentence with a period. Also, it is better to have the bug number as part of the detailed descriptions, not as part of the header line (in Subject), because that leaves you more space for the header. Thanks. From unknown Fri Jun 13 11:47:28 2025 X-Loop: help-debbugs@gnu.org Subject: bug#34621: [PATCH] Fix rgrep in dired taking default search file pattern from directory name (e.g. *.11 for django-1.11) Resent-From: Christopher Thorne Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 09 Apr 2019 14:33:01 +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 To: 34621@debbugs.gnu.org Cc: Eli Zaretskii Received: via spool by 34621-submit@debbugs.gnu.org id=B34621.155482035612499 (code B ref 34621); Tue, 09 Apr 2019 14:33:01 +0000 Received: (at 34621) by debbugs.gnu.org; 9 Apr 2019 14:32:36 +0000 Received: from localhost ([127.0.0.1]:51828 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hDrng-0003FX-7j for submit@debbugs.gnu.org; Tue, 09 Apr 2019 10:32:36 -0400 Received: from relay12.mail.gandi.net ([217.70.178.232]:52773) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hDrne-0003FO-0n for 34621@debbugs.gnu.org; Tue, 09 Apr 2019 10:32:35 -0400 Received: from webmail.gandi.net (webmail18.sd4.0x35.net [10.200.201.18]) (Authenticated sender: c.thorne@reckondigital.com) by relay12.mail.gandi.net (Postfix) with ESMTPA id 5419A200018; Tue, 9 Apr 2019 14:32:31 +0000 (UTC) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=_b3f681fcfc2ce6cd2fe67dfaf0ac97f5" Date: Tue, 09 Apr 2019 15:32:31 +0100 From: Christopher Thorne Organization: Reckon Digital In-Reply-To: <83d0lv6z3l.fsf@gnu.org> References: <08e7108149ce2374fd0c9b7fc3e6ae38@reckondigital.com> <40839b67-bce7-4a01-89f1-c14643b18b32@default> <80f4335be923e21fe782780c6812a03f@reckondigital.com> <878sxd248k.fsf@mail.linkov.net> <82347809b60dfc4e18a822d2d604475c@reckondigital.com> <87mul0wacr.fsf@mail.linkov.net> <336a681ce53ad7623fc5f98936577d82@reckondigital.com> <8736mrcs5j.fsf@gmail.com> <873a32455e7fd2288e3280ecaebc5f00@reckondigital.com> <83d0lv6z3l.fsf@gnu.org> Message-ID: X-Sender: c.thorne@reckondigital.com User-Agent: Roundcube Webmail/1.3.8 X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --=_b3f681fcfc2ce6cd2fe67dfaf0ac97f5 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; format=flowed > One more nit to a well-formatted patch: Thanks, Eli. I've updated the commit message as requested. --=_b3f681fcfc2ce6cd2fe67dfaf0ac97f5 Content-Transfer-Encoding: base64 Content-Type: text/x-diff; name=0001-Fix-rgrep-in-dired-using-directory-for-search-file-p.patch Content-Disposition: attachment; filename=0001-Fix-rgrep-in-dired-using-directory-for-search-file-p.patch; size=2318 RnJvbSBmNGM2NDk2ZTY2ZGUxMzQzODkzODUxNTcxOTcwOTUxMWY4MDM2YTk2IE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBDaHJpc3RvcGhlciBUaG9ybmUgPGMudGhvcm5lQHJlY2tvbmRp Z2l0YWwuY29tPgpEYXRlOiBUdWUsIDkgQXByIDIwMTkgMTM6MTI6MzkgKzAxMDAKU3ViamVjdDog W1BBVENIXSBGaXggcmdyZXAgaW4gZGlyZWQgdXNpbmcgZGlyZWN0b3J5IGZvciBzZWFyY2ggZmls ZSBwYXR0ZXJuCgoqIGxpc3AvcHJvZ21vZGVzL2dyZXAuZWwgKGdyZXAtcmVhZC1maWxlcyk6IEFs bG93IG1ham9yIG1vZGVzIHRvCmRlZmluZSBmaWxlIG5hbWUgdG8gdXNlIGZvciBkZWZhdWx0IHNl YXJjaCBwYXR0ZXJuLgoqIGxpc3AvZGlyZWQuZWwgKGRpcmVkLWdyZXAtZmlsZS1uYW1lLWZvci1k ZWZhdWx0LXBhdHRlcm4pOiBVc2UgZmlsZQphdCBwb2ludCBmb3IgZ3JlcCBmaWxlIG5hbWUgcGF0 dGVybi4gIChCdWcjMzQ2MjEpCi0tLQogbGlzcC9kaXJlZC5lbCAgICAgICAgICB8IDExICsrKysr KysrKysrCiBsaXNwL3Byb2dtb2Rlcy9ncmVwLmVsIHwgIDggKysrKysrLS0KIDIgZmlsZXMgY2hh bmdlZCwgMTcgaW5zZXJ0aW9ucygrKSwgMiBkZWxldGlvbnMoLSkKCmRpZmYgLS1naXQgYS9saXNw L2RpcmVkLmVsIGIvbGlzcC9kaXJlZC5lbAppbmRleCBmYzBiNzEyMzhiLi4zM2FiY2E1NTBhIDEw MDY0NAotLS0gYS9saXNwL2RpcmVkLmVsCisrKyBiL2xpc3AvZGlyZWQuZWwKQEAgLTQxNjIsNiAr NDE2MiwxNyBAQCBkaXJlZC1yZXN0b3JlLWRlc2t0b3AtYnVmZmVyCiAoYWRkLXRvLWxpc3QgJ2Rl c2t0b3AtYnVmZmVyLW1vZGUtaGFuZGxlcnMKIAkgICAgICcoZGlyZWQtbW9kZSAuIGRpcmVkLXJl c3RvcmUtZGVza3RvcC1idWZmZXIpKQogCisoZGVmdW4gZGlyZWQtZ3JlcC1maWxlLW5hbWUtZm9y LWRlZmF1bHQtcGF0dGVybiAoKQorICAiVXNlIGZpbGUgYXQgcG9pbnQgYXMgdGhlIGZpbGUgZm9y IGdyZXAncyBkZWZhdWx0IGZpbGUtbmFtZSBwYXR0ZXJuIHN1Z2dlc3Rpb24uCitJZiBhIGRpcmVj dG9yeSBvciBub3RoaW5nIGlzIGZvdW5kIGF0IHBvaW50LCByZXR1cm4gbmlsLiIKKyAgKGxldCAo KGRpcmVkLWZpbGUtbmFtZQorCSAgKHJ1bi1ob29rLXdpdGgtYXJncy11bnRpbC1zdWNjZXNzICdm aWxlLW5hbWUtYXQtcG9pbnQtZnVuY3Rpb25zKSkpCisgICAgKGlmIChhbmQgZGlyZWQtZmlsZS1u YW1lCisJICAgICAobm90IChmaWxlLWRpcmVjdG9yeS1wIGRpcmVkLWZpbGUtbmFtZSkpKQorCWRp cmVkLWZpbGUtbmFtZSkpKQorKHB1dCAnZGlyZWQtbW9kZSAnZ3JlcC1maWxlLW5hbWUtZm9yLWRl ZmF1bHQtcGF0dGVybi1mdW5jdGlvbiAnZGlyZWQtZ3JlcC1maWxlLW5hbWUtZm9yLWRlZmF1bHQt cGF0dGVybikKKworCiAocHJvdmlkZSAnZGlyZWQpCiAKIChydW4taG9va3MgJ2RpcmVkLWxvYWQt aG9vaykJCTsgZm9yIHlvdXIgY3VzdG9taXphdGlvbnMKZGlmZiAtLWdpdCBhL2xpc3AvcHJvZ21v ZGVzL2dyZXAuZWwgYi9saXNwL3Byb2dtb2Rlcy9ncmVwLmVsCmluZGV4IGMwZjQ3MTU5YzkuLmIw YmI4ZTY5MjQgMTAwNjQ0Ci0tLSBhL2xpc3AvcHJvZ21vZGVzL2dyZXAuZWwKKysrIGIvbGlzcC9w cm9nbW9kZXMvZ3JlcC5lbApAQCAtOTU5LDggKzk1OSwxMiBAQCBncmVwLXJlYWQtZmlsZXMKIFRo ZSBwYXR0ZXJuIGNhbiBpbmNsdWRlIHNoZWxsIHdpbGRjYXJkcy4gIEFzIHdoaXRlc3BhY2UgdHJp Z2dlcnMKIGNvbXBsZXRpb24gd2hlbiBlbnRlcmluZyBhIHBhdHRlcm4sIGluY2x1ZGluZyBpdCBy ZXF1aXJlcwogcXVvdGluZywgZS5nLiBgXFxbcXVvdGVkLWluc2VydF08c3BhY2U+Jy4iCi0gIChs ZXQqICgoYm4gKG9yIChidWZmZXItZmlsZS1uYW1lKQotCQkgKHJlcGxhY2UtcmVnZXhwLWluLXN0 cmluZyAiPFswLTldKz5cXCciICIiIChidWZmZXItbmFtZSkpKSkKKyAgKGxldCogKChmaWxlLW5h bWUtZm9yLWRlZmF1bHQtcGF0dGVybi1mdW5jdGlvbgorCSAgIChnZXQgbWFqb3ItbW9kZSAnZ3Jl cC1maWxlLW5hbWUtZm9yLWRlZmF1bHQtcGF0dGVybi1mdW5jdGlvbikpCisJIChibiAoaWYgZmls ZS1uYW1lLWZvci1kZWZhdWx0LXBhdHRlcm4tZnVuY3Rpb24KKwkJIChmdW5jYWxsIGZpbGUtbmFt ZS1mb3ItZGVmYXVsdC1wYXR0ZXJuLWZ1bmN0aW9uKQorCSAgICAgICAob3IgKGJ1ZmZlci1maWxl LW5hbWUpCisJCSAocmVwbGFjZS1yZWdleHAtaW4tc3RyaW5nICI8WzAtOV0rPlxcJyIgIiIgKGJ1 ZmZlci1uYW1lKSkpKSkKIAkgKGZuIChhbmQgYm4KIAkJICAoc3RyaW5ncCBibikKIAkJICAoZmls ZS1uYW1lLW5vbmRpcmVjdG9yeSBibikpKQotLSAKMi4xMS4wCgo= --=_b3f681fcfc2ce6cd2fe67dfaf0ac97f5-- From unknown Fri Jun 13 11:47:28 2025 X-Loop: help-debbugs@gnu.org Subject: bug#34621: [PATCH] Fix rgrep in dired taking default search file pattern from directory name (e.g. *.11 for django-1.11) Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 09 Apr 2019 21:00: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 To: Christopher Thorne Cc: 34621@debbugs.gnu.org Received: via spool by 34621-submit@debbugs.gnu.org id=B34621.155484356126559 (code B ref 34621); Tue, 09 Apr 2019 21:00:02 +0000 Received: (at 34621) by debbugs.gnu.org; 9 Apr 2019 20:59:21 +0000 Received: from localhost ([127.0.0.1]:52059 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hDxpx-0006uI-Bn for submit@debbugs.gnu.org; Tue, 09 Apr 2019 16:59:21 -0400 Received: from palegreen.birch.relay.mailchannels.net ([23.83.209.140]:44885) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hDxpu-0006u8-5j for 34621@debbugs.gnu.org; Tue, 09 Apr 2019 16:59:19 -0400 X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id A06BE12598E; Tue, 9 Apr 2019 20:59:16 +0000 (UTC) Received: from pdx1-sub0-mail-a36.g.dreamhost.com (unknown [100.96.20.50]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 47C371258B0; Tue, 9 Apr 2019 20:59:16 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Received: from pdx1-sub0-mail-a36.g.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.17.2); Tue, 09 Apr 2019 20:59:16 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-Scare-Illustrious: 023670406d854db5_1554843556435_2318013207 X-MC-Loop-Signature: 1554843556435:1261677313 X-MC-Ingress-Time: 1554843556435 Received: from pdx1-sub0-mail-a36.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a36.g.dreamhost.com (Postfix) with ESMTP id C1D1580592; Tue, 9 Apr 2019 13:59:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=linkov.net; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=linkov.net; bh=GkOfsIin95s1nOxFlvJ43wNH2DE=; b= 3jiaX9UZOVYQsy1bJAOtZ+1zBgGtC089fom5nzHrSzWMao3R8F6C5cK7zzogrBBl bQmqY5aQItrTLGntt5NcnRSAoBGtxk0A1zT03YiPhcFXGB1GXKKNrnZyOoTf7ilr Jo8Ne9v6jsdikZ4LHYjA++GCc+LStEtDCVD5CrBJvrA= Received: from mail.jurta.org (m91-129-97-48.cust.tele2.ee [91.129.97.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by pdx1-sub0-mail-a36.g.dreamhost.com (Postfix) with ESMTPSA id 27D348058B; Tue, 9 Apr 2019 13:59:12 -0700 (PDT) X-DH-BACKEND: pdx1-sub0-mail-a36 From: Juri Linkov Organization: LINKOV.NET References: <08e7108149ce2374fd0c9b7fc3e6ae38@reckondigital.com> <40839b67-bce7-4a01-89f1-c14643b18b32@default> <80f4335be923e21fe782780c6812a03f@reckondigital.com> <878sxd248k.fsf@mail.linkov.net> <82347809b60dfc4e18a822d2d604475c@reckondigital.com> <87mul0wacr.fsf@mail.linkov.net> <336a681ce53ad7623fc5f98936577d82@reckondigital.com> Date: Tue, 09 Apr 2019 23:32:01 +0300 In-Reply-To: <336a681ce53ad7623fc5f98936577d82@reckondigital.com> (Christopher Thorne's message of "Tue, 09 Apr 2019 12:09:27 +0100") Message-ID: <8736mq6gwe.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: -100 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgeduuddrudehgdduheeiucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuggftfghnshhusghstghrihgsvgdpffftgfetoffjqffuvfenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvufhofhffjgfkfgggtgesthdtredttdertdenucfhrhhomheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqeenucfkphepledurdduvdelrdeljedrgeeknecurfgrrhgrmhepmhhouggvpehsmhhtphdphhgvlhhopehmrghilhdrjhhurhhtrgdrohhrghdpihhnvghtpeeluddruddvledrleejrdegkedprhgvthhurhhnqdhprghthheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqedpmhgrihhlfhhrohhmpehjuhhriheslhhinhhkohhvrdhnvghtpdhnrhgtphhtthhopegtrdhthhhorhhnvgesrhgvtghkohhnughighhithgrlhdrtghomhenucevlhhushhtvghrufhiiigvpedu X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > However, it doesn't cover the case where emacs is in a dired buffer called > django-1.11 with nothing at point. In this case, *.11 will be suggested > because buffer-name is used. I'm not sure how to fix this in grep.el > without an "if is dired" check. When I tried the change that I suggested to use, I forgot that I have this customization: (add-hook 'dired-after-readin-hook (lambda () ;; Set name of dired buffers to absolute directory names. (when (stringp dired-directory) (rename-buffer (generate-new-buffer-name dired-directory))))) that renames dired buffers to e.g. "django-1.11/", and due to the trailing slash, grep-read-files doesn't use it's buffer name. But since by default there is no trailing slash in dired buffer names, this is unsuitable. So I agree with your approach to allow modes to override using buffer names as candidates. > diff --git a/lisp/dired.el b/lisp/dired.el > index fc0b71238b..33abca550a 100644 > --- a/lisp/dired.el > +++ b/lisp/dired.el > @@ -4162,6 +4162,17 @@ dired-restore-desktop-buffer > (add-to-list 'desktop-buffer-mode-handlers > '(dired-mode . dired-restore-desktop-buffer)) > > +(defun dired-grep-file-name-for-default-pattern () > + "Use file at point as the file for grep's default file-name pattern suggestion. > +If a directory or nothing is found at point, return nil." > + (let ((dired-file-name > + (run-hook-with-args-until-success 'file-name-at-point-functions))) > + (if (and dired-file-name > + (not (file-directory-p dired-file-name))) > + dired-file-name))) > +(put 'dired-mode 'grep-file-name-for-default-pattern-function 'dired-grep-file-name-for-default-pattern) This is an overwhelmingly long name, please use the same name as the function that uses this feature, i.e. just 'grep-read-files'. Then when someone reading dired.el will find a line (put 'dired-mode 'grep-read-files 'dired-grep-read-files) it will be clear for them the purpose of this feature. Please place this change in dired.el after the definition of 'dired-file-name-at-point' that you can use in your dired function instead of (run-hook-with-args-until-success 'file-name-at-point-functions) > diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el > index c0f47159c9..b0bb8e6924 100644 > --- a/lisp/progmodes/grep.el > +++ b/lisp/progmodes/grep.el > @@ -959,8 +959,12 @@ grep-read-files > The pattern can include shell wildcards. As whitespace triggers > completion when entering a pattern, including it requires > quoting, e.g. `\\[quoted-insert]'." > - (let* ((bn (or (buffer-file-name) > - (replace-regexp-in-string "<[0-9]+>\\'" "" (buffer-name)))) > + (let* ((file-name-for-default-pattern-function > + (get major-mode 'grep-file-name-for-default-pattern-function)) > + (bn (if file-name-for-default-pattern-function > + (funcall file-name-for-default-pattern-function) > + (or (buffer-file-name) > + (replace-regexp-in-string "<[0-9]+>\\'" "" (buffer-name))))) If you want you could also add as a 4th option additionally (run-hook-with-args-until-success 'file-name-at-point-functions) to automatically support modes other than dired, i.e. other modes that set file-name-at-point-functions. From unknown Fri Jun 13 11:47:28 2025 X-Loop: help-debbugs@gnu.org Subject: bug#34621: [PATCH] Fix rgrep in dired taking default search file pattern from directory name (e.g. *.11 for django-1.11) Resent-From: Christopher Thorne Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 10 Apr 2019 10:43: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 To: 34621@debbugs.gnu.org Cc: Juri Linkov Received: via spool by 34621-submit@debbugs.gnu.org id=B34621.155489297524900 (code B ref 34621); Wed, 10 Apr 2019 10:43:02 +0000 Received: (at 34621) by debbugs.gnu.org; 10 Apr 2019 10:42:55 +0000 Received: from localhost ([127.0.0.1]:52404 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hEAgw-0006TY-Vt for submit@debbugs.gnu.org; Wed, 10 Apr 2019 06:42:55 -0400 Received: from relay6-d.mail.gandi.net ([217.70.183.198]:39441) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hEAgu-0006TP-RT for 34621@debbugs.gnu.org; Wed, 10 Apr 2019 06:42:53 -0400 Received: from webmail.gandi.net (webmail18.sd4.0x35.net [10.200.201.18]) (Authenticated sender: c.thorne@reckondigital.com) by relay6-d.mail.gandi.net (Postfix) with ESMTPA id 92E32C0004; Wed, 10 Apr 2019 10:42:50 +0000 (UTC) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=_0471af0addbfa507e55e1e5ded930763" Date: Wed, 10 Apr 2019 11:42:50 +0100 From: Christopher Thorne Organization: Reckon Digital In-Reply-To: <8736mq6gwe.fsf@mail.linkov.net> References: <08e7108149ce2374fd0c9b7fc3e6ae38@reckondigital.com> <40839b67-bce7-4a01-89f1-c14643b18b32@default> <80f4335be923e21fe782780c6812a03f@reckondigital.com> <878sxd248k.fsf@mail.linkov.net> <82347809b60dfc4e18a822d2d604475c@reckondigital.com> <87mul0wacr.fsf@mail.linkov.net> <336a681ce53ad7623fc5f98936577d82@reckondigital.com> <8736mq6gwe.fsf@mail.linkov.net> Message-ID: X-Sender: c.thorne@reckondigital.com User-Agent: Roundcube Webmail/1.3.8 X-Spam-Score: -1.0 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.0 (--) --=_0471af0addbfa507e55e1e5ded930763 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; format=flowed > This is an overwhelmingly long name, please use the same name as > the function that uses this feature, i.e. just 'grep-read-files'. > Then when someone reading dired.el will find a line > > (put 'dired-mode 'grep-read-files 'dired-grep-read-files) > > it will be clear for them the purpose of this feature. Good point, I've changed it to grep-read-files. > Please place this change in dired.el after the definition of > 'dired-file-name-at-point' that you can use in your dired function > instead of (run-hook-with-args-until-success > 'file-name-at-point-functions) Thanks, also done this. > If you want you could also add as a 4th option additionally > (run-hook-with-args-until-success 'file-name-at-point-functions) > to automatically support modes other than dired, i.e. other modes > that set file-name-at-point-functions. Sounds like a sensible default, added this as well. Patch attached. --=_0471af0addbfa507e55e1e5ded930763 Content-Transfer-Encoding: base64 Content-Type: text/x-diff; name=0001-Fix-rgrep-in-dired-using-directory-for-search-file-p.patch Content-Disposition: attachment; filename=0001-Fix-rgrep-in-dired-using-directory-for-search-file-p.patch; size=2470 RnJvbSBiYmY1ODRlMGM1ZjgzNmM1NTU3OWI5ODA0ZTA5MWM3MzZiY2Y3YTIzIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBDaHJpc3RvcGhlciBUaG9ybmUgPGMudGhvcm5lQHJlY2tvbmRp Z2l0YWwuY29tPgpEYXRlOiBUdWUsIDkgQXByIDIwMTkgMTM6MTI6MzkgKzAxMDAKU3ViamVjdDog W1BBVENIXSBGaXggcmdyZXAgaW4gZGlyZWQgdXNpbmcgZGlyZWN0b3J5IGZvciBzZWFyY2ggZmls ZSBwYXR0ZXJuCgoqIGxpc3AvcHJvZ21vZGVzL2dyZXAuZWwgKGdyZXAtcmVhZC1maWxlcyk6IEFs bG93IG1ham9yIG1vZGVzIHRvCmRlZmluZSBmaWxlIG5hbWUgdG8gdXNlIGZvciBkZWZhdWx0IHNl YXJjaCBwYXR0ZXJuLgoqIGxpc3AvcHJvZ21vZGVzL2dyZXAuZWwgKGdyZXAtcmVhZC1maWxlcyk6 IEFkZCBub24tZGlyZWN0b3J5IGZpbGUgYXQKcG9pbnQgYXMgZGVmYXVsdCBzZWFyY2ggcGF0dGVy biBjYW5kaWRhdGUuCiogbGlzcC9kaXJlZC5lbCAoZGlyZWQtZ3JlcC1yZWFkLWZpbGVzKTogVXNl IG5vbi1kaXJlY3RvcnkgZmlsZSBhdApwb2ludCBmb3IgZ3JlcCBmaWxlIG5hbWUgcGF0dGVybi4g IChCdWcjMzQ2MjEpCi0tLQogbGlzcC9kaXJlZC5lbCAgICAgICAgICB8ICA5ICsrKysrKysrKwog bGlzcC9wcm9nbW9kZXMvZ3JlcC5lbCB8IDEyICsrKysrKysrKystLQogMiBmaWxlcyBjaGFuZ2Vk LCAxOSBpbnNlcnRpb25zKCspLCAyIGRlbGV0aW9ucygtKQoKZGlmZiAtLWdpdCBhL2xpc3AvZGly ZWQuZWwgYi9saXNwL2RpcmVkLmVsCmluZGV4IGZjMGI3MTIzOGIuLjYzZDI4ODM1YWEgMTAwNjQ0 Ci0tLSBhL2xpc3AvZGlyZWQuZWwKKysrIGIvbGlzcC9kaXJlZC5lbApAQCAtNzc0LDYgKzc3NCwx NSBAQCBkaXJlZC1maWxlLW5hbWUtYXQtcG9pbnQKIAkgIChmaWxlLW5hbWUtYXMtZGlyZWN0b3J5 IChhYmJyZXZpYXRlLWZpbGUtbmFtZSBmaWxlbmFtZSkpCiAJKGFiYnJldmlhdGUtZmlsZS1uYW1l IGZpbGVuYW1lKSkpKSkKIAorKGRlZnVuIGRpcmVkLWdyZXAtcmVhZC1maWxlcyAoKQorICAiVXNl IGZpbGUgYXQgcG9pbnQgYXMgdGhlIGZpbGUgZm9yIGdyZXAncyBkZWZhdWx0IGZpbGUtbmFtZSBw YXR0ZXJuIHN1Z2dlc3Rpb24uCitJZiBhIGRpcmVjdG9yeSBvciBub3RoaW5nIGlzIGZvdW5kIGF0 IHBvaW50LCByZXR1cm4gbmlsLiIKKyAgKGxldCAoKGZpbGUtbmFtZSAoZGlyZWQtZmlsZS1uYW1l LWF0LXBvaW50KSkpCisgICAgKGlmIChhbmQgZmlsZS1uYW1lCisJICAgICAobm90IChmaWxlLWRp cmVjdG9yeS1wIGZpbGUtbmFtZSkpKQorCWZpbGUtbmFtZSkpKQorKHB1dCAnZGlyZWQtbW9kZSAn Z3JlcC1yZWFkLWZpbGVzICdkaXJlZC1ncmVwLXJlYWQtZmlsZXMpCisKIDs7OyMjI2F1dG9sb2Fk IChkZWZpbmUta2V5IGN0bC14LW1hcCAiZCIgJ2RpcmVkKQogOzs7IyMjYXV0b2xvYWQKIChkZWZ1 biBkaXJlZCAoZGlybmFtZSAmb3B0aW9uYWwgc3dpdGNoZXMpCmRpZmYgLS1naXQgYS9saXNwL3By b2dtb2Rlcy9ncmVwLmVsIGIvbGlzcC9wcm9nbW9kZXMvZ3JlcC5lbAppbmRleCBjMGY0NzE1OWM5 Li44YzdhNThmZDhiIDEwMDY0NAotLS0gYS9saXNwL3Byb2dtb2Rlcy9ncmVwLmVsCisrKyBiL2xp c3AvcHJvZ21vZGVzL2dyZXAuZWwKQEAgLTk1OSw4ICs5NTksMTYgQEAgZ3JlcC1yZWFkLWZpbGVz CiBUaGUgcGF0dGVybiBjYW4gaW5jbHVkZSBzaGVsbCB3aWxkY2FyZHMuICBBcyB3aGl0ZXNwYWNl IHRyaWdnZXJzCiBjb21wbGV0aW9uIHdoZW4gZW50ZXJpbmcgYSBwYXR0ZXJuLCBpbmNsdWRpbmcg aXQgcmVxdWlyZXMKIHF1b3RpbmcsIGUuZy4gYFxcW3F1b3RlZC1pbnNlcnRdPHNwYWNlPicuIgot ICAobGV0KiAoKGJuIChvciAoYnVmZmVyLWZpbGUtbmFtZSkKLQkJIChyZXBsYWNlLXJlZ2V4cC1p bi1zdHJpbmcgIjxbMC05XSs+XFwnIiAiIiAoYnVmZmVyLW5hbWUpKSkpCisgIChsZXQqICgoZ3Jl cC1yZWFkLWZpbGVzLWZ1bmN0aW9uIChnZXQgbWFqb3ItbW9kZSAnZ3JlcC1yZWFkLWZpbGVzKSkK KwkgKGZpbGUtbmFtZS1hdC1wb2ludAorCSAgIChydW4taG9vay13aXRoLWFyZ3MtdW50aWwtc3Vj Y2VzcyAnZmlsZS1uYW1lLWF0LXBvaW50LWZ1bmN0aW9ucykpCisJIChibiAoaWYgZ3JlcC1yZWFk LWZpbGVzLWZ1bmN0aW9uCisJCSAoZnVuY2FsbCBncmVwLXJlYWQtZmlsZXMtZnVuY3Rpb24pCisJ ICAgICAgIChvciAoaWYgKGFuZCAoc3RyaW5ncCBmaWxlLW5hbWUtYXQtcG9pbnQpCisJCQkgICAg KG5vdCAoZmlsZS1kaXJlY3RvcnktcCBmaWxlLW5hbWUtYXQtcG9pbnQpKSkKKwkJICAgICAgIGZp bGUtbmFtZS1hdC1wb2ludCkKKwkJICAgKGJ1ZmZlci1maWxlLW5hbWUpCisJCSAgIChyZXBsYWNl LXJlZ2V4cC1pbi1zdHJpbmcgIjxbMC05XSs+XFwnIiAiIiAoYnVmZmVyLW5hbWUpKSkpKQogCSAo Zm4gKGFuZCBibgogCQkgIChzdHJpbmdwIGJuKQogCQkgIChmaWxlLW5hbWUtbm9uZGlyZWN0b3J5 IGJuKSkpCi0tIAoyLjExLjAKCg== --=_0471af0addbfa507e55e1e5ded930763-- From unknown Fri Jun 13 11:47:28 2025 X-Loop: help-debbugs@gnu.org Subject: bug#34621: [PATCH] Fix rgrep in dired taking default search file pattern from directory name (e.g. *.11 for django-1.11) Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 10 Apr 2019 20:52: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 To: Christopher Thorne Cc: 34621@debbugs.gnu.org Received: via spool by 34621-submit@debbugs.gnu.org id=B34621.155492947210354 (code B ref 34621); Wed, 10 Apr 2019 20:52:02 +0000 Received: (at 34621) by debbugs.gnu.org; 10 Apr 2019 20:51:12 +0000 Received: from localhost ([127.0.0.1]:53590 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hEKBb-0002gw-De for submit@debbugs.gnu.org; Wed, 10 Apr 2019 16:51:11 -0400 Received: from goldenrod.birch.relay.mailchannels.net ([23.83.209.74]:31781) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hEKBY-0002gj-T2 for 34621@debbugs.gnu.org; Wed, 10 Apr 2019 16:51:10 -0400 X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 0B1923E57CA; Wed, 10 Apr 2019 20:51:07 +0000 (UTC) Received: from pdx1-sub0-mail-a60.g.dreamhost.com (unknown [100.96.28.55]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 8144C3E4EC5; Wed, 10 Apr 2019 20:51:06 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Received: from pdx1-sub0-mail-a60.g.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.17.2); Wed, 10 Apr 2019 20:51:06 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-Obese-Bored: 68d4eae35c6ecee8_1554929466795_3981216789 X-MC-Loop-Signature: 1554929466794:2590715509 X-MC-Ingress-Time: 1554929466794 Received: from pdx1-sub0-mail-a60.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a60.g.dreamhost.com (Postfix) with ESMTP id 0620381943; Wed, 10 Apr 2019 13:51:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=linkov.net; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=linkov.net; bh=Yp1veE5RM+0Ub6//iq/nh+wImyk=; b= MUnHh+QATZo8/h0AdPlVnmMPM3tfinp6Ds+Vng6Yib691whbtFGs+hJcbF75Z8+s 3lTGFKDfTy7LxNUdTBt1VOptKlESIZMnB/lf81Ahr39yIJf+VDmLo7XI656M4nz1 OcZYBMEoAbJJEwsWL6Ga6U0+B7oRdYtjakwBkDT+7Dc= Received: from mail.jurta.org (m91-129-109-191.cust.tele2.ee [91.129.109.191]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by pdx1-sub0-mail-a60.g.dreamhost.com (Postfix) with ESMTPSA id 0735F81902; Wed, 10 Apr 2019 13:51:02 -0700 (PDT) X-DH-BACKEND: pdx1-sub0-mail-a60 From: Juri Linkov Organization: LINKOV.NET References: <08e7108149ce2374fd0c9b7fc3e6ae38@reckondigital.com> <40839b67-bce7-4a01-89f1-c14643b18b32@default> <80f4335be923e21fe782780c6812a03f@reckondigital.com> <878sxd248k.fsf@mail.linkov.net> <82347809b60dfc4e18a822d2d604475c@reckondigital.com> <87mul0wacr.fsf@mail.linkov.net> <336a681ce53ad7623fc5f98936577d82@reckondigital.com> <8736mq6gwe.fsf@mail.linkov.net> Date: Wed, 10 Apr 2019 23:37:13 +0300 In-Reply-To: (Christopher Thorne's message of "Wed, 10 Apr 2019 11:42:50 +0100") Message-ID: <87v9zlfvxa.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: -100 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgeduuddrudejgdduheeiucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuggftfghnshhusghstghrihgsvgdpffftgfetoffjqffuvfenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvufhofhffjgfkfgggtgesthdtredttdertdenucfhrhhomheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqeenucfkphepledurdduvdelrddutdelrdduledunecurfgrrhgrmhepmhhouggvpehsmhhtphdphhgvlhhopehmrghilhdrjhhurhhtrgdrohhrghdpihhnvghtpeeluddruddvledruddtledrudeluddprhgvthhurhhnqdhprghthheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqedpmhgrihhlfhhrohhmpehjuhhriheslhhinhhkohhvrdhnvghtpdhnrhgtphhtthhopegtrdhthhhorhhnvgesrhgvtghkohhnughighhithgrlhdrtghomhenucevlhhushhtvghrufhiiigvpedt X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > Patch attached. > > From bbf584e0c5f836c55579b9804e091c736bcf7a23 Mon Sep 17 00:00:00 2001 > From: Christopher Thorne > Date: Tue, 9 Apr 2019 13:12:39 +0100 > Subject: [PATCH] Fix rgrep in dired using directory for search file pattern > > * lisp/progmodes/grep.el (grep-read-files): Allow major modes to > define file name to use for default search pattern. > * lisp/progmodes/grep.el (grep-read-files): Add non-directory file at > point as default search pattern candidate. > * lisp/dired.el (dired-grep-read-files): Use non-directory file at > point for grep file name pattern. (Bug#34621) Thanks, I tested your patch, and it works without problems. From unknown Fri Jun 13 11:47:28 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Christopher Thorne Subject: bug#34621: closed (Re: bug#34621: [PATCH] Fix rgrep in dired taking default search file pattern from directory name (e.g. *.11 for django-1.11)) Message-ID: References: <87r2a82rkt.fsf@mail.linkov.net> <08e7108149ce2374fd0c9b7fc3e6ae38@reckondigital.com> X-Gnu-PR-Message: they-closed 34621 X-Gnu-PR-Package: emacs X-Gnu-PR-Keywords: patch Reply-To: 34621@debbugs.gnu.org Date: Thu, 11 Apr 2019 20:53:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1555015982-3193-1" This is a multi-part message in MIME format... ------------=_1555015982-3193-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #34621: [PATCH] lisp/progmodes/grep.el (grep-read-files): Add file-director= y-p check which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 34621@debbugs.gnu.org. --=20 34621: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D34621 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1555015982-3193-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 34621-done) by debbugs.gnu.org; 11 Apr 2019 20:52:25 +0000 Received: from localhost ([127.0.0.1]:55212 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hEggK-0000ob-Mj for submit@debbugs.gnu.org; Thu, 11 Apr 2019 16:52:24 -0400 Received: from otter.birch.relay.mailchannels.net ([23.83.209.139]:61873) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hEggI-0000oQ-25 for 34621-done@debbugs.gnu.org; Thu, 11 Apr 2019 16:52:22 -0400 X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id D2C265C4B9C; Thu, 11 Apr 2019 20:52:19 +0000 (UTC) Received: from pdx1-sub0-mail-a66.g.dreamhost.com (unknown [100.96.28.55]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 7DB635C5642; Thu, 11 Apr 2019 20:52:19 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Received: from pdx1-sub0-mail-a66.g.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.17.2); Thu, 11 Apr 2019 20:52:19 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-Minister-Glossy: 7c52df06104a826a_1555015939673_2050697040 X-MC-Loop-Signature: 1555015939673:699567968 X-MC-Ingress-Time: 1555015939672 Received: from pdx1-sub0-mail-a66.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a66.g.dreamhost.com (Postfix) with ESMTP id E51008071D; Thu, 11 Apr 2019 13:52:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=linkov.net; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=linkov.net; bh=LX1xX3TVvkZsBXiiFEldLKmss2s=; b= mPIbXvmHitCJvpMElOeiDlOabfZUs7L8CrRciTPo8Uw3pKxxlosNoiOMWG5ve1oC xCSrJPBoD/17nG0Nvw2namTyPGrlvSByC7sxfheMIsVR4eUoy/vtvOzbQH7nN9/b oEix09p8noghjfGiCpWtXkhXQHFxvYcxghTjYpvwVdY= Received: from mail.jurta.org (m91-129-111-111.cust.tele2.ee [91.129.111.111]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by pdx1-sub0-mail-a66.g.dreamhost.com (Postfix) with ESMTPSA id 44FA08072C; Thu, 11 Apr 2019 13:52:15 -0700 (PDT) X-DH-BACKEND: pdx1-sub0-mail-a66 From: Juri Linkov To: Christopher Thorne Subject: Re: bug#34621: [PATCH] Fix rgrep in dired taking default search file pattern from directory name (e.g. *.11 for django-1.11) Organization: LINKOV.NET References: <08e7108149ce2374fd0c9b7fc3e6ae38@reckondigital.com> <40839b67-bce7-4a01-89f1-c14643b18b32@default> <80f4335be923e21fe782780c6812a03f@reckondigital.com> <878sxd248k.fsf@mail.linkov.net> <82347809b60dfc4e18a822d2d604475c@reckondigital.com> <87mul0wacr.fsf@mail.linkov.net> <336a681ce53ad7623fc5f98936577d82@reckondigital.com> <8736mq6gwe.fsf@mail.linkov.net> <87v9zlfvxa.fsf@mail.linkov.net> Date: Thu, 11 Apr 2019 23:51:46 +0300 In-Reply-To: <87v9zlfvxa.fsf@mail.linkov.net> (Juri Linkov's message of "Wed, 10 Apr 2019 23:37:13 +0300") Message-ID: <87r2a82rkt.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: -100 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgeduuddrudelgdduheehucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuggftfghnshhusghstghrihgsvgdpffftgfetoffjqffuvfenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvufhofhffjgfkfgggtgesthdtredttdertdenucfhrhhomheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqeenucfkphepledurdduvdelrdduuddurdduuddunecurfgrrhgrmhepmhhouggvpehsmhhtphdphhgvlhhopehmrghilhdrjhhurhhtrgdrohhrghdpihhnvghtpeeluddruddvledrudduuddrudduuddprhgvthhurhhnqdhprghthheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqedpmhgrihhlfhhrohhmpehjuhhriheslhhinhhkohhvrdhnvghtpdhnrhgtphhtthhopegtrdhthhhorhhnvgesrhgvtghkohhnughighhithgrlhdrtghomhenucevlhhushhtvghrufhiiigvpedu X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 34621-done Cc: 34621-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > Patch attached. Your patch is pushed to master, thanks. ------------=_1555015982-3193-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 22 Feb 2019 21:15:10 +0000 Received: from localhost ([127.0.0.1]:48602 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gxIA1-0007Bm-VH for submit@debbugs.gnu.org; Fri, 22 Feb 2019 16:15:10 -0500 Received: from eggs.gnu.org ([209.51.188.92]:58553) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gxEdb-0001qb-Ph for submit@debbugs.gnu.org; Fri, 22 Feb 2019 12:29:28 -0500 Received: from lists.gnu.org ([209.51.188.17]:33799) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gxEdU-0004eT-AW for submit@debbugs.gnu.org; Fri, 22 Feb 2019 12:29:20 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44681) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gxEdT-0004PJ-C6 for bug-gnu-emacs@gnu.org; Fri, 22 Feb 2019 12:29:20 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.1 required=5.0 tests=BAYES_50,RCVD_IN_DNSWL_LOW autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gxEdR-0004aE-Mt for bug-gnu-emacs@gnu.org; Fri, 22 Feb 2019 12:29:18 -0500 Received: from relay4-d.mail.gandi.net ([217.70.183.196]:50385) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gxEdR-0004RI-F6 for bug-gnu-emacs@gnu.org; Fri, 22 Feb 2019 12:29:17 -0500 Received: from webmail.gandi.net (webmail8.sd4.0x35.net [10.200.201.8]) (Authenticated sender: c.thorne@reckondigital.com) by relay4-d.mail.gandi.net (Postfix) with ESMTPA id 988A5E0011 for ; Fri, 22 Feb 2019 17:29:10 +0000 (UTC) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Fri, 22 Feb 2019 17:29:10 +0000 From: Christopher Thorne To: bug-gnu-emacs@gnu.org Subject: [PATCH] lisp/progmodes/grep.el (grep-read-files): Add file-directory-p check Organization: Reckon Digital Message-ID: <08e7108149ce2374fd0c9b7fc3e6ae38@reckondigital.com> X-Sender: c.thorne@reckondigital.com User-Agent: Roundcube Webmail/1.1.2 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 217.70.183.196 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Spam-Score: 0.7 (/) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Fri, 22 Feb 2019 16:15:09 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.3 (/) Hello, This patch fixes a bug in the rgrep command which causes certain directory names to be mistaken for files with extensions. For example, when running rgrep in a directory called "django-1.11", rgrep will prompt with 'Search for "x" in files (default *.11):', under the assumption that .11 is a file extension. Similarly, creating a directory called "test.c" and running rgrep inside it results in the prompt 'Search for "x" in files (default *.[ch])'. With this patch, the default file extension for directories is either taken from the rgrep history or set to "all". Changelog entry: * lisp/progmodes/grep.el (grep-read-files): Add file-directory-p check Patch: diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el index 3fd2a7e701..fe0fb5b30c 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 (file-directory-p (concat "../" fn))) (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 (file-directory-p (concat "../" fn))) (let ((ext (file-name-extension fn))) (and ext (concat "*." ext))))) (default Regards, Christopher Thorne ------------=_1555015982-3193-1--