diff options
| author | Richard M. Stallman | 1998-05-14 03:55:13 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1998-05-14 03:55:13 +0000 |
| commit | cbe9a46020c7c508624f8262f6b47d776839845f (patch) | |
| tree | bf11597f175a625f4f4670c357ef80485e8a5f8b | |
| parent | 6b3a18963aa4c7e398e6702a1e7318b3eaa2c07c (diff) | |
| download | emacs-cbe9a46020c7c508624f8262f6b47d776839845f.tar.gz emacs-cbe9a46020c7c508624f8262f6b47d776839845f.zip | |
(locale-translation-file-name): New variable.
(command-line): Use it to decode locale aliases.
| -rw-r--r-- | lisp/startup.el | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lisp/startup.el b/lisp/startup.el index 1a85a2aa0be..aa86b0828c0 100644 --- a/lisp/startup.el +++ b/lisp/startup.el | |||
| @@ -329,6 +329,9 @@ from being initialized." | |||
| 329 | string) | 329 | string) |
| 330 | :group 'auto-save) | 330 | :group 'auto-save) |
| 331 | 331 | ||
| 332 | (defvar locale-translation-file-name "/usr/share/locale/locale.alias" | ||
| 333 | "*File name for the system's file of locale-name aliases.") | ||
| 334 | |||
| 332 | (defvar init-file-debug nil) | 335 | (defvar init-file-debug nil) |
| 333 | 336 | ||
| 334 | (defvar init-file-had-error nil) | 337 | (defvar init-file-had-error nil) |
| @@ -482,6 +485,17 @@ and any subdirectory that contains a file named `.nosearch'." | |||
| 482 | (and (not (equal string "")) string)) | 485 | (and (not (equal string "")) string)) |
| 483 | (let ((string (getenv "LANG"))) | 486 | (let ((string (getenv "LANG"))) |
| 484 | (and (not (equal string "")) string))))) | 487 | (and (not (equal string "")) string))))) |
| 488 | ;; Translate "swedish" into "sv_SE.ISO-8859-1", and so on, | ||
| 489 | ;; using the translation file that GNU/Linux systems have. | ||
| 490 | (and ctype | ||
| 491 | (not (string-match iso-8859-n-locale-regexp ctype)) | ||
| 492 | (file-exists-p locale-translation-file-name) | ||
| 493 | (with-temp-buffer | ||
| 494 | (insert-file-contents locale-translation-file-name) | ||
| 495 | (if (re-search-forward (concat "^" ctype "[ \t]*") nil t) | ||
| 496 | (setq ctype (buffer-substring (point) | ||
| 497 | (progn (end-of-line) (point))))))) | ||
| 498 | ;; Now see if the locale specifies an ISO 8859 character set. | ||
| 485 | (when (and ctype | 499 | (when (and ctype |
| 486 | (string-match iso-8859-n-locale-regexp ctype)) | 500 | (string-match iso-8859-n-locale-regexp ctype)) |
| 487 | (let (charset (which (match-string 1 ctype))) | 501 | (let (charset (which (match-string 1 ctype))) |