comparison lisp/startup.el @ 18072:ffd40bd63246

(command-line): Detect Latin-N character sets from envvars, both for multibyte mode and single-byte mode.
author Richard M. Stallman <rms@gnu.org>
date Sat, 31 May 1997 07:30:33 +0000
parents 9eb3383d05a6
children f23435e45e36
comparison
equal deleted inserted replaced
18071:bcdf720abb1a 18072:ffd40bd63246
275 override them. Users can prevent loading `default.el' with the `-q' 275 override them. Users can prevent loading `default.el' with the `-q'
276 option or by setting `inhibit-default-init' in their own init files, 276 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.")
287 289
288 (defvar user-mail-address nil 290 (defvar user-mail-address nil
413 (setq version-control nil)) 415 (setq version-control nil))
414 ((or (string= vc "never") 416 ((or (string= vc "never")
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
435 ;;! to it, then it would be better to eliminate the option. 445 ;;! to it, then it would be better to eliminate the option.
436 ;;! ;; Choose a good default value for split-window-keep-point. 446 ;;! ;; Choose a good default value for split-window-keep-point.