Function: set-terminal-coding-system

set-terminal-coding-system is an interactive and byte-compiled function defined in mule.el.gz.

Signature

(set-terminal-coding-system CODING-SYSTEM &optional TERMINAL INHIBIT-REFRESH)

Documentation

Set coding system of terminal output to CODING-SYSTEM.

All text output to TERMINAL will be encoded with the specified coding system.

For a list of possible values of CODING-SYSTEM, use M-x list-coding-systems (list-coding-systems). The default is determined by the selected language environment or by the previous use of this command.

Optional argument TERMINAL may be a terminal object or a frame, and defaults to the selected frame's terminal. The setting has no effect on graphical terminals.

By default, this function will redraw the current frame; optional argument INHIBIT-REFRESH, if non-nil, prevents that.

View in manual

Probably introduced at or before Emacs version 20.1.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/international/mule.el.gz
(defun set-terminal-coding-system (coding-system &optional terminal
                                                 inhibit-refresh)
  "Set coding system of terminal output to CODING-SYSTEM.
All text output to TERMINAL 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.

Optional argument TERMINAL may be a terminal object or a frame,
and defaults to the selected frame's terminal.  The setting has no
effect on graphical terminals.

By default, this function will redraw the current frame;
optional argument INHIBIT-REFRESH, if non-nil, prevents that."
  (interactive
   (list (let ((default (if (and (not (terminal-coding-system))
				 default-terminal-coding-system)
			    default-terminal-coding-system)))
	   (read-coding-system
	    (format-prompt "Coding system for terminal display" default)
	    default))))
  (if (and (not coding-system)
	   (not (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 terminal)
  (unless inhibit-refresh
    (redraw-frame)))