+2013-06-05 Alan Mackenzie <acm@muc.de>
+
+ * search.texi (Isearch Scroll): Rename to "Not Exiting Isearch".
+ (Net Exiting Isearch): Document new user option
+ `isearch-allow-prefix'.
+
2013-06-03 Juri Linkov <juri@jurta.org>
* display.texi (Highlight Interactively): Add global keybindings
Incremental Search
-* Basic Isearch:: Basic incremental search commands.
-* Repeat Isearch:: Searching for the same string again.
-* Error in Isearch:: When your string is not found.
-* Special Isearch:: Special input in incremental search.
-* Isearch Yank:: Commands that grab text into the search string
- or else edit the search string.
-* Isearch Scroll:: Scrolling during an incremental search.
-* Isearch Minibuffer:: Incremental search of the minibuffer history.
+* Basic Isearch:: Basic incremental search commands.
+* Repeat Isearch:: Searching for the same string again.
+* Error in Isearch:: When your string is not found.
+* Special Isearch:: Special input in incremental search.
+* Isearch Yank:: Commands that grab text into the search string
+ or else edit the search string.
+* Not Exiting Isearch:: Prefix argument and scrolling commands.
+* Isearch Minibuffer:: Incremental search of the minibuffer history.
Replacement Commands
@end table
@menu
-* Basic Isearch:: Basic incremental search commands.
-* Repeat Isearch:: Searching for the same string again.
-* Error in Isearch:: When your string is not found.
-* Special Isearch:: Special input in incremental search.
-* Isearch Yank:: Commands that grab text into the search string
- or else edit the search string.
-* Isearch Scroll:: Scrolling during an incremental search.
-* Isearch Minibuffer:: Incremental search of the minibuffer history.
+* Basic Isearch:: Basic incremental search commands.
+* Repeat Isearch:: Searching for the same string again.
+* Error in Isearch:: When your string is not found.
+* Special Isearch:: Special input in incremental search.
+* Isearch Yank:: Commands that grab text into the search string
+ or else edit the search string.
+* Not Exiting Isearch:: Prefix argument and scrolling commands.
+* Isearch Minibuffer:: Incremental search of the minibuffer history.
@end menu
@node Basic Isearch
minibuffer with @kbd{M-e} (@pxref{Repeat Isearch}) and type @kbd{C-f}
at the end of the search string in the minibuffer.
-@node Isearch Scroll
-@subsection Scrolling During Incremental Search
+@node Not Exiting Isearch
+@subsection Not Exiting Incremental Search
+This subsection describes two categories of commands which you can
+type without exiting the current incremental search, even though they
+are not themselves part of incremental search.
+
+@table @asis
+@item Prefix Arguments
+@vindex isearch-allow-prefix
+ In incremental search, when you enter a prefix argument
+(@pxref{Arguments}), by default it will apply either to the next
+action in the search or to the command that exits the search.
+
+ In previous versions of Emacs, entering a prefix argument always
+terminated the search. You can revert to this behavior by setting the
+variable @code{isearch-allow-prefix} to @code{nil}.
+
+ When @code{isearch-allow-scroll} is non-@code{nil} (see below),
+prefix arguments always have the default behavior described above.
+
+@item Scrolling Commands
@vindex isearch-allow-scroll
Normally, scrolling commands exit incremental search. If you change
the variable @code{isearch-allow-scroll} to a non-@code{nil} value,
change point, the buffer contents, the match data, the current buffer,
or the selected window and frame. The command must not itself attempt
an incremental search.
+@end table
@node Isearch Minibuffer
@subsection Searching the Minibuffer
*** `query-replace' skips invisible text when `search-invisible' is nil,
and opens overlays with hidden text when `search-invisible' is `open'.
++++
+*** By default, prefix arguments do not now terminate Isearch mode.
+Set `isearch-allow-prefix' to nil to restore old behavior.
+
** MH-E has been updated to MH-E version 8.5.
See MH-E-NEWS for details.
+2013-06-05 Alan Mackenzie <acm@muc.de>
+
+ * 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.
+
2013-06-05 Stefan Monnier <monnier@iro.umontreal.ca>
* autorevert.el (auto-revert-notify-handler): Use memq.
:type 'boolean
:group 'isearch)
+(defcustom isearch-allow-prefix t
+ "Whether prefix arguments are allowed during incremental search.
+If non-nil, entering a prefix argument will not terminate the
+search. This option is ignored \(presumed t) when
+`isearch-allow-scroll' is set."
+ :type 'boolean
+ :group 'isearch)
+
(defun isearch-string-out-of-window (isearch-point)
"Test whether the search string is currently outside of the window.
Return nil if it's completely visible, or if point is visible,
(setq prefix-arg arg)
(apply 'isearch-unread keylist)
(isearch-edit-string))
- ;; Handle a scrolling function.
- ((and isearch-allow-scroll
- (progn (setq key (isearch-reread-key-sequence-naturally keylist))
- (setq keylist (listify-key-sequence key))
- (setq main-event (aref key 0))
- (setq scroll-command (isearch-lookup-scroll-key key))))
+ ;; Handle a scrolling function or prefix argument.
+ ((progn
+ (setq key (isearch-reread-key-sequence-naturally keylist)
+ keylist (listify-key-sequence key)
+ main-event (aref key 0))
+ (or (and isearch-allow-scroll
+ (setq scroll-command (isearch-lookup-scroll-key key)))
+ (and isearch-allow-prefix
+ (let (overriding-terminal-local-map)
+ (setq scroll-command (key-binding key))
+ (memq scroll-command
+ '(universal-argument
+ negative-argument digit-argument))))))
;; From this point onwards, KEY, KEYLIST and MAIN-EVENT hold a
;; complete key sequence, possibly as modified by function-key-map,
;; not merely the one or two event fragment which invoked