From: Richard M. Stallman Date: Thu, 14 May 1998 03:55:13 +0000 (+0000) Subject: (locale-translation-file-name): New variable. X-Git-Tag: emacs-20.3~1020 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=cbe9a46020c7c508624f8262f6b47d776839845f;p=emacs.git (locale-translation-file-name): New variable. (command-line): Use it to decode locale aliases. --- 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." 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 init-file-debug nil) (defvar init-file-had-error nil) @@ -482,6 +485,17 @@ and any subdirectory that contains a file named `.nosearch'." (and (not (equal string "")) string)) (let ((string (getenv "LANG"))) (and (not (equal string "")) string))))) + ;; Translate "swedish" into "sv_SE.ISO-8859-1", and so on, + ;; using the translation file that GNU/Linux systems have. + (and ctype + (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) + (setq ctype (buffer-substring (point) + (progn (end-of-line) (point))))))) + ;; Now see if the locale specifies an ISO 8859 character set. (when (and ctype (string-match iso-8859-n-locale-regexp ctype)) (let (charset (which (match-string 1 ctype)))