This is normally set according to the selected language environment.
See also the command `set-terminal-coding-system'.")
-(defun set-terminal-coding-system (coding-system)
- "Set coding system of your terminal to CODING-SYSTEM.
-All text output to the terminal will be encoded
+(defun set-terminal-coding-system (coding-system &optional display)
+ "Set coding system of terminal output to CODING-SYSTEM.
+All text output to DISPLAY will be encoded
with the specified coding system.
+
For a list of possible values of CODING-SYSTEM, use \\[list-coding-systems].
The default is determined by the selected language environment
-or by the previous use of this command."
+or by the previous use of this command.
+
+DISPLAY may be a display id, a frame, or nil for the selected frame's display.
+The setting has no effect on graphical displays."
(interactive
(list (let ((default (if (and (not (terminal-coding-system))
default-terminal-coding-system)
(setq coding-system default-terminal-coding-system))
(if coding-system
(setq default-terminal-coding-system coding-system))
- (set-terminal-coding-system-internal coding-system)
+ (set-terminal-coding-system-internal coding-system display)
(redraw-frame (selected-frame)))
(defvar default-keyboard-coding-system nil
This is normally set according to the selected language environment.
See also the command `set-keyboard-coding-system'.")
-(defun set-keyboard-coding-system (coding-system)
- "Set coding system for keyboard input to CODING-SYSTEM.
-In addition, this command enables Encoded-kbd minor mode.
-\(If CODING-SYSTEM is nil, Encoded-kbd mode is turned off -- see
-`encoded-kbd-mode'.)
+(defun set-keyboard-coding-system (coding-system &optional display)
+ "Set coding system for keyboard input on DISPLAY to CODING-SYSTEM.
+In addition, this command calls `encoded-kbd-setup-display' to set up the
+translation of keyboard input events to the specified coding system.
+
For a list of possible values of CODING-SYSTEM, use \\[list-coding-systems].
The default is determined by the selected language environment
-or by the previous use of this command."
+or by the previous use of this command.
+
+DISPLAY may be a display id, a frame, or nil for the selected frame's display.
+The setting has no effect on graphical displays."
(interactive
(list (let ((default (if (and (not (keyboard-coding-system))
default-keyboard-coding-system)
(if (and coding-system
(coding-system-get coding-system 'ascii-incompatible))
(error "%s is not ASCII-compatible" coding-system))
- (set-keyboard-coding-system-internal coding-system)
+ (set-keyboard-coding-system-internal coding-system display)
(setq keyboard-coding-system coding-system)
- (encoded-kbd-mode (if coding-system 1 0)))
+ (encoded-kbd-setup-display display))
(defcustom keyboard-coding-system nil
"Specify coding system for keyboard input.
:link '(info-link "(emacs)Terminal Coding")
:link '(info-link "(emacs)Unibyte Mode")
:set (lambda (symbol value)
- ;; Don't load encoded-kbd-mode unnecessarily.
- (if (or value (boundp 'encoded-kbd-mode))
+ ;; Don't load encoded-kb unnecessarily.
+ (if (or value (boundp 'encoded-kbd-setup-display))
(set-keyboard-coding-system value)
(set-default 'keyboard-coding-system nil))) ; must initialize
:version "22.1"