summaryrefslogtreecommitdiff
path: root/lisp/international/mule-cmds.el
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2005-03-25 15:41:42 +0000
committerStefan Monnier <monnier@iro.umontreal.ca>2005-03-25 15:41:42 +0000
commitff76e0743fb1586159b07476acdc6f9b48ce54f6 (patch)
tree3276cb92c89aa362acb2d24a7178ecd503de631d /lisp/international/mule-cmds.el
parent6567170621cd56182158b49dcd3cac8f405e2c3b (diff)
downloademacs-ff76e0743fb1586159b07476acdc6f9b48ce54f6.tar.gz
(set-locale-environment): For Mac OS X's Terminal.app, use utf-8.
(set-display-table-and-terminal-coding-system): Add coding-system arg. (set-locale-environment): Use it.
Diffstat (limited to 'lisp/international/mule-cmds.el')
-rw-r--r--lisp/international/mule-cmds.el18
1 files changed, 13 insertions, 5 deletions
diff --git a/lisp/international/mule-cmds.el b/lisp/international/mule-cmds.el
index a06c438b421..5ca08b78453 100644
--- a/lisp/international/mule-cmds.el
+++ b/lisp/international/mule-cmds.el
@@ -1734,7 +1734,7 @@ The default status is as follows:
(reset-language-environment)
-(defun set-display-table-and-terminal-coding-system (language-name)
+(defun set-display-table-and-terminal-coding-system (language-name &optional coding-system)
"Set up the display table and terminal coding system for LANGUAGE-NAME."
(let ((coding (get-language-info language-name 'unibyte-display)))
(if coding
@@ -1748,7 +1748,7 @@ The default status is as follows:
(dotimes (i 128)
(aset standard-display-table (+ i 128) nil))))
(or (eq window-system 'pc)
- (set-terminal-coding-system coding))))
+ (set-terminal-coding-system (or coding-system coding)))))
(defun set-language-environment (language-name)
"Set up multi-lingual environment for using LANGUAGE-NAME.
@@ -2446,7 +2446,8 @@ See also `locale-charset-language-names', `locale-language-names',
;; we are using single-byte characters,
;; so the display table and terminal coding system are irrelevant.
(when default-enable-multibyte-characters
- (set-display-table-and-terminal-coding-system language-name))
+ (set-display-table-and-terminal-coding-system
+ language-name coding-system))
;; Set the `keyboard-coding-system' if appropriate (tty
;; only). At least X and MS Windows can generate
@@ -2476,9 +2477,16 @@ See also `locale-charset-language-names', `locale-language-names',
(set-keyboard-coding-system code-page-coding)
(set-terminal-coding-system code-page-coding))))
- ;; On Darwin, file names are always encoded in utf-8, no matter the locale.
(when (eq system-type 'darwin)
- (setq default-file-name-coding-system 'utf-8))
+ ;; On Darwin, file names are always encoded in utf-8, no matter
+ ;; the locale.
+ (setq default-file-name-coding-system 'utf-8)
+ ;; Mac OS X's Terminal.app by default uses utf-8 regardless of
+ ;; the locale.
+ (when (and (null window-system)
+ (equal (getenv "TERM_PROGRAM") "Apple_Terminal"))
+ (set-terminal-coding-system 'utf-8)
+ (set-keyboard-coding-system 'utf-8)))
;; Default to A4 paper if we're not in a C, POSIX or US locale.
;; (See comments in Flocale_info.)