comparison lisp/international/mule-cmds.el @ 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 a0bf3de65b02
children 2db375ded325 2c2b97b30980
comparison
equal deleted inserted replaced
61556:6b15c97abf1d 61557:44bd70f63148
2393 (let ((vars '("LC_ALL" "LC_CTYPE" "LANG"))) 2393 (let ((vars '("LC_ALL" "LC_CTYPE" "LANG")))
2394 (while (and vars 2394 (while (and vars
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,
2401 ;; using the translation file that many systems have. 2410 ;; using the translation file that many systems have.
2402 (when locale-translation-file-name 2411 (when locale-translation-file-name
2423 (coding-system 2432 (coding-system
2424 (or (locale-name-match locale locale-preferred-coding-systems) 2433 (or (locale-name-match locale locale-preferred-coding-systems)
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.
2432 ;; But, what specified in locale-preferred-coding-systems 2442 ;; But, what specified in locale-preferred-coding-systems
2433 ;; has higher priority. 2443 ;; has higher priority.