diff lisp/mule/mule-cmds.el @ 3173:a2331a8fccb5

[xemacs-hg @ 2005-12-24 21:59:18 by aidan] Call set-current-locale on startup, to better allow the language environment init code to work out what it should do. Reverts a bug I introduced on 2005-12-17.
author aidan
date Sat, 24 Dec 2005 21:59:21 +0000
parents 77f5a5135b3a
children f6f6fc9eb269
line wrap: on
line diff
--- a/lisp/mule/mule-cmds.el	Sat Dec 24 21:24:27 2005 +0000
+++ b/lisp/mule/mule-cmds.el	Sat Dec 24 21:59:21 2005 +0000
@@ -1341,12 +1341,19 @@
 	;;     locale but we should still use the right code page, etc.
 	(declare-fboundp (mswindows-set-current-locale userdef)))
       ;; Unix:
-      (let ((locstring (current-locale)))
-	;; assume C lib locale and LANG env var are set correctly.  use
-	;; them to find the langenv.
-	(setq langenv
-	      (and locstring (get-language-environment-from-locale
-			      locstring)))))
+      (let (locstring)
+	;; Init the POSIX locale from the environment--this calls the C
+	;; library's setlocale(3).
+	(set-current-locale "")
+	;; Can't let locstring be the result of (set-current-locale "")
+	;; because that can return a more detailed string than we know how
+	;; to handle.
+	(setq locstring (current-locale)
+	      ;; assume C lib locale and LANG env var are set correctly.
+	      ;; use them to find the langenv.
+	      langenv
+ 	      (and locstring (get-language-environment-from-locale
+ 			      locstring)))))
     ;; All systems:
     (unless langenv (setq langenv "English"))
     (setq current-language-environment langenv)