diff options
| author | Richard M. Stallman | 1992-09-19 19:21:09 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1992-09-19 19:21:09 +0000 |
| commit | a8f783b2195993d23955968bdff96b739f904b79 (patch) | |
| tree | d1456669240ecbc872351c780b59830e7f26bbad | |
| parent | 785cd37f2bde1eca830825bbfa8129f26cdc0e02 (diff) | |
| download | emacs-a8f783b2195993d23955968bdff96b739f904b79.tar.gz emacs-a8f783b2195993d23955968bdff96b739f904b79.zip | |
*** empty log message ***
| -rw-r--r-- | lisp/isearch.el | 41 |
1 files changed, 15 insertions, 26 deletions
diff --git a/lisp/isearch.el b/lisp/isearch.el index c2383cf1fa8..4b694846e73 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el | |||
| @@ -138,22 +138,8 @@ | |||
| 138 | (defconst isearch-pre-command-hook-exists (boundp 'pre-command-hook)) ;; lemacs | 138 | (defconst isearch-pre-command-hook-exists (boundp 'pre-command-hook)) ;; lemacs |
| 139 | (defconst isearch-event-data-type nil) ;; lemacs | 139 | (defconst isearch-event-data-type nil) ;; lemacs |
| 140 | 140 | ||
| 141 | |||
| 142 | ;;;========================================================================= | ||
| 143 | ;;; The following, defined in loaddefs.el, are still used with isearch-mode. | ||
| 144 | |||
| 145 | (defvar search-last-string "" | ||
| 146 | "Last string search for by a search command. | ||
| 147 | This does not include direct calls to the primitive search functions, | ||
| 148 | and does not include searches that are aborted.") | ||
| 149 | |||
| 150 | (defvar search-last-regexp "" | ||
| 151 | "Last string searched for by a regexp search command. | ||
| 152 | This does not include direct calls to the primitive search functions, | ||
| 153 | and does not include searches that are aborted.") | ||
| 154 | |||
| 155 | (defconst search-exit-option t | 141 | (defconst search-exit-option t |
| 156 | "Non-nil means random control characters terminate incremental search.") | 142 | "*Non-nil means random control characters terminate incremental search.") |
| 157 | 143 | ||
| 158 | (defvar search-slow-window-lines 1 | 144 | (defvar search-slow-window-lines 1 |
| 159 | "*Number of lines in slow search display windows. | 145 | "*Number of lines in slow search display windows. |
| @@ -185,8 +171,11 @@ string, and RET terminates editing and does a nonincremental search.") | |||
| 185 | "*If non-nil, regular expression to match a sequence of whitespace chars. | 171 | "*If non-nil, regular expression to match a sequence of whitespace chars. |
| 186 | You might want to use something like \"[ \\t\\r\\n]+\" instead.") | 172 | You might want to use something like \"[ \\t\\r\\n]+\" instead.") |
| 187 | 173 | ||
| 174 | ;; I removed the * from the doc string because highlighting is not | ||
| 175 | ;; currently a clean thing to do. Once highlighting is made clean, | ||
| 176 | ;; this feature can be re-enabled and advertised. | ||
| 188 | (defvar search-highlight nil | 177 | (defvar search-highlight nil |
| 189 | "*Whether isearch and query-replace should highlight the text which | 178 | "Whether isearch and query-replace should highlight the text which |
| 190 | currently matches the search-string.") | 179 | currently matches the search-string.") |
| 191 | 180 | ||
| 192 | 181 | ||
| @@ -592,16 +581,16 @@ is treated as a regexp. See \\[isearch-forward] for more info." | |||
| 592 | (if (> (length isearch-string) 0) | 581 | (if (> (length isearch-string) 0) |
| 593 | ;; Update the ring data. | 582 | ;; Update the ring data. |
| 594 | (if isearch-regexp | 583 | (if isearch-regexp |
| 595 | (if (and regexp-search-ring | 584 | (if (or (null regexp-search-ring) |
| 596 | (not (string= isearch-string (car regexp-search-ring)))) | 585 | (not (string= isearch-string (car regexp-search-ring)))) |
| 597 | (progn | 586 | (progn |
| 598 | (setq regexp-search-ring | 587 | (setq regexp-search-ring |
| 599 | (cons isearch-string regexp-search-ring)) | 588 | (cons isearch-string regexp-search-ring)) |
| 600 | (if (> (length regexp-search-ring) regexp-search-ring-max) | 589 | (if (> (length regexp-search-ring) regexp-search-ring-max) |
| 601 | (setcdr (nthcdr (1- search-ring-max) regexp-search-ring) | 590 | (setcdr (nthcdr (1- search-ring-max) regexp-search-ring) |
| 602 | nil)))) | 591 | nil)))) |
| 603 | (if (and search-ring | 592 | (if (or (null search-ring) |
| 604 | (not (string= isearch-string (car search-ring)))) | 593 | (not (string= isearch-string (car search-ring)))) |
| 605 | (progn | 594 | (progn |
| 606 | (setq search-ring (cons isearch-string search-ring)) | 595 | (setq search-ring (cons isearch-string search-ring)) |
| 607 | (if (> (length search-ring) search-ring-max) | 596 | (if (> (length search-ring) search-ring-max) |
| @@ -757,12 +746,12 @@ If first char entered is \\[isearch-yank-word], then do word search instead." | |||
| 757 | 746 | ||
| 758 | ;; Empty isearch-string means use default. | 747 | ;; Empty isearch-string means use default. |
| 759 | (if (= 0 (length isearch-string)) | 748 | (if (= 0 (length isearch-string)) |
| 760 | (setq isearch-string (if isearch-regexp search-last-regexp | 749 | (setq isearch-string (car (if isearch-regexp regexp-search-ring |
| 761 | search-last-string)) | 750 | search-ring))) |
| 762 | ;; Set last search string now so it is set even if we fail. | 751 | ;; This used to set the last search string, |
| 763 | (if search-last-regexp | 752 | ;; but I think it is not right to do that here. |
| 764 | (setq search-last-regexp isearch-string) | 753 | ;; Only the string actually used should be saved. |
| 765 | (setq search-last-string isearch-string))) | 754 | ) |
| 766 | 755 | ||
| 767 | ;; Reinvoke the pending search. | 756 | ;; Reinvoke the pending search. |
| 768 | (isearch-push-state) | 757 | (isearch-push-state) |