From: Dave Love Date: Thu, 14 Oct 1999 10:23:59 +0000 (+0000) Subject: (iso-8859-n-locale-regexp): Modify for Latin-[89]. X-Git-Tag: emacs-pretest-21.0.90~6444 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=bf0d01c18614d07b2eaa3641a8d16cdbbfb7ee89;p=emacs.git (iso-8859-n-locale-regexp): Modify for Latin-[89]. (command-line): Detect Latin-[89] locales. --- diff --git a/lisp/startup.el b/lisp/startup.el index 444036ea629..a0daa9bff89 100644 --- a/lisp/startup.el +++ b/lisp/startup.el @@ -296,14 +296,14 @@ is less convenient." :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 @@ or `CVS', and any subdirectory that contains a file named `.nosearch'." (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.