mirror of
https://git.savannah.gnu.org/git/emacs.git
synced 2025-01-05 11:45:45 +00:00
(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.
This commit is contained in:
parent
9bf2510aa5
commit
cfd67504b9
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user