diff options
| author | Juri Linkov | 2008-07-31 16:51:09 +0000 |
|---|---|---|
| committer | Juri Linkov | 2008-07-31 16:51:09 +0000 |
| commit | c16e87ee53126a120456da8216872413f552c8d3 (patch) | |
| tree | d19df8bcdf25fac953fcbb6e8266b8c79c61f011 | |
| parent | f1056735c790bcb73876916d9666b6044888e604 (diff) | |
| download | emacs-c16e87ee53126a120456da8216872413f552c8d3.tar.gz emacs-c16e87ee53126a120456da8216872413f552c8d3.zip | |
(isearch-edit-string-set-word): New command.
(minibuffer-local-isearch-map): Bind "\C-w" to
isearch-edit-string-set-word.
(isearch-new-word): Temporary internal variable.
(isearch-edit-string): Remove special case of reading the
first character and checking it for C-w.
| -rw-r--r-- | lisp/isearch.el | 34 |
1 files changed, 12 insertions, 22 deletions
diff --git a/lisp/isearch.el b/lisp/isearch.el index a8020c17acd..944ea9b7ed6 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el | |||
| @@ -509,6 +509,7 @@ This is like `describe-bindings', but displays only isearch keys." | |||
| 509 | (define-key map "\M-\t" 'isearch-complete-edit) | 509 | (define-key map "\M-\t" 'isearch-complete-edit) |
| 510 | (define-key map "\C-s" 'isearch-forward-exit-minibuffer) | 510 | (define-key map "\C-s" 'isearch-forward-exit-minibuffer) |
| 511 | (define-key map "\C-r" 'isearch-reverse-exit-minibuffer) | 511 | (define-key map "\C-r" 'isearch-reverse-exit-minibuffer) |
| 512 | (define-key map "\C-w" 'isearch-edit-string-set-word) | ||
| 512 | (define-key map "\C-f" 'isearch-yank-char-in-minibuffer) | 513 | (define-key map "\C-f" 'isearch-yank-char-in-minibuffer) |
| 513 | (define-key map [right] 'isearch-yank-char-in-minibuffer) | 514 | (define-key map [right] 'isearch-yank-char-in-minibuffer) |
| 514 | map) | 515 | map) |
| @@ -1111,31 +1112,11 @@ If first char entered is \\[isearch-yank-word-or-char], then do word search inst | |||
| 1111 | ;; that can change their values. | 1112 | ;; that can change their values. |
| 1112 | (setq old-point (point) old-other-end isearch-other-end) | 1113 | (setq old-point (point) old-other-end isearch-other-end) |
| 1113 | 1114 | ||
| 1114 | (isearch-message) ;; for read-char | ||
| 1115 | (unwind-protect | 1115 | (unwind-protect |
| 1116 | (let* (;; Why does following read-char echo? | 1116 | (let* ((message-log-max nil) |
| 1117 | ;;(echo-keystrokes 0) ;; not needed with above message | ||
| 1118 | (e (let ((cursor-in-echo-area t)) | ||
| 1119 | (read-event))) | ||
| 1120 | ;; Binding minibuffer-history-symbol to nil is a work-around | 1117 | ;; Binding minibuffer-history-symbol to nil is a work-around |
| 1121 | ;; for some incompatibility with gmhist. | 1118 | ;; for some incompatibility with gmhist. |
| 1122 | (minibuffer-history-symbol) | 1119 | (minibuffer-history-symbol)) |
| 1123 | (message-log-max nil)) | ||
| 1124 | ;; If the first character the user types when we prompt them | ||
| 1125 | ;; for a string is the yank-word character, then go into | ||
| 1126 | ;; word-search mode. Otherwise unread that character and | ||
| 1127 | ;; read a key the normal way. | ||
| 1128 | ;; Word search does not apply (yet) to regexp searches, | ||
| 1129 | ;; no check is made here. | ||
| 1130 | (message "%s" (isearch-message-prefix nil nil t)) | ||
| 1131 | (if (memq (lookup-key isearch-mode-map (vector e)) | ||
| 1132 | '(isearch-yank-word | ||
| 1133 | isearch-yank-word-or-char)) | ||
| 1134 | (setq isearch-word t;; so message-prefix is right | ||
| 1135 | isearch-new-word t) | ||
| 1136 | (cancel-kbd-macro-events) | ||
| 1137 | (isearch-unread e)) | ||
| 1138 | (setq cursor-in-echo-area nil) | ||
| 1139 | (setq isearch-new-string | 1120 | (setq isearch-new-string |
| 1140 | (read-from-minibuffer | 1121 | (read-from-minibuffer |
| 1141 | (isearch-message-prefix nil nil isearch-nonincremental) | 1122 | (isearch-message-prefix nil nil isearch-nonincremental) |
| @@ -1209,6 +1190,15 @@ If first char entered is \\[isearch-yank-word-or-char], then do word search inst | |||
| 1209 | (isearch-abort) ;; outside of let to restore outside global values | 1190 | (isearch-abort) ;; outside of let to restore outside global values |
| 1210 | ))) | 1191 | ))) |
| 1211 | 1192 | ||
| 1193 | ;; Obsolete usage of `C-s M-e C-w'. Remove after 23.1. | ||
| 1194 | (defvar isearch-new-word) | ||
| 1195 | (defun isearch-edit-string-set-word () | ||
| 1196 | "Do word search after exiting `isearch-edit-string'." | ||
| 1197 | (interactive) | ||
| 1198 | (message "This feature is obsolete since 23.1; use `M-s w' instead.") | ||
| 1199 | (setq isearch-word t isearch-new-word t)) | ||
| 1200 | |||
| 1201 | |||
| 1212 | (defun isearch-nonincremental-exit-minibuffer () | 1202 | (defun isearch-nonincremental-exit-minibuffer () |
| 1213 | (interactive) | 1203 | (interactive) |
| 1214 | (setq isearch-nonincremental t) | 1204 | (setq isearch-nonincremental t) |