1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2025-01-14 16:50:58 +00:00

(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.
This commit is contained in:
Kenichi Handa 1998-07-19 05:17:35 +00:00
parent f8bfdebc67
commit a2abd6b460

View 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
@ -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