>> >> + (add-function :around (local 'isearch-search-fun-function) >> >> + #'dired-isearch-search-filenames) >> > >> > And: Is it intended that this is unconditional (I would expect a >> > `dired-isearch-filenames-mode' test)? >> >> Currently it is unconditional when it's using isearch-filter-predicate. >> So maybe it should be kept this way since it's what was used for many years? >> Or is there a reason to change the current behavior? > > Ok, then better let's keep it. For more customizability I added a new user option 'wdired-search-replace-filenames' enabled by default. > A different thing: I found that > > | + (setq-local replace-re-search-function #'dired-isearch-search-filenames) > > is not correct - of course, `dired-isearch-search-filenames' is a higher > order function (used for the around advice), not something suitable for > searching. With the patch installed query-replace in wdired errors. > > What's the correct value - the current binding of > `isearch-search-fun-function'? You are right, the correct value is the current binding of `isearch-search-fun-function'. Everything is fixed now in this patch, i.e. search/replace works ok in dired/wdired buffers (except ^ at the beginning of filenames that is a separate feature):