changeset 8147:053a450a871a

(command-line): Check LC_ALL and LANG as well as LC_CTYPE. (iso-8859-1-locale-regexp): Don't check for `iso'.
author Richard M. Stallman <rms@gnu.org>
date Tue, 05 Jul 1994 18:35:37 +0000
parents a58ae7dfc8bd
children 0035bfc4bc9d
files lisp/startup.el
diffstat 1 files changed, 15 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/startup.el	Tue Jul 05 18:33:10 1994 +0000
+++ b/lisp/startup.el	Tue Jul 05 18:35:37 1994 +0000
@@ -141,6 +141,11 @@
 dumped image.  Thus, the run-time load order is: 1. file described in
 this variable, if non-nil; 2. `~/.emacs'; 3. `default.el'.")
 
+(defconst iso-8859-1-locale-regexp "8859[-_]?1"
+  "Regexp that specifies when to enable the ISO 8859-1 character set.
+We do that if this regexp matches the locale name
+specified by the LC_ALL, LC_CTYPE and LANG environment variables.")
+
 (defvar user-mail-address nil
   "Full mailing address of this user.")
 
@@ -201,9 +206,6 @@
 	       (x-popup-menu nil (cdr (cdr (car submap)))))
 	  (setq submap (cdr submap))))))
 
-(defconst iso-8859-1-locale-regexp "iso[-_]?8859[-_]1"
-  "Use ISO 8859-1 character set by default if this regexp matches LC_CTYPE.")
-
 (defun command-line ()
   (setq command-line-default-directory default-directory)
 
@@ -220,7 +222,16 @@
 	       (string= vc "simple"))
 	   (setq version-control 'never))))
 
-  (if (string-match iso-8859-1-locale-regexp (getenv "LC_CTYPE"))
+  (if (let ((ctype
+	     ;; Use the first of these three envvars that has a nonempty value.
+	     (or (let ((string (getenv "LC_ALL")))
+		   (and (not (equal string "")) string))
+		 (let ((string (getenv "LC_CTYPE")))
+		   (and (not (equal string "")) string))
+		 (let ((string (getenv "LANG")))
+		   (and (not (equal string "")) string)))))
+	(and ctype
+	     (string-match iso-8859-1-locale-regexp ctype)))
       (progn 
 	(standard-display-european t)
 	(require 'iso-syntax)))