]> git.eshelyaron.com Git - emacs.git/commitdiff
(isearch-toggle-specified-input-method): Adjusted for the change
authorKenichi Handa <handa@m17n.org>
Sun, 19 Jul 1998 05:17:35 +0000 (05:17 +0000)
committerKenichi Handa <handa@m17n.org>
Sun, 19 Jul 1998 05:17:35 +0000 (05:17 +0000)
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.

lisp/international/isearch-x.el

index be842d4f101dc9dba70e8fb90660d13ddedcdda3..9291a5d929d0e9212628e0a0c8f9e55992da3162 100644 (file)
@@ -33,6 +33,9 @@
   (interactive)
   (let ((overriding-terminal-local-map nil))
     (toggle-input-method t))
+  (setq isearch-input-method-function input-method-function
+       isearch-input-method-local-p t)
+  (setq input-method-function nil)
   (isearch-update))
 
 ;;;###autoload
   (interactive)
   (let ((overriding-terminal-local-map nil))
     (toggle-input-method))
+  (setq isearch-input-method-function input-method-function
+       isearch-input-method-local-p t)
+  (setq input-method-function nil)
   (isearch-update))
 
+(defvar isearch-minibuffer-local-map
+  (let ((map (make-keymap)))
+    (define-key map [t] 'isearch-minibuffer-non-self-insert)
+    (let ((i ?\ ))
+      (while (< i 256)
+       (define-key map (vector i) 'isearch-minibuffer-self-insert)
+       (setq i (1+ i))))
+    (let ((l (generic-character-list))
+         (table (nth 1 map)))
+      (while l
+       (set-char-table-default table (car l) 'isearch-minibuffer-self-insert)
+       (setq l (cdr l))))
+    (define-key map "\C-m" 'exit-minibuffer)
+    (define-key map [return] 'exit-minibuffer)
+    map)
+  "Keymap of minibuffer to input multibyte characters while isearching.")
+
+(defun isearch-minibuffer-non-self-insert ()
+  (interactive)
+  (setq unread-command-events (cons last-command-event unread-command-events))
+  (exit-minibuffer))
+
+(defun isearch-minibuffer-self-insert ()
+  (interactive)
+  (setq unread-command-events (cons last-command-event unread-command-events))
+  (let ((continue t)
+       event)
+    (while continue
+      (setq event (car unread-command-events))
+      (if (eq (lookup-key isearch-mode-map (vector event))
+             'isearch-printing-char)
+         (progn
+           (insert event)
+           (setq unread-command-events (cdr unread-command-events)))
+       (setq continue nil))))
+  (or unread-command-events
+      (exit-minibuffer)))
+
 ;;;###autoload
 (defun isearch-process-search-multibyte-characters (last-char)
   (let ((overriding-terminal-local-map nil)
-       ;; Let input method exit when a chunk is inserted.
-       (input-method-after-insert-chunk-hook '(inactivate-input-method))
-       (input-method-inactivate-hook '(exit-minibuffer))
        ;; Let input method work rather tersely.
        (input-method-verbose-flag nil)
-       ;; A key not handled by the current input method should
-       ;; terminate the input method.
-       (input-method-exit-on-invalid-key t)
+       (minibuffer-local-map isearch-minibuffer-local-map)
        str)
-    (setq unread-command-events (cons last-char unread-command-events))
+    (setq unread-input-method-events
+         (cons last-char unread-input-method-events))
     (setq str (read-multilingual-string
               (concat (isearch-message-prefix) isearch-message)
               nil