Mercurial > emacs
comparison lisp/international/isearch-x.el @ 29719:bec7534ceb14
(isearch-minibuffer-input-method)
(isearch-minibuffer-input-method-function): These variables
deleted.
(isearch-with-input-method): Don't use the above variables.
(isearch-process-search-multibyte-characters): Likewise. Call
read-string with the arg INHERIT-INPUT-METHOD t.
author | Kenichi Handa <handa@m17n.org> |
---|---|
date | Mon, 19 Jun 2000 00:56:20 +0000 |
parents | 18bfc4113440 |
children | 6d04a7aba075 |
comparison
equal
deleted
inserted
replaced
29718:2cb352360679 | 29719:bec7534ceb14 |
---|---|
54 (define-key map [with-keyboard-coding] 'isearch-with-keyboard-coding) | 54 (define-key map [with-keyboard-coding] 'isearch-with-keyboard-coding) |
55 (define-key map [with-input-method] 'isearch-with-input-method) | 55 (define-key map [with-input-method] 'isearch-with-input-method) |
56 map) | 56 map) |
57 "Keymap to use in minibuffer for multibyte character inputting in isearch.") | 57 "Keymap to use in minibuffer for multibyte character inputting in isearch.") |
58 | 58 |
59 | |
60 ;; These two variables are used to refer to the values of | |
61 ;; `current-input-method' and `input-method-function' of the original | |
62 ;; buffer in the function isearch-with-input-method which runs in a | |
63 ;; minibuffer. | |
64 | |
65 (defvar isearch-minibuffer-input-method nil) | |
66 (defvar isearch-minibuffer-input-method-function nil) | |
67 | |
68 ;; Exit from recursive edit safely. Set in `after-change-functions' | 59 ;; Exit from recursive edit safely. Set in `after-change-functions' |
69 ;; by isearch-with-keyboard-coding. | 60 ;; by isearch-with-keyboard-coding. |
70 (defun isearch-exit-recursive-edit () | 61 (defun isearch-exit-recursive-edit () |
71 (interactive) | 62 (interactive) |
72 (throw 'exit nil)) | 63 (throw 'exit nil)) |
84 ;; Simulate the work of the current input method in the current buffer | 75 ;; Simulate the work of the current input method in the current buffer |
85 ;; (minibuffer). | 76 ;; (minibuffer). |
86 | 77 |
87 (defun isearch-with-input-method () | 78 (defun isearch-with-input-method () |
88 (interactive) | 79 (interactive) |
89 (let* ((current-input-method isearch-minibuffer-input-method) | 80 (let ((events (funcall input-method-function nil))) |
90 (events (funcall isearch-minibuffer-input-method-function nil))) | |
91 ;; EVENTS is a list of events the input method has generated. It | 81 ;; EVENTS is a list of events the input method has generated. It |
92 ;; contains a character event and/or the special event | 82 ;; contains a character event and/or the special event |
93 ;; `compose-last-chars'. We extract only character events and | 83 ;; `compose-last-chars'. We extract only character events and |
94 ;; insert the corresponding characters. | 84 ;; insert the corresponding characters. |
95 (while events | 85 (while events |
104 (prompt (concat (isearch-message-prefix) isearch-message)) | 94 (prompt (concat (isearch-message-prefix) isearch-message)) |
105 (minibuffer-local-map isearch-minibuffer-local-map) | 95 (minibuffer-local-map isearch-minibuffer-local-map) |
106 str) | 96 str) |
107 (if isearch-input-method-function | 97 (if isearch-input-method-function |
108 (let (;; Let input method work rather tersely. | 98 (let (;; Let input method work rather tersely. |
109 (input-method-verbose-flag nil) | 99 (input-method-verbose-flag nil)) |
110 (isearch-minibuffer-input-method current-input-method) | |
111 (isearch-minibuffer-input-method-function | |
112 isearch-input-method-function)) | |
113 (setq unread-command-events | 100 (setq unread-command-events |
114 (cons 'with-input-method | 101 (cons 'with-input-method |
115 (cons last-char unread-command-events)) | 102 (cons last-char unread-command-events)) |
116 str (read-string prompt)) | 103 ;; Inherit current-input-method in a minibuffer. |
104 str (read-string prompt nil nil nil t)) | |
117 (if (not str) | 105 (if (not str) |
118 ;; All inputs were deleted while the input method | 106 ;; All inputs were deleted while the input method |
119 ;; was working. | 107 ;; was working. |
120 (setq str "") | 108 (setq str "") |
121 (if (and (= (length str) 1) | 109 (if (and (= (length str) 1) |
122 (= (aref str 0) last-char)) | 110 (= (aref str 0) last-char) |
111 (>= last-char 128)) | |
123 ;; The input method couldn't handle LAST-CHAR. | 112 ;; The input method couldn't handle LAST-CHAR. |
124 (setq str nil))))) | 113 (setq str nil))))) |
125 | 114 |
126 (if (and (not str) (keyboard-coding-system)) | 115 (if (and (not str) (keyboard-coding-system)) |
127 (setq unread-command-events | 116 (setq unread-command-events |