bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

emacs 21.0.101 ignores locale-translation-file-name


From: Paul Eggert
Subject: emacs 21.0.101 ignores locale-translation-file-name
Date: Wed, 28 Mar 2001 01:12:39 -0800 (PST)

While proofreading the Emacs 21.0.101 manual for locales, I noticed
that the code currently ignores the value of the
locale-translation-file-name, overwriting it each time.  The manual
doesn't document this variable, so I thought it easiest simply to
leave the manual alone, and remove the variable.  Here is a proposed
patch to do this.  Other than removing the variable and the doc fix,
this shouldn't affect Emacs's behavior.

2001-03-27  Paul Eggert  <eggert@twinsun.com>

        * international/mule-cmds.el (locale-translation-file-name):
        Remove, as the variable's value was being ignored.
        (set-locale-environment): Make locale-translation-file-name local.
        Doc fix to reflect this change.

diff -pru emacs-21.0.101/lisp/international/mule-cmds.el 
emacs-21.0.101-fix/lisp/international/mule-cmds.el
--- emacs-21.0.101/lisp/international/mule-cmds.el      Wed Mar 21 02:16:21 2001
+++ emacs-21.0.101-fix/lisp/international/mule-cmds.el  Tue Mar 27 11:06:01 2001
@@ -1642,9 +1642,6 @@ of buffer-file-coding-system set by this
 
 ;;; Locales.
 
-(defvar locale-translation-file-name nil
-  "File name for the system's file of locale-name aliases, or nil if none.")
-
 (defvar locale-language-names
   '(
     ;; UTF-8 is not yet implemented.
@@ -1876,28 +1873,12 @@ If LOCALE-NAME is nil, its value is take
 
 The locale names supported by your system can typically be found in a
 directory named `/usr/share/locale' or `/usr/lib/locale'.  LOCALE-NAME
-may be translated according to the table specified by
-`locale-translation-file-name'.
+may be translated according to the locale.alias table in that directory,
+or (preferably) in a similar table in your system's X11 locale directory.
 
 See also `locale-charset-language-names', `locale-language-names',
 `locale-preferred-coding-systems' and `locale-coding-system'."
 
-  ;; Do this at runtime for the sake of binaries possibly transported
-  ;; to a system without X.
-  (setq 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)))
-
   (let ((locale locale-name))
 
     (unless locale
@@ -1911,12 +1892,28 @@ See also `locale-charset-language-names'
 
       ;; Translate "swedish" into "sv_SE.ISO8859-1", and so on,
       ;; using the translation file that many systems have.
-      (when locale-translation-file-name
-       (with-temp-buffer
-         (insert-file-contents locale-translation-file-name)
-         (when (re-search-forward
-                (concat "^" (regexp-quote locale) ":?[ \t]+") nil t)
-           (setq locale (buffer-substring (point) (line-end-position))))))
+      ;; Compute the file's name at run time for the sake of binaries
+      ;; possibly transported to a system without X.
+      (let ((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. RH 4.2
+                     "/usr/openwin/lib/locale/locale.alias" ; e.g. SunOS 5.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))))
+       (when locale-translation-file-name
+         (with-temp-buffer
+           (insert-file-contents locale-translation-file-name)
+           (when (re-search-forward
+                  (concat "^" (regexp-quote locale) ":?[ \t]+") nil t)
+             (setq locale (buffer-substring (point) (line-end-position)))))))
 
       ;; Leave the system locales alone if the caller did not specify
       ;; an explicit locale name, as their defaults are set from



reply via email to

[Prev in Thread] Current Thread [Next in Thread]