GNU bug report logs -
#78520
31.0.50; Performance issue in dired+isearch with dired-isearch-filenames
Previous Next
Reported by: Ergus <spacibba <at> aol.com>
Date: Tue, 20 May 2025 23:34:02 UTC
Severity: normal
Tags: fixed
Found in version 31.0.50
Done: Eli Zaretskii <eliz <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
>> Could you try to remove all isearch-related code from wdired.el
>> and see how it reuses dired setup? I tried, but query-replace
>> proposes to replace matches outside of filenames. This is because
>> query-replace uses isearch functions, but dired-isearch-filenames-setup
>> is not called.
>
> Are you sure? Is it not because dired doesn't set
> `replace-search-function'?
Ok, could you try this patch. Please note that the value 'dwim' of
'dired-isearch-filenames' is used only at the position where WDired
is activated, not at the position where query-replace is started.
[wdired-isearch.patch (text/x-diff, inline)]
diff --git a/lisp/wdired.el b/lisp/wdired.el
index c3773b358cc..31bc7463340 100644
--- a/lisp/wdired.el
+++ b/lisp/wdired.el
@@ -239,15 +239,10 @@ wdired-change-to-wdired-mode
(setq-local wdired--old-point (point))
(wdired--set-permission-bounds)
(when wdired-search-replace-filenames
- (add-function :around (local 'isearch-search-fun-function)
- #'dired-isearch-search-filenames
- '((isearch-message-prefix . "filename ")))
+ (dired-isearch-filenames-setup)
(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))
+ (funcall isearch-search-fun-function))))
(use-local-map wdired-mode-map)
(force-mode-line-update)
(setq buffer-read-only nil)
@@ -446,12 +441,9 @@ wdired-change-to-dired-mode
(point-min) (point-max)
'(front-sticky nil rear-nonsticky nil read-only nil keymap nil)))
(when wdired-search-replace-filenames
- (remove-function (local 'isearch-search-fun-function)
- #'dired-isearch-search-filenames)
(kill-local-variable 'replace-search-function)
(kill-local-variable 'replace-re-search-function)
- ;; Restore dired hook
- (add-hook 'isearch-mode-hook #'dired-isearch-filenames-setup nil t))
+ (dired-isearch-filenames-end))
(use-local-map dired-mode-map)
(force-mode-line-update)
(setq buffer-read-only t)
This bug report was last modified 21 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.