aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKenichi Handa1997-08-19 10:58:40 +0000
committerKenichi Handa1997-08-19 10:58:40 +0000
commita0d4676ae3eabea8a8af747606494671459528b5 (patch)
tree7dccdbfb89fa913f07fecd77188bec488d7ea203
parentfa7bc762cfc58b6641ab4c442ba4ce6c70dc3de1 (diff)
downloademacs-a0d4676ae3eabea8a8af747606494671459528b5.tar.gz
emacs-a0d4676ae3eabea8a8af747606494671459528b5.zip
(encoded-kbd-mode): Doc-string modified. Make this a
non-interactive function. (encoded-kbd-iso2022-designation): Do not enter recursive edit twice. (encoded-kbd-iso2022-non-ascii-map): Bind 8-bit keys to encoded-kbd-handle-8bit.
-rw-r--r--lisp/international/encoded-kb.el29
1 files changed, 21 insertions, 8 deletions
diff --git a/lisp/international/encoded-kb.el b/lisp/international/encoded-kb.el
index d12f2600b16..e265175f622 100644
--- a/lisp/international/encoded-kb.el
+++ b/lisp/international/encoded-kb.el
@@ -90,6 +90,10 @@
90 (define-key map (char-to-string i) 'encoded-kbd-self-insert-iso2022-7bit) 90 (define-key map (char-to-string i) 'encoded-kbd-self-insert-iso2022-7bit)
91 (setq i (1+ i))) 91 (setq i (1+ i)))
92 (define-key map "\e" 'encoded-kbd-iso2022-esc-prefix) 92 (define-key map "\e" 'encoded-kbd-iso2022-esc-prefix)
93 (setq i 160)
94 (while (< i 256)
95 (define-key map (vector i) 'encoded-kbd-handle-8bit)
96 (setq i (1+ i)))
93 map) 97 map)
94 "Keymap for handling non-ASCII character set in Encoded-kbd mode.") 98 "Keymap for handling non-ASCII character set in Encoded-kbd mode.")
95 99
@@ -118,6 +122,8 @@
118The following key sequence may cause multilingual text insertion." 122The following key sequence may cause multilingual text insertion."
119 (interactive) 123 (interactive)
120 (let ((key-seq (this-command-keys)) 124 (let ((key-seq (this-command-keys))
125 (prev-g0-charset (aref encoded-kbd-iso2022-designations
126 (aref encoded-kbd-iso2022-invocations 0)))
121 intermediate-char final-char 127 intermediate-char final-char
122 reg dimension chars charset) 128 reg dimension chars charset)
123 (if (= (length key-seq) 4) 129 (if (= (length key-seq) 4)
@@ -145,14 +151,18 @@ The following key sequence may cause multilingual text insertion."
145 dimension chars final-char)) 151 dimension chars final-char))
146 152
147 (if (memq (aref encoded-kbd-iso2022-designations 153 (if (memq (aref encoded-kbd-iso2022-designations
148 (aref encoded-kbd-iso2022-invocations 0)) 154 (aref encoded-kbd-iso2022-invocations 0))
149 '(ascii latin-jisx0201)) 155 '(ascii latin-jisx0201))
150 ;; Graphic plane 0 (0x20..0x7f) is for ASCII. We don't have 156 ;; Graphic plane 0 (0x20..0x7f) is for ASCII. We don't have
151 ;; to handle characters in this range specially. 157 ;; to handle characters in this range specially.
152 (throw 'exit nil) 158 (if (not (memq prev-g0-charset '(ascii latin-jisx0201)))
159 ;; We must exit recusive edit now.
160 (throw 'exit nil))
153 ;; Graphic plane 0 is for non-ASCII. 161 ;; Graphic plane 0 is for non-ASCII.
154 (let ((overriding-local-map encoded-kbd-iso2022-non-ascii-map)) 162 (if (memq prev-g0-charset '(ascii latin-jisx0201))
155 (recursive-edit))))) 163 ;; We must handle kyes specially.
164 (let ((overriding-local-map encoded-kbd-iso2022-non-ascii-map))
165 (recursive-edit))))))
156 166
157(defun encoded-kbd-handle-8bit () 167(defun encoded-kbd-handle-8bit ()
158 "Handle an 8-bit character enterned in Encoded-kbd mode." 168 "Handle an 8-bit character enterned in Encoded-kbd mode."
@@ -230,10 +240,13 @@ The following key sequence may cause multilingual text insertion."
230 "Toggle Encoded-kbd minor mode. 240 "Toggle Encoded-kbd minor mode.
231With arg, turn Encoded-kbd mode on if and only if arg is positive. 241With arg, turn Encoded-kbd mode on if and only if arg is positive.
232 242
233When in Encoded-kbd mode, a text sent from keyboard 243You should not turn this mode on manually, instead use the command
234is accepted as a multilingual text encoded in a coding system 244`set-keyboard-coding-system' which turns on or off this mode
235set by the command `set-keyboard-coding-system'." 245automatically.
236 (interactive "P") 246
247In Encoded-kbd mode, a text sent from keyboard is accepted
248as a multilingual text encoded in a coding system set by
249`set-keyboard-coding-system'."
237 (if encoded-kbd-mode 250 (if encoded-kbd-mode
238 ;; We must at first reset input-mode to the original. 251 ;; We must at first reset input-mode to the original.
239 (apply 'set-input-mode saved-input-mode)) 252 (apply 'set-input-mode saved-input-mode))