Mercurial > emacs
changeset 99641:833f28e62d37
(dired-isearch-filter-predicate-orig): Rename from
`dired-isearch-orig-success-function'.
(dired-isearch-filenames-toggle, dired-isearch-filenames-setup)
(dired-isearch-filenames-end): Rename `isearch-success-function' to
`isearch-filter-predicate'. Doc fix.
(dired-isearch-filter-filenames): Rename from
`dired-isearch-success-function'.
author | Juri Linkov <juri@jurta.org> |
---|---|
date | Mon, 17 Nov 2008 00:43:27 +0000 |
parents | 034bef9118e6 |
children | 1221f267b55c |
files | lisp/dired-aux.el |
diffstat | 1 files changed, 14 insertions(+), 15 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/dired-aux.el Mon Nov 17 00:42:46 2008 +0000 +++ b/lisp/dired-aux.el Mon Nov 17 00:43:27 2008 +0000 @@ -2310,19 +2310,18 @@ :group 'dired :version "23.1") -(defvar dired-isearch-orig-success-function nil) +(defvar dired-isearch-filter-predicate-orig nil) (defun dired-isearch-filenames-toggle () "Toggle file names searching on or off. -When on, Isearch checks the success of the current matching point -using the function `dired-isearch-success-function' that matches only -at file names. When off, it uses the default function -`isearch-success-function-default'." +When on, Isearch skips matches outside file names using the predicate +`dired-isearch-filter-filenames' that matches only at file names. +When off, it uses the default predicate `isearch-filter-invisible'." (interactive) - (setq isearch-success-function - (if (eq isearch-success-function 'dired-isearch-success-function) - 'isearch-success-function-default - 'dired-isearch-success-function)) + (setq isearch-filter-predicate + (if (eq isearch-filter-predicate 'dired-isearch-filter-filenames) + 'isearch-filter-invisible + 'dired-isearch-filter-filenames)) (setq isearch-success t isearch-adjusted t) (isearch-update)) @@ -2332,20 +2331,20 @@ Intended to be added to `isearch-mode-hook'." (when dired-isearch-filenames (define-key isearch-mode-map "\M-sf" 'dired-isearch-filenames-toggle) - (setq dired-isearch-orig-success-function - (default-value 'isearch-success-function)) - (setq-default isearch-success-function 'dired-isearch-success-function) + (setq dired-isearch-filter-predicate-orig + (default-value 'isearch-filter-predicate)) + (setq-default isearch-filter-predicate 'dired-isearch-filter-filenames) (add-hook 'isearch-mode-end-hook 'dired-isearch-filenames-end nil t))) (defun dired-isearch-filenames-end () "Clean up the Dired file name search after terminating isearch." (define-key isearch-mode-map "\M-sf" nil) - (setq-default isearch-success-function dired-isearch-orig-success-function) + (setq-default isearch-filter-predicate dired-isearch-filter-predicate-orig) (remove-hook 'isearch-mode-end-hook 'dired-isearch-filenames-end t)) -(defun dired-isearch-success-function (beg end) +(defun dired-isearch-filter-filenames (beg end) "Match only at visible regions with the text property `dired-filename'." - (and (isearch-success-function-default beg end) + (and (isearch-filter-invisible beg end) (if dired-isearch-filenames (text-property-not-all (min beg end) (max beg end) 'dired-filename nil)