diff options
| author | Richard M. Stallman | 1997-05-31 07:30:33 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1997-05-31 07:30:33 +0000 |
| commit | 911ea13b3eaf6c9606f9c1ae86e44bcec9463fd6 (patch) | |
| tree | 4ede0c29ecaea1bd24799f1c5dc736489c592507 /lisp | |
| parent | 7393255738fe7d30880c75e9dc98b02508a67ea3 (diff) | |
| download | emacs-911ea13b3eaf6c9606f9c1ae86e44bcec9463fd6.tar.gz emacs-911ea13b3eaf6c9606f9c1ae86e44bcec9463fd6.zip | |
(command-line): Detect Latin-N character sets
from envvars, both for multibyte mode and single-byte mode.
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/startup.el | 40 |
1 files changed, 25 insertions, 15 deletions
diff --git a/lisp/startup.el b/lisp/startup.el index 8c7eaceca21..7dfb1ca07a1 100644 --- a/lisp/startup.el +++ b/lisp/startup.el | |||
| @@ -277,10 +277,12 @@ option or by setting `inhibit-default-init' in their own init files, | |||
| 277 | but inhibiting `site-start.el' requires `--no-site-file', which | 277 | but inhibiting `site-start.el' requires `--no-site-file', which |
| 278 | is less convenient.") | 278 | is less convenient.") |
| 279 | 279 | ||
| 280 | (defconst iso-8859-1-locale-regexp "8859[-_]?1" | 280 | (defconst iso-8859-n-locale-regexp "8859[-_]?\\([1-5]\\)" |
| 281 | "Regexp that specifies when to enable the ISO 8859-1 character set. | 281 | "Regexp that specifies when to enable an ISO 8859-N character set. |
| 282 | We do that if this regexp matches the locale name | 282 | We do that if this regexp matches the locale name |
| 283 | specified by the LC_ALL, LC_CTYPE and LANG environment variables.") | 283 | specified by the LC_ALL, LC_CTYPE and LANG environment variables. |
| 284 | The paren group in the regexp should match the specific character | ||
| 285 | set number, N.") | ||
| 284 | 286 | ||
| 285 | (defvar mail-host-address nil | 287 | (defvar mail-host-address nil |
| 286 | "*Name of this machine, for purposes of naming users.") | 288 | "*Name of this machine, for purposes of naming users.") |
| @@ -415,20 +417,28 @@ from being initialized.") | |||
| 415 | (string= vc "simple")) | 417 | (string= vc "simple")) |
| 416 | (setq version-control 'never)))) | 418 | (setq version-control 'never)))) |
| 417 | 419 | ||
| 418 | (if (let ((ctype | 420 | (let ((ctype |
| 419 | ;; Use the first of these three envvars that has a nonempty value. | 421 | ;; Use the first of these three envvars that has a nonempty value. |
| 420 | (or (let ((string (getenv "LC_ALL"))) | 422 | (or (let ((string (getenv "LC_ALL"))) |
| 421 | (and (not (equal string "")) string)) | 423 | (and (not (equal string "")) string)) |
| 422 | (let ((string (getenv "LC_CTYPE"))) | 424 | (let ((string (getenv "LC_CTYPE"))) |
| 423 | (and (not (equal string "")) string)) | 425 | (and (not (equal string "")) string)) |
| 424 | (let ((string (getenv "LANG"))) | 426 | (let ((string (getenv "LANG"))) |
| 425 | (and (not (equal string "")) string))))) | 427 | (and (not (equal string "")) string)))) |
| 426 | (and ctype | 428 | charset) |
| 427 | (string-match iso-8859-1-locale-regexp ctype))) | 429 | (when (and ctype |
| 428 | (progn | 430 | (string-match iso-8859-n-locale-regexp ctype)) |
| 431 | (setq charset (concat "latin-" (match-string 1 ctype))) | ||
| 432 | (if (default-value 'enable-multibyte-characters) | ||
| 433 | (if (string-match "latin-[12345]" charset) | ||
| 434 | (set-language-environment charset)) | ||
| 435 | ;; These two lines are ok for any Latin-N character set, | ||
| 436 | ;; as long as the terminal displays it. | ||
| 429 | (require 'disp-table) | 437 | (require 'disp-table) |
| 430 | (standard-display-european t) | 438 | (standard-display-european t) |
| 431 | (require 'latin-1))) | 439 | ;; Set up syntax for the chosen character set. |
| 440 | (if (string-match "latin-[1234]" charset) | ||
| 441 | (require (intern charset)))))) | ||
| 432 | 442 | ||
| 433 | ;;! This has been commented out; I currently find the behavior when | 443 | ;;! This has been commented out; I currently find the behavior when |
| 434 | ;;! split-window-keep-point is nil disturbing, but if I can get used | 444 | ;;! split-window-keep-point is nil disturbing, but if I can get used |