# HG changeset patch # User Richard M. Stallman # Date 865063833 0 # Node ID ffd40bd63246fe1161b9ae1fa603543e0d8e2526 # Parent bcdf720abb1a69227ed917355d4028b435cbd8b0 (command-line): Detect Latin-N character sets from envvars, both for multibyte mode and single-byte mode. diff -r bcdf720abb1a -r ffd40bd63246 lisp/startup.el --- a/lisp/startup.el Sat May 31 07:16:13 1997 +0000 +++ b/lisp/startup.el Sat May 31 07:30:33 1997 +0000 @@ -277,10 +277,12 @@ but inhibiting `site-start.el' requires `--no-site-file', which is less convenient.") -(defconst iso-8859-1-locale-regexp "8859[-_]?1" - "Regexp that specifies when to enable the ISO 8859-1 character set. +(defconst iso-8859-n-locale-regexp "8859[-_]?\\([1-5]\\)" + "Regexp that specifies when to enable an ISO 8859-N character set. We do that if this regexp matches the locale name -specified by the LC_ALL, LC_CTYPE and LANG environment variables.") +specified by the LC_ALL, LC_CTYPE and LANG environment variables. +The paren group in the regexp should match the specific character +set number, N.") (defvar mail-host-address nil "*Name of this machine, for purposes of naming users.") @@ -415,20 +417,28 @@ (string= vc "simple")) (setq version-control 'never)))) - (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 + (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)))) + charset) + (when (and ctype + (string-match iso-8859-n-locale-regexp ctype)) + (setq charset (concat "latin-" (match-string 1 ctype))) + (if (default-value 'enable-multibyte-characters) + (if (string-match "latin-[12345]" charset) + (set-language-environment charset)) + ;; These two lines are ok for any Latin-N character set, + ;; as long as the terminal displays it. (require 'disp-table) (standard-display-european t) - (require 'latin-1))) + ;; Set up syntax for the chosen character set. + (if (string-match "latin-[1234]" charset) + (require (intern charset)))))) ;;! This has been commented out; I currently find the behavior when ;;! split-window-keep-point is nil disturbing, but if I can get used