diff options
| author | Richard M. Stallman | 1992-10-20 21:21:47 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1992-10-20 21:21:47 +0000 |
| commit | ac6895157f7baa57c6550668398a781e4e196521 (patch) | |
| tree | 9088780ccc113c7a2a363ded59719f5fec5b2675 | |
| parent | 8a2816daa69a7d51d3809a67b7fdf38f6bdbfeed (diff) | |
| download | emacs-ac6895157f7baa57c6550668398a781e4e196521.tar.gz emacs-ac6895157f7baa57c6550668398a781e4e196521.zip | |
(isearch-mode-map): Make the top-level keymap dense.
Explicitly bind control characters at that level.
| -rw-r--r-- | lisp/isearch.el | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/lisp/isearch.el b/lisp/isearch.el index 2399603865f..5aabff1ccf9 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el | |||
| @@ -4,7 +4,7 @@ | |||
| 4 | ;; LCD Archive Entry: | 4 | ;; LCD Archive Entry: |
| 5 | ;; isearch-mode|Daniel LaLiberte|liberte@cs.uiuc.edu | 5 | ;; isearch-mode|Daniel LaLiberte|liberte@cs.uiuc.edu |
| 6 | ;; |A minor mode replacement for isearch.el. | 6 | ;; |A minor mode replacement for isearch.el. |
| 7 | ;; |$Date: 1992/09/21 08:28:43 $|$Revision: 1.10 $|~/modes/isearch-mode.el | 7 | ;; |$Date: 1992/10/11 05:25:11 $|$Revision: 1.11 $|~/modes/isearch-mode.el |
| 8 | 8 | ||
| 9 | ;; This file is not yet part of GNU Emacs, but it is based almost | 9 | ;; This file is not yet part of GNU Emacs, but it is based almost |
| 10 | ;; entirely on isearch.el which is part of GNU Emacs. | 10 | ;; entirely on isearch.el which is part of GNU Emacs. |
| @@ -88,8 +88,11 @@ | |||
| 88 | ;;;==================================================================== | 88 | ;;;==================================================================== |
| 89 | ;;; Change History | 89 | ;;; Change History |
| 90 | 90 | ||
| 91 | ;;; $Header: /gd/gnu/emacs/19.0/lisp/RCS/isearch-mode.el,v 1.10 1992/09/21 08:28:43 rms Exp rms $ | 91 | ;;; $Header: /gd/gnu/emacs/19.0/lisp/RCS/isearch-mode.el,v 1.11 1992/10/11 05:25:11 rms Exp rms $ |
| 92 | ;;; $Log: isearch-mode.el,v $ | 92 | ;;; $Log: isearch-mode.el,v $ |
| 93 | ; Revision 1.11 1992/10/11 05:25:11 rms | ||
| 94 | ; (isearch-ring-advance-edit): Delete spurious `)'. | ||
| 95 | ; | ||
| 93 | ; Revision 1.10 1992/09/21 08:28:43 rms | 96 | ; Revision 1.10 1992/09/21 08:28:43 rms |
| 94 | ; entered into RCS | 97 | ; entered into RCS |
| 95 | ; | 98 | ; |
| @@ -222,13 +225,18 @@ Default value, nil, means edit the string instead.") | |||
| 222 | (let* ((i 0) | 225 | (let* ((i 0) |
| 223 | (map (make-keymap))) | 226 | (map (make-keymap))) |
| 224 | 227 | ||
| 228 | ;; Make function keys, etc, exit the search. | ||
| 229 | (define-key map [t] 'isearch-other-control-char) | ||
| 225 | ;; Control chars, by default, end isearch mode transparently. | 230 | ;; Control chars, by default, end isearch mode transparently. |
| 231 | ;; We need these explicit definitions because, in a dense keymap, | ||
| 232 | ;; the binding for t does not affect characters. | ||
| 233 | ;; We use a dense keymap to save space. | ||
| 226 | (while (< i ?\ ) | 234 | (while (< i ?\ ) |
| 227 | (define-key map (make-string 1 i) 'isearch-other-control-char) | 235 | (define-key map (make-string 1 i) 'isearch-other-control-char) |
| 228 | (setq i (1+ i))) | 236 | (setq i (1+ i))) |
| 229 | 237 | ||
| 230 | ;; Printing chars extend the selection by default. | 238 | ;; Printing chars extend the selection by default. |
| 231 | ;; This assumes that all remaining chars are printable. | 239 | (setq i ?\ ) |
| 232 | (while (< i 128) | 240 | (while (< i 128) |
| 233 | (define-key map (make-string 1 i) 'isearch-printing-char) | 241 | (define-key map (make-string 1 i) 'isearch-printing-char) |
| 234 | (setq i (1+ i))) | 242 | (setq i (1+ i))) |
| @@ -274,12 +282,13 @@ Default value, nil, means edit the string instead.") | |||
| 274 | ;; keys as well, one full keymap per char of the prefix key. It | 282 | ;; keys as well, one full keymap per char of the prefix key. It |
| 275 | ;; would be simpler to disable the global keymap, and/or have a | 283 | ;; would be simpler to disable the global keymap, and/or have a |
| 276 | ;; default local key binding for any key not otherwise bound. | 284 | ;; default local key binding for any key not otherwise bound. |
| 277 | (define-key map (char-to-string meta-prefix-char) (make-keymap)) | 285 | (define-key map (char-to-string meta-prefix-char) (make-sparse-keymap)) |
| 278 | (setq i 0) | 286 | (define-key map (vector meta-prefix-char t) 'isearch-other-meta-char) |
| 279 | (while (< i 128) | 287 | ;;; (setq i 0) |
| 280 | (define-key map (char-to-string (+ 128 i));; Needs to be generalized. | 288 | ;;; (while (< i 128) |
| 281 | 'isearch-other-meta-char) | 289 | ;;; (define-key map (char-to-string (+ 128 i));; Needs to be generalized. |
| 282 | (setq i (1+ i))) | 290 | ;;; 'isearch-other-meta-char) |
| 291 | ;;; (setq i (1+ i))) | ||
| 283 | 292 | ||
| 284 | (define-key map "\M-n" 'isearch-ring-advance) | 293 | (define-key map "\M-n" 'isearch-ring-advance) |
| 285 | (define-key map "\M-p" 'isearch-ring-retreat) | 294 | (define-key map "\M-p" 'isearch-ring-retreat) |