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: Wed, 25 Nov 2020 09:31:23 +0200 Organization: LINKOV.NET Message-ID: <87im9unh9o.fsf@mail.linkov.net> References: <10120030-8b8d-b702-add4-8f099f934ed5@chalmers.se> <91c98791-9df2-43ee-9aac-205c5b0de9c2@default> <87blfm6922.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="37183"; 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: Andreas Abel , 31796@debbugs.gnu.org To: Drew Adams Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Nov 25 08:56:30 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 1khpfB-0009a9-9V for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 25 Nov 2020 08:56:29 +0100 Original-Received: from localhost ([::1]:56574 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1khpfA-0004LU-Ck for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 25 Nov 2020 02:56:28 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:53664) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1khpdm-0002sU-Q6 for bug-gnu-emacs@gnu.org; Wed, 25 Nov 2020 02:55:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:50751) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1khpdm-00034Z-Iz for bug-gnu-emacs@gnu.org; Wed, 25 Nov 2020 02:55:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1khpdm-0008IT-IC for bug-gnu-emacs@gnu.org; Wed, 25 Nov 2020 02:55:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 25 Nov 2020 07:55:02 +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.160629087031846 (code B ref 31796); Wed, 25 Nov 2020 07:55:02 +0000 Original-Received: (at 31796) by debbugs.gnu.org; 25 Nov 2020 07:54:30 +0000 Original-Received: from localhost ([127.0.0.1]:34063 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1khpdG-0008Ha-Hr for submit@debbugs.gnu.org; Wed, 25 Nov 2020 02:54:30 -0500 Original-Received: from relay7-d.mail.gandi.net ([217.70.183.200]:36589) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1khpdE-0008H9-FP for 31796@debbugs.gnu.org; Wed, 25 Nov 2020 02:54:29 -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 relay7-d.mail.gandi.net (Postfix) with ESMTPSA id A418020006; Wed, 25 Nov 2020 07:54:20 +0000 (UTC) In-Reply-To: (Drew Adams's message of "Tue, 24 Nov 2020 12:12:25 -0800 (PST)") 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:194167 Archived-At: --=-=-= Content-Type: text/plain >> > Multiple > Search > >> > Query Replace Using TAGS Table... M-q >> > Query Replace Using `find'... Q >> >> dired-do-find-regexp-and-replace could be left bound to Q, but >> dired-do-query-replace-regexp could be bound to M-% in Dired. > > For the latter, I use `M-q' (not `M-%'). > I suggest that vanilla Emacs do the same. > > These two commands have quite similar purposes. > I suggest that they have similar keys. > > Also, `M-%' has its normal meaning when Dired > has been toggled to writable (WDired). That > key should be kept for its normal purpose, IMO. 'M-q' has its normal meaning of filling the paragraph, so it would be confusing to use other meaning in Dired. While finding a good short key would be nice, here is a patch that for consistency with 'M-s a M-C-s' also adds 'M-s a M-C-%': --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=query-replace-regexp.patch diff --git a/lisp/vc/vc-dir.el b/lisp/vc/vc-dir.el index cdf8ab984e..bed779104c 100644 --- a/lisp/vc/vc-dir.el +++ b/lisp/vc/vc-dir.el @@ -308,6 +308,7 @@ vc-dir-mode-map (define-key map "Q" 'vc-dir-query-replace-regexp) (define-key map (kbd "M-s a C-s") 'vc-dir-isearch) (define-key map (kbd "M-s a M-C-s") 'vc-dir-isearch-regexp) + (define-key map (kbd "M-s a M-C-%") 'vc-dir-query-replace-regexp) (define-key map "G" 'vc-dir-ignore) (let ((branch-map (make-sparse-keymap))) diff --git a/lisp/dired.el b/lisp/dired.el index 08b19a0225..6cbcc17852 100644 --- a/lisp/dired.el +++ b/lisp/dired.el @@ -1932,6 +1932,7 @@ dired-mode-map ;; isearch (define-key map (kbd "M-s a C-s") 'dired-do-isearch) (define-key map (kbd "M-s a M-C-s") 'dired-do-isearch-regexp) + (define-key map (kbd "M-s a M-C-%") 'dired-do-query-replace-regexp) (define-key map (kbd "M-s f C-s") 'dired-isearch-filenames) (define-key map (kbd "M-s f M-C-s") 'dired-isearch-filenames-regexp) ;; misc @@ -2214,9 +2215,12 @@ dired-mode-map (define-key map [menu-bar operate dashes-3] '("--")) - (define-key map [menu-bar operate query-replace] - '(menu-item "Query Replace in Files..." dired-do-find-regexp-and-replace - :help "Replace regexp matches in marked files")) + (define-key map [menu-bar operate find-regexp-and-replace] + '(menu-item "Replace Regexp in Files..." dired-do-find-regexp-and-replace + :help "Replace regexp matches in marked files")) + (define-key map [menu-bar operate query-replace-regexp] + '(menu-item "Query Replace in Files..." dired-do-query-replace-regexp + :help "Replace regexp matches in marked files")) (define-key map [menu-bar operate search] '(menu-item "Search Files..." dired-do-find-regexp :help "Search marked files for matches of regexp")) diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index a395453491..7b8dcc2096 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -598,7 +598,7 @@ project-prefix-map (define-key map "p" 'project-switch-project) (define-key map "g" 'project-find-regexp) (define-key map "G" 'project-or-external-find-regexp) - (define-key map "r" 'project-query-replace-regexp) + (define-key map [?\C-\M-%] 'project-query-replace-regexp) map) "Keymap for project commands.") --=-=-=--