diff options
| author | Alan Mackenzie | 2013-06-05 20:57:09 +0000 |
|---|---|---|
| committer | Alan Mackenzie | 2013-06-05 20:57:09 +0000 |
| commit | 80fa505f891b420e27f56746d41f51aa5b9d7d51 (patch) | |
| tree | dfbe3eb6e1b4f7a54ffce956f4888b30103a9a2e /lisp | |
| parent | 817ebfcfde1a40283c173a87ffbe0c1f5cf7ab3a (diff) | |
| download | emacs-80fa505f891b420e27f56746d41f51aa5b9d7d51.tar.gz emacs-80fa505f891b420e27f56746d41f51aa5b9d7d51.zip | |
* isearch.el (isearch-allow-prefix): New user option.
(isearch-other-meta-char): don't exit isearch when a prefix
argument is typed whilst `isearch-allow-prefix' is non-nil.
* search.texi (Isearch Scroll): Rename to "Not Exiting Isearch".
(Net Exiting Isearch): Document new user option
`isearch-allow-prefix'.
* etc/NEWS. Entry for this change.
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/ChangeLog | 6 | ||||
| -rw-r--r-- | lisp/isearch.el | 27 |
2 files changed, 27 insertions, 6 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 7de7b079570..f40a23a5035 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2013-06-05 Alan Mackenzie <acm@muc.de> | ||
| 2 | |||
| 3 | * isearch.el (isearch-allow-prefix): New user option. | ||
| 4 | (isearch-other-meta-char): don't exit isearch when a prefix | ||
| 5 | argument is typed whilst `isearch-allow-prefix' is non-nil. | ||
| 6 | |||
| 1 | 2013-06-05 Stefan Monnier <monnier@iro.umontreal.ca> | 7 | 2013-06-05 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 8 | ||
| 3 | * autorevert.el (auto-revert-notify-handler): Use memq. | 9 | * autorevert.el (auto-revert-notify-handler): Use memq. |
diff --git a/lisp/isearch.el b/lisp/isearch.el index c49b0d7fc59..e6678d33ea4 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el | |||
| @@ -2152,6 +2152,14 @@ If nil, scrolling commands will first cancel Isearch mode." | |||
| 2152 | :type 'boolean | 2152 | :type 'boolean |
| 2153 | :group 'isearch) | 2153 | :group 'isearch) |
| 2154 | 2154 | ||
| 2155 | (defcustom isearch-allow-prefix t | ||
| 2156 | "Whether prefix arguments are allowed during incremental search. | ||
| 2157 | If non-nil, entering a prefix argument will not terminate the | ||
| 2158 | search. This option is ignored \(presumed t) when | ||
| 2159 | `isearch-allow-scroll' is set." | ||
| 2160 | :type 'boolean | ||
| 2161 | :group 'isearch) | ||
| 2162 | |||
| 2155 | (defun isearch-string-out-of-window (isearch-point) | 2163 | (defun isearch-string-out-of-window (isearch-point) |
| 2156 | "Test whether the search string is currently outside of the window. | 2164 | "Test whether the search string is currently outside of the window. |
| 2157 | Return nil if it's completely visible, or if point is visible, | 2165 | Return nil if it's completely visible, or if point is visible, |
| @@ -2304,12 +2312,19 @@ Isearch mode." | |||
| 2304 | (setq prefix-arg arg) | 2312 | (setq prefix-arg arg) |
| 2305 | (apply 'isearch-unread keylist) | 2313 | (apply 'isearch-unread keylist) |
| 2306 | (isearch-edit-string)) | 2314 | (isearch-edit-string)) |
| 2307 | ;; Handle a scrolling function. | 2315 | ;; Handle a scrolling function or prefix argument. |
| 2308 | ((and isearch-allow-scroll | 2316 | ((progn |
| 2309 | (progn (setq key (isearch-reread-key-sequence-naturally keylist)) | 2317 | (setq key (isearch-reread-key-sequence-naturally keylist) |
| 2310 | (setq keylist (listify-key-sequence key)) | 2318 | keylist (listify-key-sequence key) |
| 2311 | (setq main-event (aref key 0)) | 2319 | main-event (aref key 0)) |
| 2312 | (setq scroll-command (isearch-lookup-scroll-key key)))) | 2320 | (or (and isearch-allow-scroll |
| 2321 | (setq scroll-command (isearch-lookup-scroll-key key))) | ||
| 2322 | (and isearch-allow-prefix | ||
| 2323 | (let (overriding-terminal-local-map) | ||
| 2324 | (setq scroll-command (key-binding key)) | ||
| 2325 | (memq scroll-command | ||
| 2326 | '(universal-argument | ||
| 2327 | negative-argument digit-argument)))))) | ||
| 2313 | ;; From this point onwards, KEY, KEYLIST and MAIN-EVENT hold a | 2328 | ;; From this point onwards, KEY, KEYLIST and MAIN-EVENT hold a |
| 2314 | ;; complete key sequence, possibly as modified by function-key-map, | 2329 | ;; complete key sequence, possibly as modified by function-key-map, |
| 2315 | ;; not merely the one or two event fragment which invoked | 2330 | ;; not merely the one or two event fragment which invoked |