From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#54025: 27.2; dired-do-find-regexp skips occurences Date: Mon, 21 Feb 2022 05:33:21 +0200 Message-ID: <831qzwx5a6.fsf@gnu.org> References: <611521ae-42d4-6584-915e-243060de536e@yandex.ru> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="20545"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 54025@debbugs.gnu.org, an.petrov@pay-lab.ru To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Feb 21 04:34:14 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 1nLzSo-0005ET-7j for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 21 Feb 2022 04:34:14 +0100 Original-Received: from localhost ([::1]:46302 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nLzSm-0006zp-N1 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 20 Feb 2022 22:34:12 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:33562) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nLzSc-0006zR-Cs for bug-gnu-emacs@gnu.org; Sun, 20 Feb 2022 22:34:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:40461) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nLzSc-00024L-3s for bug-gnu-emacs@gnu.org; Sun, 20 Feb 2022 22:34:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nLzSc-000405-2e for bug-gnu-emacs@gnu.org; Sun, 20 Feb 2022 22:34:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 21 Feb 2022 03:34:02 +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.164541440515320 (code B ref 54025); Mon, 21 Feb 2022 03:34:02 +0000 Original-Received: (at 54025) by debbugs.gnu.org; 21 Feb 2022 03:33:25 +0000 Original-Received: from localhost ([127.0.0.1]:34358 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nLzS1-0003z2-7W for submit@debbugs.gnu.org; Sun, 20 Feb 2022 22:33:25 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:55086) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nLzRz-0003yn-Jz for 54025@debbugs.gnu.org; Sun, 20 Feb 2022 22:33:23 -0500 Original-Received: from [2001:470:142:3::e] (port=39500 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nLzRt-00020w-9M; Sun, 20 Feb 2022 22:33:17 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=tStwSso91yXSlqmkw0ECQ9v6zyeiGyHQaRnVlqF/P+0=; b=sVPbBN94kciG 76aMhFciddrjp7rgsFxPSxczGGh3sJk4+f6pFoHwL5irpq55Smur8Rm4sG75a1D/CK6ewytF9rJRB 5Fq8NHQaVwBmw0/diO13tqhHJ1/USMlcKA7SdKgWxoXmK05zp2Fsz18MCtz6v1hGHeCz1wjkhHnt4 u7isIchCcwj6Z9RrDOiDO9QQRD0DaGpQSPVZqwV1mL+QisvhH3E7MDdydCFXKf3+7AYL7s1qg5tSz v36DNyd6EUzXRir+ilK/85OLUgMMhzoYzNGyILRQRceqhFNcnsXpKDvHxRDcrMuDP4pTUqUUxze2F BLA+g25jhcGywAKcIHTzTg==; Original-Received: from [87.69.77.57] (port=2664 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nLzRs-000473-KU; Sun, 20 Feb 2022 22:33:16 -0500 In-Reply-To: <611521ae-42d4-6584-915e-243060de536e@yandex.ru> (message from Dmitry Gutov on Mon, 21 Feb 2022 02:35:24 +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:227301 Archived-At: > 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.