From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?Q?=D0=9F=D0=B5=D1=82=D1=80=D0=BE=D0=B2_?= =?UTF-8?Q?=D0=90=D0=BD=D0=B4=D1=80=D0=B5=D0=B9?= Newsgroups: gmane.emacs.bugs Subject: bug#54025: 27.2; dired-do-find-regexp skips occurences Date: Mon, 21 Feb 2022 07:00:45 +0000 Message-ID: <967624c188c942ff8ecbf23bd6be46d0@pay-lab.ru> References: <611521ae-42d4-6584-915e-243060de536e@yandex.ru>,<831qzwx5a6.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="koi8-r" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23135"; mail-complaints-to="usenet@ciao.gmane.io" Cc: "54025@debbugs.gnu.org" <54025@debbugs.gnu.org> To: Eli Zaretskii , Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Feb 21 08:02:17 2022 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 1nM2i6-0005pY-F1 for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 21 Feb 2022 08:02:14 +0100 Original-Received: from localhost ([::1]:49958 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nM2i5-00007Q-3Q for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 21 Feb 2022 02:02:13 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:41046) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nM2h7-00005u-WE for bug-gnu-emacs@gnu.org; Mon, 21 Feb 2022 02:01:16 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:40865) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nM2gv-0004Fb-Rd for bug-gnu-emacs@gnu.org; Mon, 21 Feb 2022 02:01:11 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nM2gv-0003wb-Ji for bug-gnu-emacs@gnu.org; Mon, 21 Feb 2022 02:01:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: =?UTF-8?Q?=D0=9F=D0=B5=D1=82=D1=80=D0=BE=D0=B2_?= =?UTF-8?Q?=D0=90=D0=BD=D0=B4=D1=80=D0=B5=D0=B9?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 21 Feb 2022 07:01:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 54025 X-GNU-PR-Package: emacs Original-Received: via spool by 54025-submit@debbugs.gnu.org id=B54025.164542685415142 (code B ref 54025); Mon, 21 Feb 2022 07:01:01 +0000 Original-Received: (at 54025) by debbugs.gnu.org; 21 Feb 2022 07:00:54 +0000 Original-Received: from localhost ([127.0.0.1]:34762 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nM2gn-0003w9-Vh for submit@debbugs.gnu.org; Mon, 21 Feb 2022 02:00:54 -0500 Original-Received: from mail1.itgrp.ru ([185.8.182.248]:24703) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nM2gm-0003vw-DZ for 54025@debbugs.gnu.org; Mon, 21 Feb 2022 02:00:53 -0500 IronPort-SDR: n83PbBxGkzNYxptUwuLM2T82lB//eiCO6+/YNv5rSRJiwzmsh5GQjIgQkjU4QD6wzPC7nwkMDK j53JavhuYRQQ== X-IronPort-AV: E=Sophos;i="5.88,385,1635195600"; d="scan'208";a="159663836" Thread-Topic: bug#54025: 27.2; dired-do-find-regexp skips occurences Thread-Index: AQHYIyjXtspqEmtb7Emo34ft0KOoIayc/TcAgABkI0mAADe4/Q== In-Reply-To: <831qzwx5a6.fsf@gnu.org> Accept-Language: ru-RU, en-US Content-Language: ru-RU x-originating-ip: [10.24.4.20] 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:227307 Archived-At: Eli, Dmitry, I think it is convenient to ask user to save some buffers (like `rgrep' do)= if the search algorithm implementation requires all files to be saved. Opt= ionally modified buffers can be skipped with appropriate logging into messa= ges buffer. =F3 =D5=D7=C1=D6=C5=CE=C9=C5=CD, =E1=CE=C4=D2=C5=CA =F0=C5=D4=D2=CF=D7, =D0=D2=CF=C7=D2=C1=CD=CD=C9=D3=D4 =EF=EF=EF =E9=CE=D0=C1=D3-=F3=CF=C6=D4. ________________________________________ =EF=D4: Eli Zaretskii =EF=D4=D0=D2=C1=D7=CC=C5=CE=CF: 21 =C6=C5=D7=D2=C1=CC=D1 2022 =C7. 8:33:21 =EB=CF=CD=D5: Dmitry Gutov =EB=CF=D0=C9=D1: =F0=C5=D4=D2=CF=D7 =E1=CE=C4=D2=C5=CA; 54025@debbugs.gnu.o= rg =F4=C5=CD=C1: Re: bug#54025: 27.2; dired-do-find-regexp skips occurences > Date: Mon, 21 Feb 2022 02:35:24 +0200 > From: Dmitry Gutov > > I suggest we simply add a check before doing a search, which will remind > you to save any such buffers. It will need to be added to > project-find-regexp as well, naturally. Something like the patch below. > > What do you think? > > diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el > index 41c45b4e51..c3b1b620bb 100644 > --- a/lisp/dired-aux.el > +++ b/lisp/dired-aux.el > @@ -3266,6 +3266,12 @@ dired-do-find-regexp > (require 'xref) > (defvar grep-find-ignored-files) > (declare-function rgrep-find-ignored-directories "grep" (dir)) > + (save-some-buffers) > + (or (not (memq t (mapcar (lambda (buf) > + (and (buffer-file-name buf) > + (buffer-modified-p buf))) > + (buffer-list)))) > + (user-error "Modified buffers exist; aborting")) > (let* ((marks (dired-get-marked-files nil nil nil nil t)) > (ignores (nconc (mapcar > #'file-name-as-directory I'd rather we gave the user the choice to either abort or proceed. It is not clear that the fact we search buffers cannot be a useful feature in some situations.