changeset 26015:27732f03c976

(iso-8859-n-locale-regexp): Modify for Latin-[89]. (command-line): Detect Latin-[89] locales.
author Dave Love <fx@gnu.org>
date Thu, 14 Oct 1999 10:23:59 +0000
parents e84e2bf4f9fb
children e60cddba180c
files lisp/startup.el
diffstat 1 files changed, 10 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/startup.el	Thu Oct 14 09:53:01 1999 +0000
+++ b/lisp/startup.el	Thu Oct 14 10:23:59 1999 +0000
@@ -296,14 +296,14 @@
   :type '(choice (const :tag "none" nil) string)
   :group 'initialization)
 
-(defconst iso-8859-n-locale-regexp "8859[-_]?\\([1-49]\\)\\>"
+(defconst iso-8859-n-locale-regexp "8859[-_]?\\([1-49]\\|1[45]\\)\\>"
   "Regexp that specifies when to enable an ISO 8859-N character set.
 We do that if this regexp matches the locale name specified by
 one of the environment variables LC_ALL, LC_CTYPE, or LANG.
 The paren group in the regexp should match the specific character
-set number, N.  Currently only Latin-[12345] are supported.
+set number, N.  Currently only Latin-[1234589] are supported.
 \(Note that Latin-5 is ISO 8859-9, because 8859-[678] are non-Latin
-alphabets; hence, supported values of N are [12349].\)")
+alphabets; hence, supported values of N are 1, 2, 3, 4, 9, 14 and 15.\)")
 
 (defcustom mail-host-address nil
   "*Name of this machine, for purposes of naming users."
@@ -538,16 +538,17 @@
 	   (insert-file-contents locale-translation-file-name)
 	   (if (re-search-forward
 		(concat "^" (regexp-quote ctype) ":?[ \t]+") nil t)
-	       (setq ctype (buffer-substring (point)
-					     (progn (end-of-line) (point)))))))
+	       (setq ctype (buffer-substring (point) (line-end-position))))))
     ;; Now see if the locale specifies an ISO 8859 character set.
     (when (and ctype
 	       (string-match iso-8859-n-locale-regexp ctype))
-      (let (charset (which (match-string 1 ctype)))
-	(if (equal "9" which)
-	    (setq which "5"))
+      (let* ((which (match-string 1 ctype))
+	     (latin (cdr (assoc which '(("9" . "5") ("14" . "8")
+					("15" . "9")))))
+	    charset)
+	(if latin  (setq which latin))
 	(setq charset (concat "latin-" which))
-	(when (string-match "latin-[12345]" charset)
+	(when (string-match "latin-[1-589]" charset)
 	  ;; Set up for this character set.
 	  ;; This is now the right way to do it
 	  ;; for both unibyte and multibyte modes.