Subject: bug#78520: 31.0.50; Performance issue in dired+isearch with dired-isearch-filenames

From: Michael Heerdegen <[email-masked]>
Date: Mon, 09 Jun 2025 05:14:31 +0200

Juri Linkov <[email-masked]> writes:

> > 1.  In `wdired-change-to-wdired-mode', we do this:
> >
> > | (when wdired-search-replace-filenames
> > |   (add-function :around (local 'isearch-search-fun-function)
> > |                 #'dired-isearch-search-filenames
> > |                 '((isearch-message-prefix . "filename ")))
> > |   (setq-local replace-search-function
> > |               (setq-local replace-re-search-function
> > |                           (funcall isearch-search-fun-function)))
> > |   ;; Original dired hook removes dired-isearch-search-filenames that
> > |   ;; is needed outside isearch for lazy-highlighting in query-replace.
> > |   (remove-hook 'isearch-mode-hook #'dired-isearch-filenames-setup t))
> >
> > Does that mean that after switching to wdired there is no way to switch
> > between filename-only and normal search and replace?
>
> Correct.
>
> > Is the behavior determined when switching to wdired, or can it still
> > be change while in wdired-mode?
>
> Since wdired is intended for editing filenames, we restrict
> search/replace to filenames only.

It's also possible to change permissions.  Anyway...

> > 2.  How was that - was it possible to control whether to search and
> > replace in the symlink targets?
>
> To search/replace in the symlink, 'dired-isearch-search-filenames'
> uses the text property 'dired-symlink-filename'.

Ah - right, that was it.  Thanks.

Michael.