File: isearch.el.html

Instructions

For programmed use of isearch-mode, e.g. calling isearch-forward(var)/isearch-forward(fun), isearch-mode behaves modally and does not return until the search is completed. It uses a recursive-edit to behave this way.

The key bindings active within isearch-mode are defined below in isearch-mode-map. Also see minibuffer-local-isearch-map for bindings active during isearch-edit-string.

isearch-mode should work even if you switch windows with the mouse, in which case isearch-mode is terminated automatically before the switch.

The search ring and completion commands automatically put you in the minibuffer to edit the string. This gives you a chance to modify the search string before executing the search. There are three commands to terminate the editing: C-s and C-r exit the minibuffer and search forward and reverse respectively, while C-m exits and searches in the last search direction.

Exiting immediately from isearch uses isearch-edit-string instead of nonincremental-search, if search-nonincremental-instead is non-nil. The name of this option should probably be changed if we decide to keep the behavior. No point in forcing nonincremental search until the last possible moment.

Defined variables (69)

isearch-allow-motionWhether to allow movement between isearch matches by cursor motion commands.
isearch-allow-prefixWhether prefix arguments are allowed during incremental search.
isearch-allow-scrollWhether scrolling is allowed during incremental search.
isearch-barrierRecorded minimum/maximal point for the current search.
isearch-cmdsStack of search status elements.
isearch-filter-predicatePredicate to filter hits of Isearch and replace commands.
isearch-fold-quotes-modeNon-nil if Isearch-Fold-Quotes mode is enabled.
isearch-fold-quotes-mode-hookHook run after entering or leaving ‘isearch-fold-quotes-mode’.
isearch-forward-thing-at-pointA list of symbols to try to get the "thing" at point.
isearch-help-mapKeymap for characters following the Help key for Isearch mode.
isearch-hide-immediatelyIf non-nil, re-hide an invisible match right away.
isearch-lax-whitespaceIf non-nil, a space will match a sequence of whitespace chars.
isearch-lazy-countShow match numbers in the search prompt.
isearch-lazy-highlightControls the lazy-highlighting during incremental search.
isearch-menu-bar-commandsList of commands that can open a menu during Isearch.
isearch-menu-bar-mapMenu for ‘isearch-mode’.
isearch-message-functionFunction to call to display the search prompt.
isearch-message-propertiesText properties that are added to the isearch prompt.
isearch-mode-end-hookFunction(s) to call after terminating an incremental search.
isearch-mode-end-hook-quitNon-nil while running ‘isearch-mode-end-hook’ if the user quits the search.
isearch-mode-hookFunction(s) to call after starting up an incremental search.
isearch-mode-mapKeymap for ‘isearch-mode’.
isearch-motion-changes-directionWhether motion commands during incremental search change search direction.
isearch-mouse-commandsList of mouse commands that are allowed during Isearch.
isearch-new-regexp-functionHolds the next ‘isearch-regexp-function’ inside ‘with-isearch-suspended’.
isearch-new-wordHolds the next ‘isearch-regexp-function’ inside ‘with-isearch-suspended’.
isearch-push-state-functionFunction to save a function restoring the mode-specific Isearch state
isearch-regexp-functionRegexp-based search mode for words/symbols.
isearch-regexp-lax-whitespaceIf non-nil, a space will match a sequence of whitespace chars.
isearch-repeat-on-direction-changeWhether a direction change should move to another match.
isearch-resume-in-command-historyIf non-nil, ‘isearch-resume’ commands are added to the command history.
isearch-search-fun-functionNon-default value overrides the behavior of ‘isearch-search-fun-default’.
isearch-text-conversion-styleValue of ‘text-conversion-style’ before Isearch mode
isearch-tool-bar-old-mapVariable holding the old local value of ‘tool-bar-map’, if any.
isearch-update-post-hookFunction(s) to call after isearch has found matches in the buffer.
isearch-wordRegexp-based search mode for words/symbols.
isearch-wrap-functionFunction to call to wrap the search when search is failed.
isearch-wrap-pauseDefine the behavior of wrapping when there are no more matches.
isearch-yank-on-moveMotion keys yank text to the search string while you move the cursor.
lazy-count-invisible-formatFormat of the number of invisible matches for the prompt.
lazy-count-prefix-formatFormat of the current/total number of matches for the prompt prefix.
lazy-count-suffix-formatFormat of the current/total number of matches for the prompt suffix.
lazy-count-update-hookHook run after new lazy count results are computed.
lazy-highlight-bufferControls the lazy-highlighting of the full buffer.
lazy-highlight-buffer-max-at-a-timeMaximum matches to highlight at a time (for ‘lazy-highlight-buffer’).
lazy-highlight-cleanupControls whether to remove extra highlighting after a search.
lazy-highlight-initial-delaySeconds to wait before beginning to lazily highlight all matches.
lazy-highlight-intervalSeconds between lazily highlighting successive matches.
lazy-highlight-max-at-a-timeMaximum matches to highlight at a time (for ‘lazy-highlight’).
lazy-highlight-no-delay-lengthFor search strings at least this long, lazy highlight starts immediately.
minibuffer-lazy-count-formatFormat of the total number of matches for the prompt prefix.
minibuffer-local-isearch-mapKeymap for editing Isearch strings in the minibuffer.
regexp-search-ringList of regular expression search string sequences.
regexp-search-ring-maxMaximum length of regexp search ring before oldest elements are thrown away.
regexp-search-ring-yank-pointerIndex in ‘regexp-search-ring’ of last string reused.
search-default-modeDefault mode to use when starting isearch.
search-exit-optionDefines what control characters do in incremental search.
search-highlightNon-nil means incremental search highlights the current match.
search-highlight-submatchesWhether to highlight regexp subexpressions of the current regexp match.
search-invisibleIf t incremental search/query-replace can match hidden text.
search-nonincremental-insteadIf non-nil, do a nonincremental search instead of exiting immediately.
search-ringList of search string sequences.
search-ring-maxMaximum length of search ring before oldest elements are thrown away.
search-ring-updateNon-nil if advancing or retreating in the search ring should cause search.
search-ring-yank-pointerIndex in ‘search-ring’ of last string reused.
search-slow-speedHighest terminal speed at which to use "slow" style incremental search.
search-slow-window-linesNumber of lines in slow search display windows.
search-upper-caseIf non-nil, upper case chars disable case fold searching.
search-whitespace-regexpIf non-nil, regular expression to match a sequence of whitespace chars.

