1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-25 10:47:00 +00:00

(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.
This commit is contained in:
Paul Eggert 1998-09-22 06:12:49 +00:00
parent 7d8a6e1fc4
commit 086e079cbe

View File

@ -329,8 +329,19 @@ from being initialized."
string)
:group 'auto-save)
(defvar locale-translation-file-name "/usr/share/locale/locale.alias"
"*File name for the system's file of locale-name aliases.")
(defvar locale-translation-file-name
(let ((files '("/usr/lib/X11/locale/locale.alias" ; e.g. X11R6.4
"/usr/X11R6/lib/X11/locale/locale.alias" ; e.g. RedHat 4.2
"/usr/openwin/lib/locale/locale.alias" ; e.g. Solaris 2.6
;;
;; The following name appears after the X-related names above,
;; since the X-related names are what X actually uses.
"/usr/share/locale/locale.alias" ; GNU/Linux sans X
)))
(while (and files (not (file-exists-p (car files))))
(setq files (cdr files)))
(car files))
"*File name for the system's file of locale-name aliases, or nil if none.")
(defvar init-file-debug nil)
@ -505,11 +516,12 @@ or `CVS', and any subdirectory that contains a file named `.nosearch'."
;; Translate "swedish" into "sv_SE.ISO-8859-1", and so on,
;; using the translation file that GNU/Linux systems have.
(and ctype
locale-translation-file-name
(not (string-match iso-8859-n-locale-regexp ctype))
(file-exists-p locale-translation-file-name)
(with-temp-buffer
(insert-file-contents locale-translation-file-name)
(if (re-search-forward (concat "^" ctype "[ \t]+") nil t)
(if (re-search-forward
(concat "^" (regexp-quote ctype) ":?[ \t]+") nil t)
(setq ctype (buffer-substring (point)
(progn (end-of-line) (point)))))))
;; Now see if the locale specifies an ISO 8859 character set.