diff options
| author | Eli Zaretskii | 2019-01-21 18:20:33 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2019-01-21 18:20:33 +0200 |
| commit | 928d342c81c4d442e3125ddc463d141029d6898f (patch) | |
| tree | db862086879e9a544fbc94e6ba0af52009697b70 | |
| parent | 9034dd6c703975e9da3a269b84d8b756b997a4d8 (diff) | |
| download | emacs-928d342c81c4d442e3125ddc463d141029d6898f.tar.gz emacs-928d342c81c4d442e3125ddc463d141029d6898f.zip | |
Improve documentation of 'isearch-filter-predicate'
* lisp/isearch.el (isearch-filter-predicate)
(isearch-filter-visible): Doc fixes. (Bug#34150)
| -rw-r--r-- | lisp/isearch.el | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/lisp/isearch.el b/lisp/isearch.el index 7ee71b4979d..25d6ad591eb 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el | |||
| @@ -188,11 +188,14 @@ or to the end of the buffer for a backward search.") | |||
| 188 | to the search status stack.") | 188 | to the search status stack.") |
| 189 | 189 | ||
| 190 | (defvar isearch-filter-predicate #'isearch-filter-visible | 190 | (defvar isearch-filter-predicate #'isearch-filter-visible |
| 191 | "Predicate that filters the search hits that would normally be available. | 191 | "Predicate to filter hits of Isearch and replace commands. |
| 192 | Search hits that dissatisfy the predicate are skipped. The function | 192 | Isearch hits that don't satisfy the predicate will be skipped. |
| 193 | has two arguments: the positions of start and end of text matched by | 193 | The value should be a function of two arguments; it will be |
| 194 | the search. If this function returns nil, continue searching without | 194 | called with the the positions of the start and the end of the |
| 195 | stopping at this match. | 195 | text matched by Isearch and replace commands. If this function |
| 196 | returns nil, Isearch and replace commands will continue searching | ||
| 197 | without stopping at resp. replacing this match. | ||
| 198 | |||
| 196 | If you use `add-function' to modify this variable, you can use the | 199 | If you use `add-function' to modify this variable, you can use the |
| 197 | `isearch-message-prefix' advice property to specify the prefix string | 200 | `isearch-message-prefix' advice property to specify the prefix string |
| 198 | displayed in the search message.") | 201 | displayed in the search message.") |
| @@ -3009,10 +3012,13 @@ Optional third argument, if t, means if fail just return nil (no error). | |||
| 3009 | (setq isearch-hidden t))))))) | 3012 | (setq isearch-hidden t))))))) |
| 3010 | 3013 | ||
| 3011 | (defun isearch-filter-visible (beg end) | 3014 | (defun isearch-filter-visible (beg end) |
| 3012 | "Test whether the current search hit is visible at least partially. | 3015 | "Return non-nil if text between BEG and END is deemed visible by Isearch. |
| 3013 | Return non-nil if the text from BEG to END is visible to Isearch as | 3016 | This function is intended to be used as `isearch-filter-predicate'. |
| 3014 | determined by `isearch-range-invisible' unless invisible text can be | 3017 | It returns non-nil if the text between BEG and END is visible to |
| 3015 | searched too when `search-invisible' is t." | 3018 | Isearch, at least partially, as determined by `isearch-range-invisible'. |
| 3019 | If `search-invisible' is t, which allows Isearch matches inside | ||
| 3020 | invisible text, this function will always return non-nil, regardless | ||
| 3021 | of what `isearch-range-invisible' says." | ||
| 3016 | (or (eq search-invisible t) | 3022 | (or (eq search-invisible t) |
| 3017 | (not (isearch-range-invisible beg end)))) | 3023 | (not (isearch-range-invisible beg end)))) |
| 3018 | 3024 | ||