GNU bug report logs - #54025
27.2; dired-do-find-regexp skips occurences

Previous Next

Package: emacs;

Reported by: Петров Андрей <an.petrov <at> pay-lab.ru>

Date: Wed, 16 Feb 2022 11:41:01 UTC

Severity: normal

Found in version 27.2

Full log


Message #14 received at 54025 <at> debbugs.gnu.org (full text, mbox):

From: Петров Андрей <an.petrov <at> pay-lab.ru>
To: Eli Zaretskii <eliz <at> gnu.org>, Dmitry Gutov <dgutov <at> yandex.ru>
Cc: "54025 <at> debbugs.gnu.org" <54025 <at> debbugs.gnu.org>
Subject: Re: bug#54025: 27.2; dired-do-find-regexp skips occurences
Date: Mon, 21 Feb 2022 07:00:45 +0000
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. Optionally modified buffers can be skipped with appropriate logging into messages buffer.

С уважением,
Андрей Петров,
программист ООО Инпас-Софт.


________________________________________
От: Eli Zaretskii <eliz <at> gnu.org>
Отправлено: 21 февраля 2022 г. 8:33:21
Кому: Dmitry Gutov
Копия: Петров Андрей; 54025 <at> debbugs.gnu.org
Тема: Re: bug#54025: 27.2; dired-do-find-regexp skips occurences

> Date: Mon, 21 Feb 2022 02:35:24 +0200
> From: Dmitry Gutov <dgutov <at> yandex.ru>
>
> 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.




This bug report was last modified 3 years and 114 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.