# HG changeset patch # User Stefan Monnier # Date 1125585030 0 # Node ID bea70b37d446479f63d888984ce3bcc82b2640f0 # Parent efcffd1c543459be2e5058141fe4f48fb733d781 (set-locale-environment): Soothe compiler. diff -r efcffd1c5434 -r bea70b37d446 lisp/international/mule-cmds.el --- 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))