From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#31796: 27.1; dired-do-find-regexp-and-replace fails to find multiline regexps Date: Mon, 30 Nov 2020 10:49:58 +0200 Organization: LINKOV.NET Message-ID: <87blffns95.fsf@mail.linkov.net> References: <10120030-8b8d-b702-add4-8f099f934ed5@chalmers.se> <831rgivl7l.fsf@gnu.org> <83lfequ30g.fsf@gnu.org> <83a6v6tss9.fsf@gnu.org> <08c0bbce-051e-7a49-106a-d6d0629b2224@yandex.ru> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="19183"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) Cc: abela@chalmers.se, 31796@debbugs.gnu.org To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Nov 30 09:56:12 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kjeyh-0004rs-Qv for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 30 Nov 2020 09:56:11 +0100 Original-Received: from localhost ([::1]:60080 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kjeyg-0001Gm-AQ for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 30 Nov 2020 03:56:10 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:32944) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kjeyY-0001Gb-5G for bug-gnu-emacs@gnu.org; Mon, 30 Nov 2020 03:56:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:41860) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kjeyX-0006Vd-UW for bug-gnu-emacs@gnu.org; Mon, 30 Nov 2020 03:56:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kjeyX-0005Qg-TR for bug-gnu-emacs@gnu.org; Mon, 30 Nov 2020 03:56:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 30 Nov 2020 08:56:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 31796 X-GNU-PR-Package: emacs Original-Received: via spool by 31796-submit@debbugs.gnu.org id=B31796.160672652220807 (code B ref 31796); Mon, 30 Nov 2020 08:56:01 +0000 Original-Received: (at 31796) by debbugs.gnu.org; 30 Nov 2020 08:55:22 +0000 Original-Received: from localhost ([127.0.0.1]:53406 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kjexu-0005PX-9m for submit@debbugs.gnu.org; Mon, 30 Nov 2020 03:55:22 -0500 Original-Received: from relay2-d.mail.gandi.net ([217.70.183.194]:56219) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kjexs-0005PE-T4 for 31796@debbugs.gnu.org; Mon, 30 Nov 2020 03:55:21 -0500 X-Originating-IP: 91.129.99.98 Original-Received: from mail.gandi.net (m91-129-99-98.cust.tele2.ee [91.129.99.98]) (Authenticated sender: juri@linkov.net) by relay2-d.mail.gandi.net (Postfix) with ESMTPSA id 86BA24000D; Mon, 30 Nov 2020 08:55:13 +0000 (UTC) In-Reply-To: <08c0bbce-051e-7a49-106a-d6d0629b2224@yandex.ru> (Dmitry Gutov's message of "Mon, 30 Nov 2020 04:25:31 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:194589 Archived-At: > Now that I've dug in a little, the situation seems difficult. > > -Pz does work, but it forces Grep to consider the file as one long > string. As a consequence, if we ask it to output the line number, the > number will always be 1. That's not a helpful mode of operation. > > Even if it worked differently, -P imposes a significant performance penalty > from what I see, even when the extra syntax is not actually used. So we > couldn't enable it by default. When a grep input pattern contains a newline, then xref could use the same algorithm as is used for 'M-.', i.e. run 'grep -Pzl' to get the file names that contain the pattern, then return these file names without line numbers. This works exactly like a new feature of extending xref-show-xrefs-function with a new completion function was proposed recently on emacs-devel (BTW, why it's not installed yet?) So like this feature presenting such completions without line numbers: lisp/progmodes/project.el:(cl-defgeneric project-root) lisp/progmodes/project.el:(cl-defmethod project-root ((project (head transient)))) lisp/progmodes/project.el:(cl-defmethod project-root ((project (head vc)))) xref for grep could work the same way without line numbers: lisp/progmodes/project.el:names"^Jproject--read-file-cpd-relative) lisp/progmodes/project.el:names"^Jproject--read-file-absolute) Then visiting such grep hit should use Emacs search functions to find the grep hit in the visited file.