comparison lisp/international/ucs-tables.el @ 46598:6262acd6c7ac

(ucs-quail-activate): Cope if buffer-file-coding-system is nil.
author Richard M. Stallman <rms@gnu.org>
date Sun, 21 Jul 2002 20:24:38 +0000
parents a7f933a7b003
children 18dd2c15c04c
comparison
equal deleted inserted replaced
46597:ea15c9ca1d86 46598:6262acd6c7ac
2472 ;; Arrange to set up the translation table for Quail. This probably 2472 ;; Arrange to set up the translation table for Quail. This probably
2473 ;; isn't foolproof. 2473 ;; isn't foolproof.
2474 (defun ucs-quail-activate () 2474 (defun ucs-quail-activate ()
2475 "Set up an appropriate `translation-table-for-input' for current buffer. 2475 "Set up an appropriate `translation-table-for-input' for current buffer.
2476 Intended to be added to `quail-activate-hook'." 2476 Intended to be added to `quail-activate-hook'."
2477 (let ((cs (coding-system-base buffer-file-coding-system))) 2477 (let ((cs (and buffer-file-coding-system
2478 (coding-system-base buffer-file-coding-system))))
2478 (if (eq cs 'undecided) 2479 (if (eq cs 'undecided)
2479 (setq cs (coding-system-base default-buffer-file-coding-system))) 2480 (setq cs (and default-buffer-file-coding-system
2480 (if (coding-system-get cs 'translation-table-for-input) 2481 (coding-system-base default-buffer-file-coding-system))))
2482 (if (and cs (coding-system-get cs 'translation-table-for-input))
2481 (set (make-variable-buffer-local 'translation-table-for-input) 2483 (set (make-variable-buffer-local 'translation-table-for-input)
2482 (coding-system-get cs 'translation-table-for-input))))) 2484 (coding-system-get cs 'translation-table-for-input)))))
2483 2485
2484 ;; The minibuffer needs to acquire a `buffer-file-coding-system' for 2486 ;; The minibuffer needs to acquire a `buffer-file-coding-system' for
2485 ;; the above to work in it. 2487 ;; the above to work in it.