diff options
| author | Paul Eggert | 1998-09-22 06:12:49 +0000 |
|---|---|---|
| committer | Paul Eggert | 1998-09-22 06:12:49 +0000 |
| commit | 086e079cbec54126054a16e4c6d65e131697ddac (patch) | |
| tree | 9b56c41e7f42cee3685b078d268831b26ba65963 | |
| parent | 7d8a6e1fc4ace52718ecab389e9b9532b9d36080 (diff) | |
| download | emacs-086e079cbec54126054a16e4c6d65e131697ddac.tar.gz emacs-086e079cbec54126054a16e4c6d65e131697ddac.zip | |
(locale-translation-file-name): Prefer X-related names
to the name used by GNU/Linux sans X. Set to nil if no file found.
(command-line): Use locale-translation-file-name if it is not nil,
instead of testing for its existence again.
regexp-quote the ctype before using it in a regexp.
Allow a colon to appear after the ctype in the aliases file,
as is done in X11R6.4.
| -rw-r--r-- | lisp/startup.el | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/lisp/startup.el b/lisp/startup.el index 87aa10d5c20..4ce11931ab8 100644 --- a/lisp/startup.el +++ b/lisp/startup.el | |||
| @@ -329,8 +329,19 @@ 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" | 332 | (defvar locale-translation-file-name |
| 333 | "*File name for the system's file of locale-name aliases.") | 333 | (let ((files '("/usr/lib/X11/locale/locale.alias" ; e.g. X11R6.4 |
| 334 | "/usr/X11R6/lib/X11/locale/locale.alias" ; e.g. RedHat 4.2 | ||
| 335 | "/usr/openwin/lib/locale/locale.alias" ; e.g. Solaris 2.6 | ||
| 336 | ;; | ||
| 337 | ;; The following name appears after the X-related names above, | ||
| 338 | ;; since the X-related names are what X actually uses. | ||
| 339 | "/usr/share/locale/locale.alias" ; GNU/Linux sans X | ||
| 340 | ))) | ||
| 341 | (while (and files (not (file-exists-p (car files)))) | ||
| 342 | (setq files (cdr files))) | ||
| 343 | (car files)) | ||
| 344 | "*File name for the system's file of locale-name aliases, or nil if none.") | ||
| 334 | 345 | ||
| 335 | (defvar init-file-debug nil) | 346 | (defvar init-file-debug nil) |
| 336 | 347 | ||
| @@ -505,11 +516,12 @@ or `CVS', and any subdirectory that contains a file named `.nosearch'." | |||
| 505 | ;; Translate "swedish" into "sv_SE.ISO-8859-1", and so on, | 516 | ;; Translate "swedish" into "sv_SE.ISO-8859-1", and so on, |
| 506 | ;; using the translation file that GNU/Linux systems have. | 517 | ;; using the translation file that GNU/Linux systems have. |
| 507 | (and ctype | 518 | (and ctype |
| 519 | locale-translation-file-name | ||
| 508 | (not (string-match iso-8859-n-locale-regexp ctype)) | 520 | (not (string-match iso-8859-n-locale-regexp ctype)) |
| 509 | (file-exists-p locale-translation-file-name) | ||
| 510 | (with-temp-buffer | 521 | (with-temp-buffer |
| 511 | (insert-file-contents locale-translation-file-name) | 522 | (insert-file-contents locale-translation-file-name) |
| 512 | (if (re-search-forward (concat "^" ctype "[ \t]+") nil t) | 523 | (if (re-search-forward |
| 524 | (concat "^" (regexp-quote ctype) ":?[ \t]+") nil t) | ||
| 513 | (setq ctype (buffer-substring (point) | 525 | (setq ctype (buffer-substring (point) |
| 514 | (progn (end-of-line) (point))))))) | 526 | (progn (end-of-line) (point))))))) |
| 515 | ;; Now see if the locale specifies an ISO 8859 character set. | 527 | ;; Now see if the locale specifies an ISO 8859 character set. |