Defined functions (164)

isearch--describe-regexp-mode(REGEXP-FUNCTION &optional SPACE-BEFORE)
isearch--describe-word-mode(REGEXP-FUNCTION &optional SPACE-BEFORE)
isearch--get-state()
isearch--highlight-regexp-or-lines(HI-LOCK-FUNC)
isearch--lax-regexp-function-p()
isearch--momentary-message(STRING &optional SECONDS)
isearch--set-state(CMD)
isearch--state-barrier(isearch--state-barrier X)
isearch--state-barrier--inliner(INLINE--FORM X)
isearch--state-case-fold-search(isearch--state-case-fold-search X)
isearch--state-case-fold-search--inliner(INLINE--FORM X)
isearch--state-error(isearch--state-error X)
isearch--state-error--inliner(INLINE--FORM X)
isearch--state-forward(isearch--state-forward X)
isearch--state-forward--inliner(INLINE--FORM X)
isearch--state-match-data(isearch--state-match-data X)
isearch--state-match-data--inliner(INLINE--FORM X)
isearch--state-message(isearch--state-message X)
isearch--state-message--inliner(INLINE--FORM X)
isearch--state-other-end(isearch--state-other-end X)
isearch--state-other-end--inliner(INLINE--FORM X)
isearch--state-p(X)
isearch--state-p--inliner(INLINE--FORM X)
isearch--state-point(isearch--state-point X)
isearch--state-point--inliner(INLINE--FORM X)
isearch--state-pop-fun(isearch--state-pop-fun X)
isearch--state-pop-fun--inliner(INLINE--FORM X)
isearch--state-string(isearch--state-string X)
isearch--state-string--inliner(INLINE--FORM X)
isearch--state-success(isearch--state-success X)
isearch--state-success--inliner(INLINE--FORM X)
isearch--state-word(isearch--state-word X)
isearch--state-word--inliner(INLINE--FORM X)
isearch--state-wrapped(isearch--state-wrapped X)
isearch--state-wrapped--inliner(INLINE--FORM X)
isearch--yank-char-or-syntax(SYNTAX-LIST FN &optional ARG)
isearch-abort()
isearch-back-into-window(ABOVE ISEARCH-POINT)
isearch-backslash(STR)
isearch-backward(&optional REGEXP-P NO-RECURSIVE-EDIT)
isearch-backward-regexp(&optional NOT-REGEXP NO-RECURSIVE-EDIT)
isearch-beginning-of-buffer(&optional ARG)
isearch-cancel()
isearch-char-by-name(&optional COUNT)
isearch-clean-overlays()
isearch-close-unnecessary-overlays(BEG END)
isearch-complete()
isearch-complete-edit()
isearch-define-mode-toggle(MODE KEY FUNCTION &optional DOCSTRING &rest BODY)
isearch-del-char(&optional ARG)
isearch-delete-char()
isearch-describe-bindings()
isearch-describe-key()
isearch-describe-mode()
isearch-done(&optional NOPUSH EDIT)
isearch-edit-string()
isearch-emoji-by-name(&optional COUNT)
isearch-end-of-buffer(&optional ARG)
isearch-exit()
isearch-fail-pos(&optional MSG)
isearch-fallback(WANT-BACKSLASH &optional ALLOW-INVALID TO-BARRIER)
isearch-filter-visible(BEG END)
isearch-fold-quotes-mode(&optional ARG)
isearch-forward(&optional REGEXP-P NO-RECURSIVE-EDIT)
isearch-forward-exit-minibuffer()
isearch-forward-regexp(&optional NOT-REGEXP NO-RECURSIVE-EDIT)
isearch-forward-symbol(&optional NOT-SYMBOL NO-RECURSIVE-EDIT)
isearch-forward-symbol-at-point(&optional ARG)
isearch-forward-thing-at-point()
isearch-forward-word(&optional NOT-WORD NO-RECURSIVE-EDIT)
isearch-help-for-help()
isearch-help-for-help-internal()
isearch-highlight(BEG END &optional MATCH-DATA)
isearch-highlight-lines-matching-regexp()
isearch-highlight-regexp()
isearch-intersects-p(START0 END0 START1 END1)
isearch-lazy-count-format(&optional SUFFIX-P)
isearch-lazy-highlight-buffer-update()
isearch-lazy-highlight-match(MB ME)
isearch-lazy-highlight-new-loop(&optional BEG END)
isearch-lazy-highlight-search(STRING BOUND)
isearch-lazy-highlight-start()
isearch-lazy-highlight-update()
isearch-menu-bar-map(ARG1)
isearch-message(&optional C-Q-HACK ELLIPSIS)
isearch-message-prefix(&optional ELLIPSIS NONINCREMENTAL)
isearch-message-suffix(&optional C-Q-HACK)
isearch-mode(FORWARD &optional REGEXP OP-FUN RECURSIVE-EDIT REGEXP-FUNCTION)
isearch-mode-help()
isearch-mouse-2(CLICK)
isearch-mouse-leave-buffer()
isearch-no-upper-case-p(STRING REGEXP-FLAG)
isearch-occur(REGEXP &optional NLINES)
isearch-open-necessary-overlays(OV)
isearch-open-overlay-temporary(OV)
isearch-pre-command-hook()
isearch-printing-char(&optional CHAR COUNT)
isearch-process-search-char(CHAR &optional COUNT)
isearch-process-search-string(STRING MESSAGE)
isearch-query-replace(&optional ARG REGEXP-FLAG)
isearch-query-replace-regexp(&optional ARG)
isearch-quote-char(&optional COUNT)
isearch-range-invisible(BEG END)
isearch-repeat(DIRECTION &optional COUNT)
isearch-repeat-backward(&optional ARG)
isearch-repeat-forward(&optional ARG)
isearch-resume(STRING REGEXP WORD FORWARD MESSAGE CASE-FOLD)
isearch-reverse-exit-minibuffer()
isearch-ring-adjust(ADVANCE)
isearch-ring-adjust1(ADVANCE)
isearch-ring-advance()
isearch-ring-retreat()
isearch-search()
isearch-search-and-update()
isearch-search-fun()
isearch-search-fun-default()
isearch-search-fun-in-noncontiguous-region(SEARCH-FUN BOUNDS)
isearch-search-fun-in-text-property(SEARCH-FUN PROPERTIES)
isearch-search-string(STRING BOUND NOERROR)
isearch-string-out-of-window(ISEARCH-POINT)
isearch-string-propertize(STRING &optional PROPERTIES)
isearch-symbol-regexp(STRING &optional LAX)
isearch-text-char-description(C)
isearch-tmm-menubar()
isearch-toggle-case-fold()
isearch-toggle-char-fold()
isearch-toggle-invisible()
isearch-toggle-lax-whitespace()
isearch-toggle-regexp()
isearch-toggle-symbol()
isearch-toggle-word()
isearch-tool-bar-image(IMAGE-NAME)
isearch-unread(&rest CHAR-OR-EVENTS)
isearch-update()
isearch-update-from-string-properties(STRING)
isearch-update-ring(STRING &optional REGEXP)
isearch-xterm-paste(EVENT)
isearch-yank-char(&optional ARG)
isearch-yank-char-in-minibuffer(&optional ARG)
isearch-yank-from-kill-ring()
isearch-yank-internal(JUMPFORM)
isearch-yank-kill()
isearch-yank-line(&optional ARG)
isearch-yank-pop()
isearch-yank-pop-only(&optional ARG)
isearch-yank-string(STRING)
isearch-yank-symbol-or-char(&optional ARG)
isearch-yank-until-char(CHAR &optional ARG)
isearch-yank-word(&optional ARG)
isearch-yank-word-or-char(&optional ARG)
isearch-yank-x-selection()
lazy-highlight-cleanup(&optional FORCE PROCRASTINATE)
minibuffer-lazy-highlight-setup
re-search-backward-lax-whitespace(REGEXP &optional BOUND NOERROR COUNT)
re-search-forward-lax-whitespace(REGEXP &optional BOUND NOERROR COUNT)
search-backward-lax-whitespace(STRING &optional BOUND NOERROR COUNT)
search-forward-lax-whitespace(STRING &optional BOUND NOERROR COUNT)
search-within-boundaries(SEARCH-FUN GET-FUN NEXT-FUN STRING &optional BOUND NOERROR COUNT)
with-isearch-suspended(&rest BODY)
word-search-backward(STRING &optional BOUND NOERROR COUNT)
word-search-backward-lax(STRING &optional BOUND NOERROR COUNT)
word-search-forward(STRING &optional BOUND NOERROR COUNT)
word-search-forward-lax(STRING &optional BOUND NOERROR COUNT)
word-search-regexp(STRING &optional LAX)

Defined faces (5)

isearchFace for highlighting Isearch matches.
isearch-failFace for highlighting failed part in Isearch echo-area message.
isearch-group-1Face for highlighting Isearch the odd group matches.
isearch-group-2Face for highlighting Isearch the even group matches.
lazy-highlightFace for lazy highlighting of matches other than the current one.