unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Dan Jacobson <jidanni@jidanni.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 73635-done@debbugs.gnu.org, Visuwesh <visuweshm@gmail.com>
Subject: bug#73635: dired-do-query-replace-regexp should check if files are selected first
Date: Sat, 26 Oct 2024 05:53:14 +0800	[thread overview]
Message-ID: <878qubsvcl.3.fsf@jidanni.org> (raw)
In-Reply-To: <87frpbb4cn.3.fsf@jidanni.org>

>> > E.g., yes there were files selected, but we just did a first run, and
>> > are no longer looking at the dired buffer. We need to go back to the
>> > dired buffer first. Fine. But at least let the user know before they
>> > bother entering the from and to values.
>> 
>> It uses the filename under point if there are no marked files like all
>> dired commands.

EZ> Right, and so I think there's no bug here to fix, and I'm therefore
EZ> closing it.

There is no check that the user is staring at the dired buffer first
before asking for the two strings.

So the user thinks they can mark some files, have a look at one, and
then do dired-do-query-replace-regexp... and it asks for the two
strings, and then says they have not selected any files.

But they did select the files. But they need to be back in the dired
buffer before running dired-do-query-replace-regexp. So
dired-do-query-replace-regexp should tell them that, instead of asking
them for the two strings.

In fact what needs to be changed is:
dired-do-query-replace-regexp needs to first check if the current buffer
is a dired buffer.

And if it is not, it needs to say "Must be run in a dired buffer" and
quit.

(Even if there is only one dired buffer in buffer-list.)





  reply	other threads:[~2024-10-25 21:53 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-05  3:44 bug#73635: dired-do-query-replace-regexp should check if files are selected first Dan Jacobson
2024-10-05  4:22 ` Visuwesh
2024-10-19  7:02   ` Eli Zaretskii
2024-10-25 21:53     ` Dan Jacobson [this message]
2024-10-26  6:59       ` Eli Zaretskii
2024-10-26  8:59         ` Dan Jacobson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=878qubsvcl.3.fsf@jidanni.org \
    --to=jidanni@jidanni.org \
    --cc=73635-done@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=visuweshm@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).