From: Kenichi Handa Date: Sun, 19 Jul 1998 05:17:35 +0000 (+0000) Subject: (isearch-toggle-specified-input-method): Adjusted for the change X-Git-Tag: emacs-20.3~299 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=a2abd6b460a6c8c36c6e61fac099778b73ce3559;p=emacs.git (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. --- 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 @@ (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 @@ -41,21 +44,58 @@ (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