>> 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.