From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#34621: [PATCH] Fix rgrep in dired taking default search file pattern from directory name (e.g. *.11 for django-1.11) Date: Mon, 08 Apr 2019 22:44:20 +0300 Organization: LINKOV.NET Message-ID: <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> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="266803"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) Cc: 34621@debbugs.gnu.org To: Christopher Thorne Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Apr 08 22:29:28 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hDatT-0017DE-J9 for geb-bug-gnu-emacs@m.gmane.org; Mon, 08 Apr 2019 22:29:27 +0200 Original-Received: from localhost ([127.0.0.1]:58537 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hDatN-0006Ki-5t for geb-bug-gnu-emacs@m.gmane.org; Mon, 08 Apr 2019 16:29:21 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:59226) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hDat9-0006If-T1 for bug-gnu-emacs@gnu.org; Mon, 08 Apr 2019 16:29:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hDat7-0007Uw-Tl for bug-gnu-emacs@gnu.org; Mon, 08 Apr 2019 16:29:07 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:36674) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hDat5-0007To-Vo for bug-gnu-emacs@gnu.org; Mon, 08 Apr 2019 16:29:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hDat5-00058h-Qu for bug-gnu-emacs@gnu.org; Mon, 08 Apr 2019 16:29:03 -0400 X-Loop: help-debbugs@gnu.org 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 Original-Received: via spool by 34621-submit@debbugs.gnu.org id=B34621.155475531419663 (code B ref 34621); Mon, 08 Apr 2019 20:29:03 +0000 Original-Received: (at 34621) by debbugs.gnu.org; 8 Apr 2019 20:28:34 +0000 Original-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 Original-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 Original-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) Original-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 Original-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 Original-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= Original-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 In-Reply-To: <82347809b60dfc4e18a822d2d604475c@reckondigital.com> (Christopher Thorne's message of "Mon, 08 Apr 2019 11:41:20 +0100") X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: -100 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgeduuddrudefgdduhedvucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuggftfghnshhusghstghrihgsvgdpffftgfetoffjqffuvfenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvufhofhffjgfkfgggtgesthdtredttdertdenucfhrhhomheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqeenucfkphepledurdduvdelrdelledrvddtvdenucfrrghrrghmpehmohguvgepshhmthhppdhhvghlohepmhgrihhlrdhjuhhrthgrrdhorhhgpdhinhgvthepledurdduvdelrdelledrvddtvddprhgvthhurhhnqdhprghthheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqedpmhgrihhlfhhrohhmpehjuhhriheslhhinhhkohhvrdhnvghtpdhnrhgtphhtthhopegtrdhthhhorhhnvgesrhgvtghkohhnughighhithgrlhdrtghomhenucevlhhushhtvghrufhiiigvpedv X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:157360 Archived-At: > 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.