Mercurial > emacs
comparison lisp/startup.el @ 26015:27732f03c976
(iso-8859-n-locale-regexp): Modify for Latin-[89].
(command-line): Detect Latin-[89] locales.
author | Dave Love <fx@gnu.org> |
---|---|
date | Thu, 14 Oct 1999 10:23:59 +0000 |
parents | cf5a6d4a09f1 |
children | 804cba424b64 |
comparison
equal
deleted
inserted
replaced
26014:e84e2bf4f9fb | 26015:27732f03c976 |
---|---|
294 but inhibiting `site-start.el' requires `--no-site-file', which | 294 but inhibiting `site-start.el' requires `--no-site-file', which |
295 is less convenient." | 295 is less convenient." |
296 :type '(choice (const :tag "none" nil) string) | 296 :type '(choice (const :tag "none" nil) string) |
297 :group 'initialization) | 297 :group 'initialization) |
298 | 298 |
299 (defconst iso-8859-n-locale-regexp "8859[-_]?\\([1-49]\\)\\>" | 299 (defconst iso-8859-n-locale-regexp "8859[-_]?\\([1-49]\\|1[45]\\)\\>" |
300 "Regexp that specifies when to enable an ISO 8859-N character set. | 300 "Regexp that specifies when to enable an ISO 8859-N character set. |
301 We do that if this regexp matches the locale name specified by | 301 We do that if this regexp matches the locale name specified by |
302 one of the environment variables LC_ALL, LC_CTYPE, or LANG. | 302 one of the environment variables LC_ALL, LC_CTYPE, or LANG. |
303 The paren group in the regexp should match the specific character | 303 The paren group in the regexp should match the specific character |
304 set number, N. Currently only Latin-[12345] are supported. | 304 set number, N. Currently only Latin-[1234589] are supported. |
305 \(Note that Latin-5 is ISO 8859-9, because 8859-[678] are non-Latin | 305 \(Note that Latin-5 is ISO 8859-9, because 8859-[678] are non-Latin |
306 alphabets; hence, supported values of N are [12349].\)") | 306 alphabets; hence, supported values of N are 1, 2, 3, 4, 9, 14 and 15.\)") |
307 | 307 |
308 (defcustom mail-host-address nil | 308 (defcustom mail-host-address nil |
309 "*Name of this machine, for purposes of naming users." | 309 "*Name of this machine, for purposes of naming users." |
310 :type '(choice (const nil) string) | 310 :type '(choice (const nil) string) |
311 :group 'mail) | 311 :group 'mail) |
536 (not (string-match iso-8859-n-locale-regexp ctype)) | 536 (not (string-match iso-8859-n-locale-regexp ctype)) |
537 (with-temp-buffer | 537 (with-temp-buffer |
538 (insert-file-contents locale-translation-file-name) | 538 (insert-file-contents locale-translation-file-name) |
539 (if (re-search-forward | 539 (if (re-search-forward |
540 (concat "^" (regexp-quote ctype) ":?[ \t]+") nil t) | 540 (concat "^" (regexp-quote ctype) ":?[ \t]+") nil t) |
541 (setq ctype (buffer-substring (point) | 541 (setq ctype (buffer-substring (point) (line-end-position)))))) |
542 (progn (end-of-line) (point))))))) | |
543 ;; Now see if the locale specifies an ISO 8859 character set. | 542 ;; Now see if the locale specifies an ISO 8859 character set. |
544 (when (and ctype | 543 (when (and ctype |
545 (string-match iso-8859-n-locale-regexp ctype)) | 544 (string-match iso-8859-n-locale-regexp ctype)) |
546 (let (charset (which (match-string 1 ctype))) | 545 (let* ((which (match-string 1 ctype)) |
547 (if (equal "9" which) | 546 (latin (cdr (assoc which '(("9" . "5") ("14" . "8") |
548 (setq which "5")) | 547 ("15" . "9"))))) |
548 charset) | |
549 (if latin (setq which latin)) | |
549 (setq charset (concat "latin-" which)) | 550 (setq charset (concat "latin-" which)) |
550 (when (string-match "latin-[12345]" charset) | 551 (when (string-match "latin-[1-589]" charset) |
551 ;; Set up for this character set. | 552 ;; Set up for this character set. |
552 ;; This is now the right way to do it | 553 ;; This is now the right way to do it |
553 ;; for both unibyte and multibyte modes. | 554 ;; for both unibyte and multibyte modes. |
554 (set-language-environment charset) | 555 (set-language-environment charset) |
555 (unless (or noninteractive (eq window-system 'x)) | 556 (unless (or noninteractive (eq window-system 'x)) |