`(let ((,current current-locale-environment))
(unwind-protect
(progn
- (set-locale-environment ,locale-name)
+ (set-locale-environment ,locale-name nil t)
,@body)
- (set-locale-environment ,current)))))
+ (set-locale-environment ,current nil t)))))
-(defun set-locale-environment (&optional locale-name frame)
+(defun set-locale-environment (&optional locale-name frame inhibit-refresh)
"Set up multilingual environment for using LOCALE-NAME.
This sets the language environment, the coding system priority,
the default input method and sometimes other things.
change the locale temporarily, `with-locale-environment' can be
used.
+By default, this function will redraw the current frame. If
+INHIBIT-REFRESH is non-nil, this isn't done.
+
See also `locale-charset-language-names', `locale-language-names',
`locale-preferred-coding-systems' and `locale-coding-system'."
(interactive (list (completing-read "Set environment for locale: "
(or output-coding (setq output-coding code-page-coding))
(unless frame (setq locale-coding-system locale-coding))
(set-keyboard-coding-system code-page-coding frame)
- (set-terminal-coding-system output-coding frame)
+ (set-terminal-coding-system output-coding frame inhibit-refresh)
(setq default-file-name-coding-system ansi-code-page-coding))))
(when (eq system-type 'darwin)
;; the locale.
(when (and (null window-system)
(equal (getenv "TERM_PROGRAM" frame) "Apple_Terminal"))
- (set-terminal-coding-system 'utf-8)
+ (set-terminal-coding-system 'utf-8 nil inhibit-refresh)
(set-keyboard-coding-system 'utf-8)))
;; Default to A4 paper if we're not in a C, POSIX or US locale.
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 &optional terminal)
+(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.
TERMINAL may be a terminal object, a frame, or nil for the
selected frame's terminal. The setting has no effect on
-graphical terminals."
+graphical terminals.
+
+By default, this function will redraw the current frame. If
+INHIBIT-REFRESH is non-nil, this isn't done."
(interactive
(list (let ((default (if (and (not (terminal-coding-system))
default-terminal-coding-system)
(if coding-system
(setq default-terminal-coding-system coding-system))
(set-terminal-coding-system-internal coding-system terminal)
- (redraw-frame))
+ (unless inhibit-refresh
+ (redraw-frame)))
(defvar default-keyboard-coding-system nil
"Default value of the keyboard coding system.