]> git.eshelyaron.com Git - emacs.git/commit
Add search function to search within filenames in Dired and WDired (bug#14013)
authorJuri Linkov <juri@linkov.net>
Mon, 28 Mar 2022 18:00:32 +0000 (21:00 +0300)
committerJuri Linkov <juri@linkov.net>
Mon, 28 Mar 2022 18:00:32 +0000 (21:00 +0300)
commit935cc42795686710f82b8928b6802f20be8f27c0
treeb778e1ef89cca284e097fc965181a9138a7b6f88
parent52d5771e0a803f57b8cdd7675bf15f2f9b946039
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.
lisp/dired-aux.el
lisp/isearch.el
lisp/replace.el
lisp/wdired.el