X-Loop: help-debbugs@HIDDEN Subject: bug#54025: 27.2; dired-do-find-regexp skips occurences 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?= <an.petrov@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Wed, 16 Feb 2022 11:41:01 +0000 Resent-Message-ID: <handler.54025.B.16450116269843 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: report 54025 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 54025 <at> debbugs.gnu.org X-Debbugs-Original-To: "bug-gnu-emacs@HIDDEN" <bug-gnu-emacs@HIDDEN> Received: via spool by submit <at> debbugs.gnu.org id=B.16450116269843 (code B ref -1); Wed, 16 Feb 2022 11:41:01 +0000 Received: (at submit) by debbugs.gnu.org; 16 Feb 2022 11:40:26 +0000 Received: from localhost ([127.0.0.1]:47536 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1nKIfa-0002Yh-E0 for submit <at> debbugs.gnu.org; Wed, 16 Feb 2022 06:40:26 -0500 Received: from lists.gnu.org ([209.51.188.17]:56938) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <prvs=03926dc0d=an.petrov@HIDDEN>) id 1nKIfY-0002YX-AL for submit <at> debbugs.gnu.org; Wed, 16 Feb 2022 06:40:24 -0500 Received: from eggs.gnu.org ([209.51.188.92]:36260) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <prvs=03926dc0d=an.petrov@HIDDEN>) id 1nKIfY-0005M5-1c for bug-gnu-emacs@HIDDEN; Wed, 16 Feb 2022 06:40:24 -0500 Received: from mail1.itgrp.ru ([185.8.182.248]:28626) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <prvs=03926dc0d=an.petrov@HIDDEN>) id 1nKIfU-0003H8-EE for bug-gnu-emacs@HIDDEN; Wed, 16 Feb 2022 06:40:23 -0500 IronPort-SDR: hkk/WbOJpBZnOUQ89U+a+wlGDeVScA8jvKug6+u9O7LIYm76cqPjN/C0vfi4P2tOzgzwIT6A8f r8ER866DYX2g== X-IronPort-AV: E=Sophos;i="5.88,373,1635195600"; d="scan'208";a="159590410" 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?= <an.petrov@HIDDEN> Thread-Topic: 27.2; dired-do-find-regexp skips occurences Thread-Index: AQHYIyjXtspqEmtb7Emo34ft0KOoIQ== Date: Wed, 16 Feb 2022 11:40:06 +0000 Message-ID: <ced1c020985a42fd8bd77c4ea8ee58a1@HIDDEN> Accept-Language: ru-RU, en-US Content-Language: ru-RU X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.24.4.20] Content-Type: text/plain; charset="koi8-r" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Received-SPF: pass client-ip=185.8.182.248; envelope-from=prvs=03926dc0d=an.petrov@HIDDEN; helo=mail1.itgrp.ru X-Spam_score_int: 37 X-Spam_score: 3.7 X-Spam_bar: +++ X-Spam_report: (3.7 / 5.0 requ) BAYES_00=-1.9, CHARSET_FARAWAY_HEADER=3.2, MIME_CHARSET_FARAWAY=2.45, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.4 (-) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -2.4 (--) Hello, team! I found that `dired-do-find-regexp' does not show occurences in files where the occurences were deleted but not saved. Test: 1. Create directory 3 M-x + 3 [RET] =20 2. Create and save two files (1.txt, 2.txt) containing line "aaa" and the third containing lines "aaa", "bbb", "aaa": C-x C-f 1.txt [RET] aaa [RET] C-x C-f 2.txt [RET] aaa [RET] C-x C-f 3.txt [RET] aaa [RET] bbb [RET] aaa [RET] C-u C-x s 3. Now select the all in dired buffer and try searching for word "aaa": C-x b 3 [RET] t A \baaa\b [RET] Now dired buffer looks like: =20 /home/andrey/3: =C9=D4=CF=C7=CF 20 drwxr-xr-x 2 andrey andrey 4096 =C6=C5=D7 16 15:58 . drwx------ 48 andrey andrey 4096 =C6=C5=D7 16 15:57 .. * -rw-r--r-- 1 andrey andrey 4 =C6=C5=D7 16 15:58 1.txt * -rw-r--r-- 1 andrey andrey 4 =C6=C5=D7 16 15:58 2.txt * -rw-r--r-- 1 andrey andrey 4 =C6=C5=D7 16 15:58 3.txt =20 *xref* buffer contains: /home/andrey/3/1.txt 1: aaa /home/andrey/3/2.txt 1: aaa /home/andrey/3/3.txt 1: aaa 3: aaa =20 4. Choose the first occurence in 3.txt file and delete the line but DO NOT SAVE the buffer. 5. Go back to dired buffer and try searching for "aaa" again. Now *xref* does not contain 3.txt file although it has an occurence of "aaa". =20 /home/andrey/3/1.txt 1: aaa /home/andrey/3/2.txt 1: aaa =20 After saving 3.txt and repeating the search *xref* buffers shows all 3 entries as expected. Please take a look into `xref-revert-buffer' (g) inside *xref* buffer also. It seems that it shows only occurences of the first file. In GNU Emacs 27.2 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.27, cair= o version 1.17.4) of 2021-03-26 built on juergen Windowing system distributor 'The X.Org Foundation', version 11.0.12101003 System Description: Arch Linux Configured using: 'configure --prefix=3D/usr --sysconfdir=3D/etc --libexecdir=3D/usr/lib --localstatedir=3D/var --with-x-toolkit=3Dgtk3 --with-xft --with-wide-int --with-modules --with-cairo --with-harfbuzz 'CFLAGS=3D-march=3Dx86-64 -mtune=3Dgeneric -O2 -pipe -fno-plt' CPPFLAGS=3D-D_FORTIFY_SOURCE=3D2 LDFLAGS=3D-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now' Configured features: XPM JPEG TIFF GIF PNG RSVG CAIRO SOUND GPM DBUS GSETTINGS GLIB NOTIFY INOTIFY ACL GNUTLS LIBXML2 FREETYPE HARFBUZZ M17N_FLT LIBOTF ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 XDBE XIM MODULES THREADS LIBSYSTEMD JSON PDUMPER LCMS2 GMP Important settings: value of $LANG: ru_RU.UTF-8 locale-coding-system: utf-8-unix Major mode: Dired by name Minor modes in effect: tooltip-mode: t global-eldoc-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t buffer-read-only: t line-number-mode: t transient-mark-mode: t Load-path shadows: None found. Features: (shadow sort mail-extr eieio-opt speedbar sb-image ezimage dframe find-func help-fns radix-tree emacsbug message rmc puny format-spec rfc822 mml mml-sec password-cache epa derived epg epg-config gnus-util rmail rmail-loaddefs text-property-search mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils time-date subr-x pulse cl-extra help-mode easymenu seq xref cl-seq project eieio byte-opt bytecomp byte-compile cconv eieio-core cl-macs gv eieio-loaddefs grep compile comint ansi-color ring dired-aux cl-loaddefs cl-lib dired dired-loaddefs cyril-util tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode elisp-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core term/tty-colors frame minibuffer cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite charscript charprop case-table epa-hook jka-cmpr-hook help simple abbrev obarray cl-preloaded nadvice loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote threads dbusbind inotify lcms2 dynamic-setting system-font-setting font-render-setting cairo move-toolbar gtk x-toolkit x multi-tty make-network-process emacs) Memory information: ((conses 16 68400 9572) (symbols 48 8127 1) (strings 32 22571 1888) (string-bytes 1 741405) (vectors 16 14374) (vector-slots 8 182357 17890) (floats 8 37 22) (intervals 56 795 0) (buffers 1000 21)) Best regards, Andrey Petrov.=
Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) Content-Type: text/plain; charset=utf-8 X-Loop: help-debbugs@HIDDEN From: help-debbugs@HIDDEN (GNU bug Tracking System) To: =?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?= <an.petrov@HIDDEN> Subject: bug#54025: Acknowledgement (27.2; dired-do-find-regexp skips occurences) Message-ID: <handler.54025.B.16450116269843.ack <at> debbugs.gnu.org> References: <ced1c020985a42fd8bd77c4ea8ee58a1@HIDDEN> X-Gnu-PR-Message: ack 54025 X-Gnu-PR-Package: emacs Reply-To: 54025 <at> debbugs.gnu.org Date: Wed, 16 Feb 2022 11:41:02 +0000 Thank you for filing a new bug report with debbugs.gnu.org. This is an automatically generated reply to let you know your message has been received. Your message is being forwarded to the package maintainers and other interested parties for their attention; they will reply in due course. Your message has been sent to the package maintainer(s): bug-gnu-emacs@HIDDEN If you wish to submit further information on this problem, please send it to 54025 <at> debbugs.gnu.org. Please do not send mail to help-debbugs@HIDDEN unless you wish to report a problem with the Bug-tracking system. --=20 54025: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D54025 GNU Bug Tracking System Contact help-debbugs@HIDDEN with problems
X-Loop: help-debbugs@HIDDEN Subject: bug#54025: 27.2; dired-do-find-regexp skips occurences Resent-From: Dmitry Gutov <dgutov@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Mon, 21 Feb 2022 00:36:01 +0000 Resent-Message-ID: <handler.54025.B54025.16454037355086 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 54025 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: =?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?= <an.petrov@HIDDEN>, 54025 <at> debbugs.gnu.org Received: via spool by 54025-submit <at> debbugs.gnu.org id=B54025.16454037355086 (code B ref 54025); Mon, 21 Feb 2022 00:36:01 +0000 Received: (at 54025) by debbugs.gnu.org; 21 Feb 2022 00:35:35 +0000 Received: from localhost ([127.0.0.1]:34194 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1nLwfv-0001Jy-6g for submit <at> debbugs.gnu.org; Sun, 20 Feb 2022 19:35:35 -0500 Received: from mail-wr1-f47.google.com ([209.85.221.47]:33457) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <raaahh@HIDDEN>) id 1nLwft-0001Ji-3B for 54025 <at> debbugs.gnu.org; Sun, 20 Feb 2022 19:35:33 -0500 Received: by mail-wr1-f47.google.com with SMTP id e3so24324140wra.0 for <54025 <at> debbugs.gnu.org>; Sun, 20 Feb 2022 16:35:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:message-id:date:mime-version:user-agent:subject :content-language:to:references:from:in-reply-to :content-transfer-encoding; bh=XbeyJUNk8kLfbWgErQha5ZJV+nDa2K3DlAmfBS12w2Y=; b=QG0DfQvtzSmTssVr11Xdf0j4YMwfYOnuqpvCZBvgQ8ymLiqeKq7ygN7EVGd/olkVq4 c/H439mTjYScodnb4GxGadcx51Cn3wPuVJmGAg+ErTzendY5kciji53zs/zLBixEIq/k d88iyWuZypQCa2GwmErLtewrG7bzwkmhIQQfaGwqQHhesJsyDMXoC7LBwpcVxRkvGp0o kzvy9bOhWHWLy58BhpU51Noq2iSq6U7ml2+ekc0E6YwtnWL2ecyzCzujgZ9Um5vn18EF neHPkj2MivIfxFNp0Rxw/sIyghecGUZ1YbLwPAH29HMJDpkpeKq6sBa4Kj741EYB8rb9 fOxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:message-id:date:mime-version:user-agent :subject:content-language:to:references:from:in-reply-to :content-transfer-encoding; bh=XbeyJUNk8kLfbWgErQha5ZJV+nDa2K3DlAmfBS12w2Y=; b=tj7Gb6mIhIAv00CNAHry/Q27c5NeXAFd2zIq0ihYiMxakGvq7Vgw/NiatCeEKMBMXg U/5dwxmCBc3fqH2RwQDCj84yvEufnaeBmi5WQw3CHTmU7OGOoszzjHlZE/pvTCOtI/Zr qH2NWtwnB4VIIlaCkD8tBepRYFf5EhWLUDaOLyVuzj/9F1KqWDgsIcJ+tIypUAUpODCG smv7TDD3jphEi6hTHIrL4IBcGz80HjQWEMHF/GdNhW0OfRt73Efy6Bvt30YrL3EKBqGY j2hl/04iU3G8E8D2/rQ4rMhZ5rDE/ktMafZusGxDHSNNRD6PrbdEtoWzP5nrqWEe3FNN meoA== X-Gm-Message-State: AOAM531cHZAasGwLwB3EBj/osm6BaB6h3SZvGJxJPNCsotEYNfZdY9UV wNYNfsVqc/hqXm53ON81PDQh3OMi8dU= X-Google-Smtp-Source: ABdhPJzs7xnMyEE3PlxEgQfHUZVr+UPmCjUDWhup4UXDMjsFlxR3qmf3PxZfsW/KqDVzlTeNtKDyvA== X-Received: by 2002:adf:e904:0:b0:1d6:64b3:fdd with SMTP id f4-20020adfe904000000b001d664b30fddmr13746696wrm.200.1645403726969; Sun, 20 Feb 2022 16:35:26 -0800 (PST) Received: from [192.168.0.6] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id az13sm29108270wrb.39.2022.02.20.16.35.25 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 20 Feb 2022 16:35:26 -0800 (PST) Message-ID: <611521ae-42d4-6584-915e-243060de536e@HIDDEN> Date: Mon, 21 Feb 2022 02:35:24 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Content-Language: en-US References: <ced1c020985a42fd8bd77c4ea8ee58a1@HIDDEN> From: Dmitry Gutov <dgutov@HIDDEN> In-Reply-To: <ced1c020985a42fd8bd77c4ea8ee58a1@HIDDEN> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Score: 0.5 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -0.5 (/) Hi! On 16.02.2022 13:40, Петров Андрей wrote: > 5. Go back to dired buffer and try searching for "aaa" again. > > Now*xref* does not contain 3.txt file although it has an occurence of > "aaa". > > /home/andrey/3/1.txt > 1: aaa > /home/andrey/3/2.txt > 1: aaa > > After saving 3.txt and repeating the search*xref* buffers shows all 3 > entries as expected. > > Please take a look into `xref-revert-buffer' (g) inside*xref* buffer > also. It seems that it shows only occurences of the first file. The reason this happens is because xref-matches-in-files uses the contents of open buffers to verify the regexp matches, and to show the (possibly syntax-highlighted) text in matches. The fact that such buffers can be modified and unsaved is obviously a problem. 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
X-Loop: help-debbugs@HIDDEN Subject: bug#54025: 27.2; dired-do-find-regexp skips occurences Resent-From: Eli Zaretskii <eliz@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Mon, 21 Feb 2022 03:34:02 +0000 Resent-Message-ID: <handler.54025.B54025.164541440515320 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 54025 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Dmitry Gutov <dgutov@HIDDEN> Cc: 54025 <at> debbugs.gnu.org, an.petrov@HIDDEN Received: via spool by 54025-submit <at> debbugs.gnu.org id=B54025.164541440515320 (code B ref 54025); Mon, 21 Feb 2022 03:34:02 +0000 Received: (at 54025) by debbugs.gnu.org; 21 Feb 2022 03:33:25 +0000 Received: from localhost ([127.0.0.1]:34358 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1nLzS1-0003z2-7W for submit <at> debbugs.gnu.org; Sun, 20 Feb 2022 22:33:25 -0500 Received: from eggs.gnu.org ([209.51.188.92]:55086) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1nLzRz-0003yn-Jz for 54025 <at> debbugs.gnu.org; Sun, 20 Feb 2022 22:33:23 -0500 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 <eliz@HIDDEN>) 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==; 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 <eliz@HIDDEN>) id 1nLzRs-000473-KU; Sun, 20 Feb 2022 22:33:16 -0500 Date: Mon, 21 Feb 2022 05:33:21 +0200 Message-Id: <831qzwx5a6.fsf@HIDDEN> From: Eli Zaretskii <eliz@HIDDEN> In-Reply-To: <611521ae-42d4-6584-915e-243060de536e@HIDDEN> (message from Dmitry Gutov on Mon, 21 Feb 2022 02:35:24 +0200) References: <ced1c020985a42fd8bd77c4ea8ee58a1@HIDDEN> <611521ae-42d4-6584-915e-243060de536e@HIDDEN> X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -3.3 (---) > Date: Mon, 21 Feb 2022 02:35:24 +0200 > From: Dmitry Gutov <dgutov@HIDDEN> > > 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.
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997 nCipher Corporation Ltd,
1994-97 Ian Jackson.