unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@linkov.net>
To: Mike Kupfer <mkupfer@alum.berkeley.edu>
Cc: Michael Heerdegen <michael_heerdegen@web.de>,
	57293@debbugs.gnu.org, Stefan Kangas <stefankangas@gmail.com>
Subject: bug#57293: 29.0.50; query-replace with Wdired skips symlink target
Date: Sun, 21 Aug 2022 19:37:13 +0300	[thread overview]
Message-ID: <86a67xk46m.fsf@mail.linkov.net> (raw)
In-Reply-To: <40517.1661046885@alto> (Mike Kupfer's message of "Sat, 20 Aug 2022 18:54:45 -0700")

>> > Maybe turning this new behavior on by default was too much (Juri)?
>>
>> Shouldn't we get the Emacs 28 behavior whether or not that option is
>> enabled though?  IOW, isn't this just a bug?
>
> The docstring says
>
>   Non-nil to search and replace in file names only.
>
> so it does look like the relevant control.  (But I wouldn't be surprised
> if I were missing something.)

The main question is what constitutes a file name?  The old definition
was that replaceable file names are everywhere where read-only is nil.
The new definition is that file names are everywhere where the
text property 'dired-filename' is non-nil.

So if "foo" in "bar -> foo" had the text property 'dired-filename',
query-replace would visit it as well.

But wouldn't such change break some other commands?

> I have a slight preference for getting the Emacs 28 behavior by default,
> but I'm okay either way.  If there had been a NEWS entry about the new
> option (hint hint :-)) I wouldn't have filed a bug.

A NEWS entry could be added too unless something like below will make it
obsolete.

> I agree with Michael's point about "\M-sf".  Right now, you get the
> filename-only behavior for isearch via a specific functions and
> keybindings, but for query-replace, the behavior is controlled by a user
> option.  More consistency between isearch and query-replace seems like
> it would be a good thing.

Please note that unlike the corresponding option dired-isearch-filenames
that is nil, it makes much more sense to enable wdired-search-replace-filenames
by default because renaming file names is the primary use of WDired.

> I did notice this NEWS entry:
>
>   *** Search and replace in Dired/Wdired supports more regexps.
>   For example, the regexp ".*" will match only characters that are part
>   of the file name.  Also "^.*$" can be used to match at the beginning
>   of the file name and at the end of the file name.
>
> Does that functionality require wdired-search-replace-filenames to be
> non-nil?

Indeed, when wdired-search-replace-filenames is nil, ".*" matches whole lines.





  reply	other threads:[~2022-08-21 16:37 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-19  3:11 bug#57293: 29.0.50; query-replace with Wdired skips symlink target Mike Kupfer
2022-08-21  0:47 ` Michael Heerdegen
2022-08-21  1:07   ` Stefan Kangas
2022-08-21  1:46     ` Michael Heerdegen
2022-08-21  1:54     ` Mike Kupfer
2022-08-21 16:37       ` Juri Linkov [this message]
2022-08-22  6:16         ` Michael Heerdegen
2022-08-22  6:52           ` Juri Linkov
2022-08-22 22:20             ` Michael Heerdegen
2022-08-23 19:27               ` Juri Linkov
2022-08-23 23:39                 ` Michael Heerdegen
2022-08-24  1:15                   ` Mike Kupfer
2022-08-27  4:03                   ` Mike Kupfer
2022-08-27 19:45                     ` Juri Linkov
2022-08-27 19:44                   ` Juri Linkov
2022-08-28  2:34                     ` Michael Heerdegen

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=86a67xk46m.fsf@mail.linkov.net \
    --to=juri@linkov.net \
    --cc=57293@debbugs.gnu.org \
    --cc=michael_heerdegen@web.de \
    --cc=mkupfer@alum.berkeley.edu \
    --cc=stefankangas@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).