From cfd67504b9bccbdb6467a4c8915bd9cb9657f6bc Mon Sep 17 00:00:00 2001 From: YAMAMOTO Mitsuharu Date: Thu, 14 Apr 2005 09:29:16 +0000 Subject: [PATCH] (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. --- lisp/international/mule-cmds.el | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/lisp/international/mule-cmds.el b/lisp/international/mule-cmds.el index 4957a7cfc7e..c36a63ccfcf 100644 --- a/lisp/international/mule-cmds.el +++ b/lisp/international/mule-cmds.el @@ -2395,6 +2395,15 @@ See also `locale-charset-language-names', `locale-language-names', (= 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 @@ See also `locale-charset-language-names', `locale-language-names', (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.