diff options
| -rw-r--r-- | doc/emacs/search.texi | 33 | ||||
| -rw-r--r-- | lisp/isearch.el | 13 |
2 files changed, 29 insertions, 17 deletions
diff --git a/doc/emacs/search.texi b/doc/emacs/search.texi index 053603e54fc..58a76580d76 100644 --- a/doc/emacs/search.texi +++ b/doc/emacs/search.texi | |||
| @@ -99,10 +99,18 @@ text that matches the search string---using the @code{isearch} face | |||
| 99 | that customize this highlighting. The current search string is also | 99 | that customize this highlighting. The current search string is also |
| 100 | displayed in the echo area. | 100 | displayed in the echo area. |
| 101 | 101 | ||
| 102 | If you make a mistake typing the search string, type @key{DEL}. | 102 | @cindex isearch input item |
| 103 | Each @key{DEL} cancels the last character of the search string. | 103 | @cindex input item, isearch |
| 104 | @xref{Error in Isearch}, for more about dealing with unsuccessful | 104 | @findex isearch-delete-char |
| 105 | search. | 105 | @kindex DEL @r{(Incremental search)} |
| 106 | If you make a mistake typing the search string, type @key{DEL} | ||
| 107 | (@code{isearch-delete-char}). Each @key{DEL} cancels the last input | ||
| 108 | item entered during the search. Emacs records a new @dfn{input item} | ||
| 109 | whenever you type a command that changes the search string, the | ||
| 110 | position of point, the success or failure of the search, the direction | ||
| 111 | of the search, the position of the other end of the current search | ||
| 112 | result, or the ``wrappedness'' of the search. @xref{Error in | ||
| 113 | Isearch}, for more about dealing with unsuccessful search. | ||
| 106 | 114 | ||
| 107 | @cindex exit incremental search | 115 | @cindex exit incremental search |
| 108 | @cindex incremental search, exiting | 116 | @cindex incremental search, exiting |
| @@ -283,14 +291,15 @@ string that failed to match is highlighted using the face | |||
| 283 | @code{isearch-fail}. | 291 | @code{isearch-fail}. |
| 284 | 292 | ||
| 285 | At this point, there are several things you can do. If your string | 293 | At this point, there are several things you can do. If your string |
| 286 | was mistyped, you can use @key{DEL} to erase some of it and correct | 294 | was mistyped, use @key{DEL} to cancel a previous input item |
| 287 | it, or you can type @kbd{M-e} and edit it. If you like the place you | 295 | (@pxref{Basic Isearch}), @kbd{C-M-w} to erase one character at a time, |
| 288 | have found, you can type @key{RET} to remain there. Or you can type | 296 | or @kbd{M-e} to edit it. If you like the place you have found, you |
| 289 | @kbd{C-g}, which removes from the search string the characters that | 297 | can type @key{RET} to remain there. Or you can type @kbd{C-g}, which |
| 290 | could not be found (the @samp{T} in @samp{FOOT}), leaving those that | 298 | removes from the search string the characters that could not be found |
| 291 | were found (the @samp{FOO} in @samp{FOOT}). A second @kbd{C-g} at | 299 | (the @samp{T} in @samp{FOOT}), leaving those that were found (the |
| 292 | that point cancels the search entirely, returning point to where it | 300 | @samp{FOO} in @samp{FOOT}). A second @kbd{C-g} at that point cancels |
| 293 | was when the search started. | 301 | the search entirely, returning point to where it was when the search |
| 302 | started. | ||
| 294 | 303 | ||
| 295 | @cindex quitting (in search) | 304 | @cindex quitting (in search) |
| 296 | @kindex C-g @r{(Incremental search)} | 305 | @kindex C-g @r{(Incremental search)} |
diff --git a/lisp/isearch.el b/lisp/isearch.el index 31571e11cd5..b180e63d8e8 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el | |||
| @@ -1956,11 +1956,14 @@ and reads its face argument using `hi-lock-read-face-name'." | |||
| 1956 | 1956 | ||
| 1957 | 1957 | ||
| 1958 | (defun isearch-delete-char () | 1958 | (defun isearch-delete-char () |
| 1959 | "Discard last input item and move point back. | 1959 | "Undo last input item during a search. |
| 1960 | Last input means the last character or the last isearch command | 1960 | |
| 1961 | that added or deleted characters from the search string, | 1961 | An input item is the result of a command that pushes a new state |
| 1962 | moved point, toggled regexp mode or case-sensitivity, etc. | 1962 | of isearch (as recorded by the `isearch--state' structure) to |
| 1963 | If no previous match was done, just beep." | 1963 | `isearch-cmds'. Info node `(emacs)Basic Isearch' explains when |
| 1964 | Emacs records a new input item. | ||
| 1965 | |||
| 1966 | If no input items have been entered yet, just beep." | ||
| 1964 | (interactive) | 1967 | (interactive) |
| 1965 | (if (null (cdr isearch-cmds)) | 1968 | (if (null (cdr isearch-cmds)) |
| 1966 | (ding) | 1969 | (ding) |