diff options
| author | Juri Linkov | 2008-11-17 00:43:27 +0000 |
|---|---|---|
| committer | Juri Linkov | 2008-11-17 00:43:27 +0000 |
| commit | 43533626b3152cd589c43ed2c1b1c7da459b705e (patch) | |
| tree | c2c762aa530c8c0f86573b48fc3687053b3c4869 | |
| parent | 2f669fac39f041385f25af286f863234f72a8ae4 (diff) | |
| download | emacs-43533626b3152cd589c43ed2c1b1c7da459b705e.tar.gz emacs-43533626b3152cd589c43ed2c1b1c7da459b705e.zip | |
(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'.
| -rw-r--r-- | lisp/dired-aux.el | 29 |
1 files changed, 14 insertions, 15 deletions
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." | |||
| 2310 | :group 'dired | 2310 | :group 'dired |
| 2311 | :version "23.1") | 2311 | :version "23.1") |
| 2312 | 2312 | ||
| 2313 | (defvar dired-isearch-orig-success-function nil) | 2313 | (defvar dired-isearch-filter-predicate-orig nil) |
| 2314 | 2314 | ||
| 2315 | (defun dired-isearch-filenames-toggle () | 2315 | (defun dired-isearch-filenames-toggle () |
| 2316 | "Toggle file names searching on or off. | 2316 | "Toggle file names searching on or off. |
| 2317 | When on, Isearch checks the success of the current matching point | 2317 | When on, Isearch skips matches outside file names using the predicate |
| 2318 | using the function `dired-isearch-success-function' that matches only | 2318 | `dired-isearch-filter-filenames' that matches only at file names. |
| 2319 | at file names. When off, it uses the default function | 2319 | When off, it uses the default predicate `isearch-filter-invisible'." |
| 2320 | `isearch-success-function-default'." | ||
| 2321 | (interactive) | 2320 | (interactive) |
| 2322 | (setq isearch-success-function | 2321 | (setq isearch-filter-predicate |
| 2323 | (if (eq isearch-success-function 'dired-isearch-success-function) | 2322 | (if (eq isearch-filter-predicate 'dired-isearch-filter-filenames) |
| 2324 | 'isearch-success-function-default | 2323 | 'isearch-filter-invisible |
| 2325 | 'dired-isearch-success-function)) | 2324 | 'dired-isearch-filter-filenames)) |
| 2326 | (setq isearch-success t isearch-adjusted t) | 2325 | (setq isearch-success t isearch-adjusted t) |
| 2327 | (isearch-update)) | 2326 | (isearch-update)) |
| 2328 | 2327 | ||
| @@ -2332,20 +2331,20 @@ at file names. When off, it uses the default function | |||
| 2332 | Intended to be added to `isearch-mode-hook'." | 2331 | Intended to be added to `isearch-mode-hook'." |
| 2333 | (when dired-isearch-filenames | 2332 | (when dired-isearch-filenames |
| 2334 | (define-key isearch-mode-map "\M-sf" 'dired-isearch-filenames-toggle) | 2333 | (define-key isearch-mode-map "\M-sf" 'dired-isearch-filenames-toggle) |
| 2335 | (setq dired-isearch-orig-success-function | 2334 | (setq dired-isearch-filter-predicate-orig |
| 2336 | (default-value 'isearch-success-function)) | 2335 | (default-value 'isearch-filter-predicate)) |
| 2337 | (setq-default isearch-success-function 'dired-isearch-success-function) | 2336 | (setq-default isearch-filter-predicate 'dired-isearch-filter-filenames) |
| 2338 | (add-hook 'isearch-mode-end-hook 'dired-isearch-filenames-end nil t))) | 2337 | (add-hook 'isearch-mode-end-hook 'dired-isearch-filenames-end nil t))) |
| 2339 | 2338 | ||
| 2340 | (defun dired-isearch-filenames-end () | 2339 | (defun dired-isearch-filenames-end () |
| 2341 | "Clean up the Dired file name search after terminating isearch." | 2340 | "Clean up the Dired file name search after terminating isearch." |
| 2342 | (define-key isearch-mode-map "\M-sf" nil) | 2341 | (define-key isearch-mode-map "\M-sf" nil) |
| 2343 | (setq-default isearch-success-function dired-isearch-orig-success-function) | 2342 | (setq-default isearch-filter-predicate dired-isearch-filter-predicate-orig) |
| 2344 | (remove-hook 'isearch-mode-end-hook 'dired-isearch-filenames-end t)) | 2343 | (remove-hook 'isearch-mode-end-hook 'dired-isearch-filenames-end t)) |
| 2345 | 2344 | ||
| 2346 | (defun dired-isearch-success-function (beg end) | 2345 | (defun dired-isearch-filter-filenames (beg end) |
| 2347 | "Match only at visible regions with the text property `dired-filename'." | 2346 | "Match only at visible regions with the text property `dired-filename'." |
| 2348 | (and (isearch-success-function-default beg end) | 2347 | (and (isearch-filter-invisible beg end) |
| 2349 | (if dired-isearch-filenames | 2348 | (if dired-isearch-filenames |
| 2350 | (text-property-not-all (min beg end) (max beg end) | 2349 | (text-property-not-all (min beg end) (max beg end) |
| 2351 | 'dired-filename nil) | 2350 | 'dired-filename nil) |