diff options
| author | Kenichi Handa | 1998-07-19 05:17:35 +0000 |
|---|---|---|
| committer | Kenichi Handa | 1998-07-19 05:17:35 +0000 |
| commit | a2abd6b460a6c8c36c6e61fac099778b73ce3559 (patch) | |
| tree | c6fe207c9f62c9d9b3fc8d08058898bbcce35d7a | |
| parent | f8bfdebc67de718d8813f519657efc93a95e56c5 (diff) | |
| download | emacs-a2abd6b460a6c8c36c6e61fac099778b73ce3559.tar.gz emacs-a2abd6b460a6c8c36c6e61fac099778b73ce3559.zip | |
(isearch-toggle-specified-input-method): Adjusted for the change
in isearch.el.
(isearch-toggle-input-method): Likewise.
(isearch-minibuffer-local-map): New variable.
(isearch-minibuffer-non-self-insert): New function.
(isearch-minibuffer-self-insert): New function.
(isearch-process-search-multibyte-characters): Read multibyte
characters from minibuffer with the keymap
isearch-minibuffer-local-map.
| -rw-r--r-- | lisp/international/isearch-x.el | 54 |
1 files changed, 47 insertions, 7 deletions
diff --git a/lisp/international/isearch-x.el b/lisp/international/isearch-x.el index be842d4f101..9291a5d929d 100644 --- a/lisp/international/isearch-x.el +++ b/lisp/international/isearch-x.el | |||
| @@ -33,6 +33,9 @@ | |||
| 33 | (interactive) | 33 | (interactive) |
| 34 | (let ((overriding-terminal-local-map nil)) | 34 | (let ((overriding-terminal-local-map nil)) |
| 35 | (toggle-input-method t)) | 35 | (toggle-input-method t)) |
| 36 | (setq isearch-input-method-function input-method-function | ||
| 37 | isearch-input-method-local-p t) | ||
| 38 | (setq input-method-function nil) | ||
| 36 | (isearch-update)) | 39 | (isearch-update)) |
| 37 | 40 | ||
| 38 | ;;;###autoload | 41 | ;;;###autoload |
| @@ -41,21 +44,58 @@ | |||
| 41 | (interactive) | 44 | (interactive) |
| 42 | (let ((overriding-terminal-local-map nil)) | 45 | (let ((overriding-terminal-local-map nil)) |
| 43 | (toggle-input-method)) | 46 | (toggle-input-method)) |
| 47 | (setq isearch-input-method-function input-method-function | ||
| 48 | isearch-input-method-local-p t) | ||
| 49 | (setq input-method-function nil) | ||
| 44 | (isearch-update)) | 50 | (isearch-update)) |
| 45 | 51 | ||
| 52 | (defvar isearch-minibuffer-local-map | ||
| 53 | (let ((map (make-keymap))) | ||
| 54 | (define-key map [t] 'isearch-minibuffer-non-self-insert) | ||
| 55 | (let ((i ?\ )) | ||
| 56 | (while (< i 256) | ||
| 57 | (define-key map (vector i) 'isearch-minibuffer-self-insert) | ||
| 58 | (setq i (1+ i)))) | ||
| 59 | (let ((l (generic-character-list)) | ||
| 60 | (table (nth 1 map))) | ||
| 61 | (while l | ||
| 62 | (set-char-table-default table (car l) 'isearch-minibuffer-self-insert) | ||
| 63 | (setq l (cdr l)))) | ||
| 64 | (define-key map "\C-m" 'exit-minibuffer) | ||
| 65 | (define-key map [return] 'exit-minibuffer) | ||
| 66 | map) | ||
| 67 | "Keymap of minibuffer to input multibyte characters while isearching.") | ||
| 68 | |||
| 69 | (defun isearch-minibuffer-non-self-insert () | ||
| 70 | (interactive) | ||
| 71 | (setq unread-command-events (cons last-command-event unread-command-events)) | ||
| 72 | (exit-minibuffer)) | ||
| 73 | |||
| 74 | (defun isearch-minibuffer-self-insert () | ||
| 75 | (interactive) | ||
| 76 | (setq unread-command-events (cons last-command-event unread-command-events)) | ||
| 77 | (let ((continue t) | ||
| 78 | event) | ||
| 79 | (while continue | ||
| 80 | (setq event (car unread-command-events)) | ||
| 81 | (if (eq (lookup-key isearch-mode-map (vector event)) | ||
| 82 | 'isearch-printing-char) | ||
| 83 | (progn | ||
| 84 | (insert event) | ||
| 85 | (setq unread-command-events (cdr unread-command-events))) | ||
| 86 | (setq continue nil)))) | ||
| 87 | (or unread-command-events | ||
| 88 | (exit-minibuffer))) | ||
| 89 | |||
| 46 | ;;;###autoload | 90 | ;;;###autoload |
| 47 | (defun isearch-process-search-multibyte-characters (last-char) | 91 | (defun isearch-process-search-multibyte-characters (last-char) |
| 48 | (let ((overriding-terminal-local-map nil) | 92 | (let ((overriding-terminal-local-map nil) |
| 49 | ;; Let input method exit when a chunk is inserted. | ||
| 50 | (input-method-after-insert-chunk-hook '(inactivate-input-method)) | ||
| 51 | (input-method-inactivate-hook '(exit-minibuffer)) | ||
| 52 | ;; Let input method work rather tersely. | 93 | ;; Let input method work rather tersely. |
| 53 | (input-method-verbose-flag nil) | 94 | (input-method-verbose-flag nil) |
| 54 | ;; A key not handled by the current input method should | 95 | (minibuffer-local-map isearch-minibuffer-local-map) |
| 55 | ;; terminate the input method. | ||
| 56 | (input-method-exit-on-invalid-key t) | ||
| 57 | str) | 96 | str) |
| 58 | (setq unread-command-events (cons last-char unread-command-events)) | 97 | (setq unread-input-method-events |
| 98 | (cons last-char unread-input-method-events)) | ||
| 59 | (setq str (read-multilingual-string | 99 | (setq str (read-multilingual-string |
| 60 | (concat (isearch-message-prefix) isearch-message) | 100 | (concat (isearch-message-prefix) isearch-message) |
| 61 | nil | 101 | nil |