Add search function to search within filenames in Dired and WDired (bug#14013)
* lisp/dired-aux.el (dired-isearch-filenames-mode): Use
dired-isearch-search-filenames on isearch-search-fun-function
instead of dired-isearch-filter-filenames on isearch-filter-predicate.
(dired-isearch-filter-filenames): Remove function.
(dired-isearch-search-filenames): Add function.
* lisp/isearch.el (isearch-message-prefix): Add isearch-search-fun-function
to the list of supported advice-functions along with isearch-filter-predicate.
* lisp/replace.el (replace-search): Add comment.
* lisp/wdired.el (wdired-search-replace-filenames): New defcustom.
(wdired-isearch-filter-read-only): Remove function.
(wdired-change-to-wdired-mode, wdired-change-to-dired-mode):
Add and remove dired-isearch-search-filenames on isearch-search-fun-function
instead of wdired-isearch-filter-read-only on isearch-filter-predicate.
Also set/unset replace-search-function and replace-re-search-function.
Remove and restore isearch-mode-hook with dired-isearch-filenames-setup.
The problem is that dired-isearch-filenames-setup adds
dired-isearch-filenames-end to isearch-mode-end-hook that removes
dired-isearch-search-filenames added to isearch-search-fun-function
in wdired-change-to-wdired-mode. Then replace-highlight can't use
dired-isearch-search-filenames.