diff options
| author | YAMAMOTO Mitsuharu | 2005-04-14 09:29:16 +0000 |
|---|---|---|
| committer | YAMAMOTO Mitsuharu | 2005-04-14 09:29:16 +0000 |
| commit | cfd67504b9bccbdb6467a4c8915bd9cb9657f6bc (patch) | |
| tree | b7cdc03d80be8e710965632622e1d73b5e1100e2 | |
| parent | 9bf2510aa5b8fa64155f9e8d8c7f98d4ba2080cb (diff) | |
| download | emacs-cfd67504b9bccbdb6467a4c8915bd9cb9657f6bc.tar.gz emacs-cfd67504b9bccbdb6467a4c8915bd9cb9657f6bc.zip | |
(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.
| -rw-r--r-- | lisp/international/mule-cmds.el | 12 |
1 files changed, 11 insertions, 1 deletions
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', | |||
| 2395 | (= 0 (length locale))) ; nil or empty string | 2395 | (= 0 (length locale))) ; nil or empty string |
| 2396 | (setq locale (getenv (pop vars)))))) | 2396 | (setq locale (getenv (pop vars)))))) |
| 2397 | 2397 | ||
| 2398 | (unless (or locale (not (fboundp 'mac-get-preference))) | ||
| 2399 | (setq locale (mac-get-preference "AppleLocale")) | ||
| 2400 | (unless locale | ||
| 2401 | (let ((languages (mac-get-preference "AppleLanguages"))) | ||
| 2402 | (unless (= (length languages) 0) ; nil or empty vector | ||
| 2403 | (setq locale (aref languages 0)))))) | ||
| 2404 | (unless (or locale (not (boundp 'mac-system-locale))) | ||
| 2405 | (setq locale mac-system-locale)) | ||
| 2406 | |||
| 2398 | (when locale | 2407 | (when locale |
| 2399 | 2408 | ||
| 2400 | ;; Translate "swedish" into "sv_SE.ISO8859-1", and so on, | 2409 | ;; Translate "swedish" into "sv_SE.ISO8859-1", and so on, |
| @@ -2425,7 +2434,8 @@ See also `locale-charset-language-names', `locale-language-names', | |||
| 2425 | (when locale | 2434 | (when locale |
| 2426 | (if (string-match "\\.\\([^@]+\\)" locale) | 2435 | (if (string-match "\\.\\([^@]+\\)" locale) |
| 2427 | (locale-charset-to-coding-system | 2436 | (locale-charset-to-coding-system |
| 2428 | (match-string 1 locale))))))) | 2437 | (match-string 1 locale)))) |
| 2438 | (and (eq system-type 'macos) mac-system-coding-system)))) | ||
| 2429 | 2439 | ||
| 2430 | (if (consp language-name) | 2440 | (if (consp language-name) |
| 2431 | ;; locale-language-names specify both lang-env and coding. | 2441 | ;; locale-language-names specify both lang-env and coding. |