Mercurial > emacs
comparison lisp/international/encoded-kb.el @ 36954:798d1ac75e95
(encoded-kbd-self-insert-ccl): Call ccl-execute-on-string directly so
that CCL program handling multibyte sequence can work correctly.
(encoded-kbd-setup-keymap): Fix the default value of `valid-codes'
property of the coding system.
author | Kenichi Handa <handa@m17n.org> |
---|---|
date | Fri, 23 Mar 2001 10:45:20 +0000 |
parents | 4165d44fcd68 |
children | 416e07ad047e |
comparison
equal
deleted
inserted
replaced
36953:be0d67e983a1 | 36954:798d1ac75e95 |
---|---|
235 (setq unread-command-events (cons char unread-command-events)))) | 235 (setq unread-command-events (cons char unread-command-events)))) |
236 | 236 |
237 (defun encoded-kbd-self-insert-ccl () | 237 (defun encoded-kbd-self-insert-ccl () |
238 (interactive) | 238 (interactive) |
239 (let ((str (char-to-string last-command-char)) | 239 (let ((str (char-to-string last-command-char)) |
240 (coding (keyboard-coding-system))) | 240 (ccl (car (aref (coding-system-spec (keyboard-coding-system)) 4))) |
241 (setq str (decode-coding-string str coding)) | 241 (vec (make-vector 9 nil)) |
242 result) | |
243 (while (= (length (setq result (ccl-execute-on-string ccl vec str t))) 0) | |
244 (setq str (format "%s%c" str (read-char-exclusive)) | |
245 vec (make-vector 9 nil))) | |
242 (setq unread-command-events | 246 (setq unread-command-events |
243 (append (string-to-list str) unread-command-events)))) | 247 (append (string-to-list result) unread-command-events)))) |
244 | 248 |
245 (defun encoded-kbd-setup-keymap (coding) | 249 (defun encoded-kbd-setup-keymap (coding) |
246 ;; At first, reset the keymap. | 250 ;; At first, reset the keymap. |
247 (setcdr encoded-kbd-mode-map nil) | 251 (setcdr encoded-kbd-mode-map nil) |
248 ;; Then setup the keymap according to the keyboard coding system. | 252 ;; Then setup the keymap according to the keyboard coding system. |
275 (vector i) 'encoded-kbd-self-insert-iso2022-8bit) | 279 (vector i) 'encoded-kbd-self-insert-iso2022-8bit) |
276 (setq i (1+ i))))) | 280 (setq i (1+ i))))) |
277 | 281 |
278 ((eq encoded-kbd-coding 'ccl) | 282 ((eq encoded-kbd-coding 'ccl) |
279 (let ((valid-codes (or (coding-system-get coding 'valid-codes) | 283 (let ((valid-codes (or (coding-system-get coding 'valid-codes) |
280 '((128 255)))) | 284 '((128 . 255)))) |
281 elt from to) | 285 elt from to) |
282 (while valid-codes | 286 (while valid-codes |
283 (setq elt (car valid-codes) valid-codes (cdr valid-codes)) | 287 (setq elt (car valid-codes) valid-codes (cdr valid-codes)) |
284 (if (consp elt) | 288 (if (consp elt) |
285 (setq from (car elt) to (cdr elt)) | 289 (setq from (car elt) to (cdr elt)) |