Mercurial > emacs
changeset 65311:bea70b37d446
(set-locale-environment): Soothe compiler.
author | Stefan Monnier <monnier@iro.umontreal.ca> |
---|---|
date | Thu, 01 Sep 2005 14:30:30 +0000 |
parents | efcffd1c5434 |
children | 915d671fef52 |
files | lisp/international/mule-cmds.el |
diffstat | 1 files changed, 9 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/international/mule-cmds.el Thu Sep 01 14:18:42 2005 +0000 +++ b/lisp/international/mule-cmds.el Thu Sep 01 14:30:30 2005 +0000 @@ -2445,12 +2445,15 @@ (= 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))