From: Juri Linkov Date: Mon, 17 Nov 2008 00:43:27 +0000 (+0000) Subject: (dired-isearch-filter-predicate-orig): Rename from X-Git-Tag: emacs-pretest-23.0.90~1764 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=43533626b3152cd589c43ed2c1b1c7da459b705e;p=emacs.git (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'. --- diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el index 930c4e32340..1df5dc82dcf 100644 --- a/lisp/dired-aux.el +++ b/lisp/dired-aux.el @@ -2310,19 +2310,18 @@ Use \\[dired-hide-subdir] to (un)hide a particular subdirectory." :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 @@ at file names. When off, it uses the default function 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)