changeset 61557:44bd70f63148

(set-locale-environment): On Mac OS, use preferences AppleLocale and AppleLanguages, and variable mac-system-locale for default locale. On Mac OS Classic, use mac-system-coding-system for default coding systems.
author YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
date Thu, 14 Apr 2005 09:29:16 +0000
parents 6b15c97abf1d
children 3b3fa02a294d
files lisp/international/mule-cmds.el
diffstat 1 files changed, 11 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/international/mule-cmds.el	Thu Apr 14 09:28:21 2005 +0000
+++ b/lisp/international/mule-cmds.el	Thu Apr 14 09:29:16 2005 +0000
@@ -2395,6 +2395,15 @@
 		    (= 0 (length locale))) ; nil or empty string
 	  (setq locale (getenv (pop vars))))))
 
+    (unless (or locale (not (fboundp 'mac-get-preference)))
+      (setq locale (mac-get-preference "AppleLocale"))
+      (unless locale
+	(let ((languages (mac-get-preference "AppleLanguages")))
+	  (unless (= (length languages) 0) ; nil or empty vector
+	    (setq locale (aref languages 0))))))
+    (unless (or locale (not (boundp 'mac-system-locale)))
+      (setq locale mac-system-locale))
+
     (when locale
 
       ;; Translate "swedish" into "sv_SE.ISO8859-1", and so on,
@@ -2425,7 +2434,8 @@
 		 (when locale
 		   (if (string-match "\\.\\([^@]+\\)" locale)
 		       (locale-charset-to-coding-system
-			(match-string 1 locale)))))))
+			(match-string 1 locale))))
+		 (and (eq system-type 'macos) mac-system-coding-system))))
 
 	(if (consp language-name)
 	    ;; locale-language-names specify both lang-env and coding.