diff options
| author | Richard M. Stallman | 1992-09-14 22:50:18 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1992-09-14 22:50:18 +0000 |
| commit | fdf5afa45ddd7c07b5948ebc905f16dd92aeb1c1 (patch) | |
| tree | 13543410c842ed1a01e900c0e4bb6584dba19b50 | |
| parent | 082005103aea5d73c38eb73fe510c184987c6ea0 (diff) | |
| download | emacs-fdf5afa45ddd7c07b5948ebc905f16dd92aeb1c1.tar.gz emacs-fdf5afa45ddd7c07b5948ebc905f16dd92aeb1c1.zip | |
*** empty log message ***
| -rw-r--r-- | lisp/isearch.el | 67 |
1 files changed, 37 insertions, 30 deletions
diff --git a/lisp/isearch.el b/lisp/isearch.el index 8542cd9beb8..6086684c5a2 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el | |||
| @@ -142,36 +142,39 @@ | |||
| 142 | ;;;========================================================================= | 142 | ;;;========================================================================= |
| 143 | ;;; The following, defined in loaddefs.el, are still used with isearch-mode. | 143 | ;;; The following, defined in loaddefs.el, are still used with isearch-mode. |
| 144 | 144 | ||
| 145 | ;(defvar search-last-string "" | 145 | (defvar search-last-string "" |
| 146 | ; "Last string search for by a search command. | 146 | "Last string search for by a search command. |
| 147 | ;This does not include direct calls to the primitive search functions, | 147 | This does not include direct calls to the primitive search functions, |
| 148 | ;and does not include searches that are aborted.") | 148 | and does not include searches that are aborted.") |
| 149 | 149 | ||
| 150 | ;(defvar search-last-regexp "" | 150 | (defvar search-last-regexp "" |
| 151 | ; "Last string searched for by a regexp search command. | 151 | "Last string searched for by a regexp search command. |
| 152 | ;This does not include direct calls to the primitive search functions, | 152 | This does not include direct calls to the primitive search functions, |
| 153 | ;and does not include searches that are aborted.") | 153 | and does not include searches that are aborted.") |
| 154 | 154 | ||
| 155 | ;(defconst search-exit-option t | 155 | (defconst search-exit-option t |
| 156 | ; "Non-nil means random control characters terminate incremental search.") | 156 | "Non-nil means random control characters terminate incremental search.") |
| 157 | 157 | ||
| 158 | ;(defvar search-slow-window-lines 1 | 158 | (defvar search-slow-window-lines 1 |
| 159 | ; "*Number of lines in slow search display windows.") | 159 | "*Number of lines in slow search display windows. |
| 160 | 160 | These are the short windows used during incremental search on slow terminals. | |
| 161 | ;(defconst search-slow-speed 1200 | 161 | Negative means put the slow search window at the top (normally it's at bottom) |
| 162 | ; "*Highest terminal speed at which to use \"slow\" style incremental search. | 162 | and the value is minus the number of lines.") |
| 163 | ;This is the style where a one-line window is created to show the line | 163 | |
| 164 | ;that the search has reached.") | 164 | (defvar search-slow-speed 1200 |
| 165 | "*Highest terminal speed at which to use \"slow\" style incremental search. | ||
| 166 | This is the style where a one-line window is created to show the line | ||
| 167 | that the search has reached.") | ||
| 165 | 168 | ||
| 166 | ;;;======================================================================== | 169 | ;;;======================================================================== |
| 167 | ;;; Some additional options and constants. | 170 | ;;; Some additional options and constants. |
| 168 | 171 | ||
| 169 | (defvar search-caps-disable-folding t | 172 | (defvar search-upper-case t |
| 170 | "*If non-nil, upper case chars disable case fold searching. | 173 | "*If non-nil, upper case chars disable case fold searching. |
| 171 | That is, upper and lower case chars must match exactly. | 174 | That is, upper and lower case chars must match exactly. |
| 172 | This applies no matter where the chars come from, but does not | 175 | This applies no matter where the chars come from, but does not |
| 173 | apply to chars prefixed with \\, for regexps. | 176 | apply to chars in regexps that are prefixed with `\\'. |
| 174 | If this value is 'not-yanks, yanked text is always downcased.") | 177 | If this value is `not-yanks', yanked text is always downcased.") |
| 175 | 178 | ||
| 176 | (defvar search-nonincremental-instead t | 179 | (defvar search-nonincremental-instead t |
| 177 | "*If non-nil, do a nonincremental search instead if exiting immediately. | 180 | "*If non-nil, do a nonincremental search instead if exiting immediately. |
| @@ -224,8 +227,7 @@ Default value, nil, means edit the string instead.") | |||
| 224 | 227 | ||
| 225 | (or isearch-mode-map | 228 | (or isearch-mode-map |
| 226 | (let* ((i 0) | 229 | (let* ((i 0) |
| 227 | (map (make-keymap)) | 230 | (map (make-keymap))) |
| 228 | (len (length map))) | ||
| 229 | 231 | ||
| 230 | ;; Control chars, by default, end isearch mode transparently. | 232 | ;; Control chars, by default, end isearch mode transparently. |
| 231 | (while (< i ?\ ) | 233 | (while (< i ?\ ) |
| @@ -234,7 +236,7 @@ Default value, nil, means edit the string instead.") | |||
| 234 | 236 | ||
| 235 | ;; Printing chars extend the selection by default. | 237 | ;; Printing chars extend the selection by default. |
| 236 | ;; This assumes that all remaining chars are printable. | 238 | ;; This assumes that all remaining chars are printable. |
| 237 | (while (< i len) | 239 | (while (< i 128) |
| 238 | (define-key map (make-string 1 i) 'isearch-printing-char) | 240 | (define-key map (make-string 1 i) 'isearch-printing-char) |
| 239 | (setq i (1+ i))) | 241 | (setq i (1+ i))) |
| 240 | 242 | ||
| @@ -281,8 +283,8 @@ Default value, nil, means edit the string instead.") | |||
| 281 | ;; default local key binding for any key not otherwise bound. | 283 | ;; default local key binding for any key not otherwise bound. |
| 282 | (define-key map (char-to-string meta-prefix-char) (make-keymap)) | 284 | (define-key map (char-to-string meta-prefix-char) (make-keymap)) |
| 283 | (setq i 0) | 285 | (setq i 0) |
| 284 | (while (< i len) | 286 | (while (< i 128) |
| 285 | (define-key map (char-to-string (+ 128 i)) ;; Needs to be generalized. | 287 | (define-key map (char-to-string (+ 128 i));; Needs to be generalized. |
| 286 | 'isearch-other-meta-char) | 288 | 'isearch-other-meta-char) |
| 287 | (setq i (1+ i))) | 289 | (setq i (1+ i))) |
| 288 | 290 | ||
| @@ -376,6 +378,11 @@ Default value, nil, means edit the string instead.") | |||
| 376 | (defvar isearch-mode nil) ;; Name of the minor mode, if non-nil. | 378 | (defvar isearch-mode nil) ;; Name of the minor mode, if non-nil. |
| 377 | (make-variable-buffer-local 'isearch-mode) | 379 | (make-variable-buffer-local 'isearch-mode) |
| 378 | 380 | ||
| 381 | (define-key global-map "\C-s" 'isearch-forward) | ||
| 382 | (define-key esc-map "\C-s" 'isearch-forward-regexp) | ||
| 383 | (define-key global-map "\C-r" 'isearch-backward) | ||
| 384 | (define-key esc-map "\C-r" 'isearch-backward-regexp) | ||
| 385 | |||
| 379 | ;;;=============================================================== | 386 | ;;;=============================================================== |
| 380 | ;;; Entry points to isearch-mode. | 387 | ;;; Entry points to isearch-mode. |
| 381 | ;;; These four functions should replace those in loaddefs.el | 388 | ;;; These four functions should replace those in loaddefs.el |
| @@ -875,7 +882,7 @@ If no previous match was done, just beep." | |||
| 875 | (point)))))) | 882 | (point)))))) |
| 876 | ;; Downcase the string if not supposed to case-fold yanked strings. | 883 | ;; Downcase the string if not supposed to case-fold yanked strings. |
| 877 | (if (and isearch-case-fold-search | 884 | (if (and isearch-case-fold-search |
| 878 | (eq 'not-yanks search-caps-disable-folding)) | 885 | (eq 'not-yanks search-upper-case)) |
| 879 | (setq string (downcase string))) | 886 | (setq string (downcase string))) |
| 880 | (if isearch-regexp (setq string (regexp-quote string))) | 887 | (if isearch-regexp (setq string (regexp-quote string))) |
| 881 | (setq isearch-string (concat isearch-string string) | 888 | (setq isearch-string (concat isearch-string string) |
| @@ -1247,7 +1254,7 @@ If there is no completion possible, say so and continue searching." | |||
| 1247 | (defun isearch-search () | 1254 | (defun isearch-search () |
| 1248 | ;; Do the search with the current search string. | 1255 | ;; Do the search with the current search string. |
| 1249 | (isearch-message nil t) | 1256 | (isearch-message nil t) |
| 1250 | (if search-caps-disable-folding | 1257 | (if search-upper-case |
| 1251 | (setq isearch-case-fold-search (isearch-no-upper-case-p isearch-string))) | 1258 | (setq isearch-case-fold-search (isearch-no-upper-case-p isearch-string))) |
| 1252 | (condition-case lossage | 1259 | (condition-case lossage |
| 1253 | (let ((inhibit-quit nil) | 1260 | (let ((inhibit-quit nil) |