mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-02-17 10:27:41 +00:00
(iso-8859-n-locale-regexp): Modify for Latin-[89].
(command-line): Detect Latin-[89] locales.
This commit is contained in:
parent
cce3ba480a
commit
bf0d01c186
1 changed files with 10 additions and 9 deletions
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Reference in a new issue