Mercurial > emacs
diff lisp/international/encoded-kb.el @ 83333:40c0ee282254
Implement rudimentary Lisp-level terminal parameters.
* lisp/frame.el (terminal-id, terminal-parameters, terminal-parameter)
(set-terminal-parameter, terminal-handle-delete-frame): New functions.
(delete-frame-functions): Add to `delete-frame-functions' hook.
(terminal-parameter-alist): New variable.
* lisp/international/encoded-kb.el (saved-input-mode): Delete variable.
(encoded-kbd-setup-display): Store the saved input method as a terminal
parameter.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-373
author | Karoly Lorentey <lorentey@elte.hu> |
---|---|
date | Wed, 06 Jul 2005 00:41:41 +0000 |
parents | 6c13700d1c13 |
children | 7372c2f9daac |
line wrap: on
line diff
--- a/lisp/international/encoded-kb.el Tue Jul 05 22:22:24 2005 +0000 +++ b/lisp/international/encoded-kb.el Wed Jul 06 00:41:41 2005 +0000 @@ -251,10 +251,6 @@ (t nil))) -;; Input mode at the time Encoded-kbd mode is turned on is saved here. -;; XXX This should be made display-local somehow. -(defvar saved-input-mode nil) - ;;;###autoload (defun encoded-kbd-setup-display (display) "Set up a `key-translation-map' for `keyboard-coding-system' on DISPLAY. @@ -276,26 +272,29 @@ ;; We are turning on Encoded-kbd mode. (let ((coding (keyboard-coding-system)) (keymap (make-sparse-keymap "encoded-kb")) + (cim (current-input-mode)) result) (set-keymap-parent keymap (terminal-local-value 'key-translation-map frame)) (set-terminal-local-value 'key-translation-map frame keymap) - (or saved-input-mode - (setq saved-input-mode (current-input-mode))) + (or (terminal-parameter nil 'encoded-kbd-saved-input-mode) + (set-terminal-parameter nil 'encoded-kbd-saved-input-mode cim)) (setq result (and coding (encoded-kbd-setup-keymap keymap coding))) (if result - (if (eq result 8) - (set-input-mode - (nth 0 saved-input-mode) - (nth 1 saved-input-mode) - 'use-8th-bit - (nth 3 saved-input-mode))) - (setq saved-input-mode nil) + (when (and (eq result 8) + (not (memq (nth 2 cim) '(t nil)))) + (set-input-mode + (nth 0 cim) + (nth 1 cim) + 'use-8th-bit + (nth 3 cim))) + (set-terminal-local-value nil 'encoded-kbd-saved-input-mode nil) (error "Unsupported coding system in Encoded-kbd mode: %S" coding))) ;; We are turning off Encoded-kbd mode. - (and saved-input-mode - (apply 'set-input-mode saved-input-mode)) - (setq saved-input-mode nil)))))) + (unless (equal (current-input-mode) + (terminal-parameter nil 'encoded-kbd-saved-input-mode)) + (apply 'set-input-mode (terminal-parameter nil 'encoded-kbd-saved-input-mode))) + (set-terminal-parameter nil 'saved-input-mode nil)))))) (provide 'encoded-kb)