aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2005-03-25 15:41:42 +0000
committerStefan Monnier2005-03-25 15:41:42 +0000
commitff76e0743fb1586159b07476acdc6f9b48ce54f6 (patch)
tree3276cb92c89aa362acb2d24a7178ecd503de631d
parent6567170621cd56182158b49dcd3cac8f405e2c3b (diff)
downloademacs-ff76e0743fb1586159b07476acdc6f9b48ce54f6.tar.gz
emacs-ff76e0743fb1586159b07476acdc6f9b48ce54f6.zip
(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.
-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:
1734 1734
1735(reset-language-environment) 1735(reset-language-environment)
1736 1736
1737(defun set-display-table-and-terminal-coding-system (language-name) 1737(defun set-display-table-and-terminal-coding-system (language-name &optional coding-system)
1738 "Set up the display table and terminal coding system for LANGUAGE-NAME." 1738 "Set up the display table and terminal coding system for LANGUAGE-NAME."
1739 (let ((coding (get-language-info language-name 'unibyte-display))) 1739 (let ((coding (get-language-info language-name 'unibyte-display)))
1740 (if coding 1740 (if coding
@@ -1748,7 +1748,7 @@ The default status is as follows:
1748 (dotimes (i 128) 1748 (dotimes (i 128)
1749 (aset standard-display-table (+ i 128) nil)))) 1749 (aset standard-display-table (+ i 128) nil))))
1750 (or (eq window-system 'pc) 1750 (or (eq window-system 'pc)
1751 (set-terminal-coding-system coding)))) 1751 (set-terminal-coding-system (or coding-system coding)))))
1752 1752
1753(defun set-language-environment (language-name) 1753(defun set-language-environment (language-name)
1754 "Set up multi-lingual environment for using LANGUAGE-NAME. 1754 "Set up multi-lingual environment for using LANGUAGE-NAME.
@@ -2446,7 +2446,8 @@ See also `locale-charset-language-names', `locale-language-names',
2446 ;; we are using single-byte characters, 2446 ;; we are using single-byte characters,
2447 ;; so the display table and terminal coding system are irrelevant. 2447 ;; so the display table and terminal coding system are irrelevant.
2448 (when default-enable-multibyte-characters 2448 (when default-enable-multibyte-characters
2449 (set-display-table-and-terminal-coding-system language-name)) 2449 (set-display-table-and-terminal-coding-system
2450 language-name coding-system))
2450 2451
2451 ;; Set the `keyboard-coding-system' if appropriate (tty 2452 ;; Set the `keyboard-coding-system' if appropriate (tty
2452 ;; only). At least X and MS Windows can generate 2453 ;; only). At least X and MS Windows can generate
@@ -2476,9 +2477,16 @@ See also `locale-charset-language-names', `locale-language-names',
2476 (set-keyboard-coding-system code-page-coding) 2477 (set-keyboard-coding-system code-page-coding)
2477 (set-terminal-coding-system code-page-coding)))) 2478 (set-terminal-coding-system code-page-coding))))
2478 2479
2479 ;; On Darwin, file names are always encoded in utf-8, no matter the locale.
2480 (when (eq system-type 'darwin) 2480 (when (eq system-type 'darwin)
2481 (setq default-file-name-coding-system 'utf-8)) 2481 ;; On Darwin, file names are always encoded in utf-8, no matter
2482 ;; the locale.
2483 (setq default-file-name-coding-system 'utf-8)
2484 ;; Mac OS X's Terminal.app by default uses utf-8 regardless of
2485 ;; the locale.
2486 (when (and (null window-system)
2487 (equal (getenv "TERM_PROGRAM") "Apple_Terminal"))
2488 (set-terminal-coding-system 'utf-8)
2489 (set-keyboard-coding-system 'utf-8)))
2482 2490
2483 ;; Default to A4 paper if we're not in a C, POSIX or US locale. 2491 ;; Default to A4 paper if we're not in a C, POSIX or US locale.
2484 ;; (See comments in Flocale_info.) 2492 ;; (See comments in Flocale_info.)