Commit 02de72e9 authored by Stefan Monnier's avatar Stefan Monnier
Browse files

(set-locale-environment): Soothe compiler.

parent bdb4d6d8
......@@ -2445,12 +2445,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 locale
;; The two tests are kept separate so the byte-compiler sees
;; that mac-get-preference is only called after checking its existence.
(when (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))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment