(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