comparison lisp/international/encoded-kb.el @ 88488:a64bb690ca28

Log for previous change: (encoded-kbd-self-insert-ccl): Fix getting decoder. (encoded-kbd-mode): Fix code for coding system type and designations.
author Dave Love <fx@gnu.org>
date Mon, 13 May 2002 18:27:28 +0000
parents 78fb6b11f118
children 410ca4f1df02
comparison
equal deleted inserted replaced
88487:78fb6b11f118 88488:a64bb690ca28
1 ;;; encoded-kb.el --- handler to input multibyte characters encoded somehow 1 ;;; encoded-kb.el --- handler to input multibyte characters encoded somehow
2 2
3 ;; Copyright (C) 1995 Electrotechnical Laboratory, JAPAN. 3 ;; Copyright (C) 1995 Electrotechnical Laboratory, JAPAN.
4 ;; Licensed to the Free Software Foundation. 4 ;; Licensed to the Free Software Foundation.
5 ;; Copyright (C) 2002 Free Software Foundation, Inc.
5 6
6 ;; This file is part of GNU Emacs. 7 ;; This file is part of GNU Emacs.
7 8
8 ;; GNU Emacs is free software; you can redistribute it and/or modify 9 ;; GNU Emacs is free software; you can redistribute it and/or modify
9 ;; it under the terms of the GNU General Public License as published by 10 ;; it under the terms of the GNU General Public License as published by
305 (if saved-input-mode (apply 'set-input-mode saved-input-mode)) 306 (if saved-input-mode (apply 'set-input-mode saved-input-mode))
306 (if encoded-kbd-mode 307 (if encoded-kbd-mode
307 (let ((coding (keyboard-coding-system))) 308 (let ((coding (keyboard-coding-system)))
308 (setq saved-input-mode (current-input-mode)) 309 (setq saved-input-mode (current-input-mode))
309 (cond ((null coding) 310 (cond ((null coding)
310 (setq encoded-kbd-mode nil) 311 (setq encoded-kbd-mode nil)
311 (error "No coding system for keyboard input is set")) 312 (error "No coding system for keyboard input is set"))
312 313
313 ((eq (coding-system-type coding) 'sjis) 314 ((eq (coding-system-type coding) 'sjis)
314 (set-input-mode 315 (set-input-mode
315 (nth 0 saved-input-mode) (nth 1 saved-input-mode) 316 (nth 0 saved-input-mode) (nth 1 saved-input-mode)
316 'use-8th-bit (nth 3 saved-input-mode)) 317 'use-8th-bit (nth 3 saved-input-mode))
317 (setq encoded-kbd-coding 'sjis)) 318 (setq encoded-kbd-coding 'sjis))
318 319
319 ((eq (coding-system-type coding) 'iso-2022) 320 ((eq (coding-system-type coding) 'iso-2022)
320 (if (memq '7-bit (coding-system-get coding :flags)) 321 (if (memq '7-bit (coding-system-get coding :flags))
321 (setq encoded-kbd-coding 'iso2022-7) 322 (setq encoded-kbd-coding 'iso2022-7)
322 (set-input-mode 323 (set-input-mode
323 (nth 0 saved-input-mode) (nth 1 saved-input-mode) 324 (nth 0 saved-input-mode) (nth 1 saved-input-mode)
324 'use-8th-bit (nth 3 saved-input-mode)) 325 'use-8th-bit (nth 3 saved-input-mode))
325 (setq encoded-kbd-coding 'iso2022-8)) 326 (setq encoded-kbd-coding 'iso2022-8))
326 (setq encoded-kbd-iso2022-designations 327 (setq encoded-kbd-iso2022-designations
327 (coding-system-get coding :designation)) 328 (coding-system-get coding :designation))
328 (setq encoded-kbd-iso2022-invocations (make-vector 3 nil)) 329 (setq encoded-kbd-iso2022-invocations (make-vector 3 nil))
329 (aset encoded-kbd-iso2022-invocations 0 0) 330 (aset encoded-kbd-iso2022-invocations 0 0)
330 (aset encoded-kbd-iso2022-invocations 1 1)) 331 (aset encoded-kbd-iso2022-invocations 1 1))
331 332
332 ((eq (coding-system-type coding) 'big5) 333 ((eq (coding-system-type coding) 'big5)
333 (set-input-mode 334 (set-input-mode
334 (nth 0 saved-input-mode) (nth 1 saved-input-mode) 335 (nth 0 saved-input-mode) (nth 1 saved-input-mode)
335 'use-8th-bit (nth 3 saved-input-mode)) 336 'use-8th-bit (nth 3 saved-input-mode))
336 (setq encoded-kbd-coding 'big5)) 337 (setq encoded-kbd-coding 'big5))
337 338
338 ((eq (coding-system-type coding) 'ccl) 339 ((eq (coding-system-type coding) 'ccl)
339 (set-input-mode 340 (set-input-mode
340 (nth 0 saved-input-mode) (nth 1 saved-input-mode) 341 (nth 0 saved-input-mode) (nth 1 saved-input-mode)
341 'use-8th-bit (nth 3 saved-input-mode)) 342 'use-8th-bit (nth 3 saved-input-mode))
342 (setq encoded-kbd-coding 'ccl)) 343 (setq encoded-kbd-coding 'ccl))
343 344
344 (t 345 (t
345 (setq encoded-kbd-mode nil) 346 (setq encoded-kbd-mode nil)
346 (error "Coding-system `%s' is not supported in Encoded-kbd mode" 347 (error "Coding-system `%s' is not supported in Encoded-kbd mode"