]> code.delx.au - gnu-emacs/blobdiff - lisp/international/mule-cmds.el
Merged from emacs@sv.gnu.org
[gnu-emacs] / lisp / international / mule-cmds.el
index 232dc721aec910ad85d357a6e87131f5f7b50a42..8e63729b7a5c17beaf87f0d03798b8a494398ba9 100644 (file)
@@ -1126,6 +1126,13 @@ For a list of useful values for KEY and their meanings,
 see `language-info-alist'."
   (if (symbolp lang-env)
       (setq lang-env (symbol-name lang-env)))
+  (set-language-info-internal lang-env key info)
+  (if (equal lang-env current-language-environment)
+      (set-language-environment lang-env)))
+
+(defun set-language-info-internal (lang-env key info)
+  "Internal use only.
+Arguments are the same as `set-language-info'."
   (let (lang-slot key-slot)
     (setq lang-slot (assoc lang-env language-info-alist))
     (if (null lang-slot)               ; If no slot for the language, add it.
@@ -1196,9 +1203,11 @@ in the European submenu in each of those two menus."
     (define-key-after setup-map (vector (intern lang-env))
       (cons lang-env 'setup-specified-language-environment) t)
 
-    (while alist
-      (set-language-info lang-env (car (car alist)) (cdr (car alist)))
-      (setq alist (cdr alist)))))
+    (dolist (elt alist)
+      (set-language-info-internal lang-env (car elt) (cdr elt)))
+    
+    (if (equal lang-env current-language-environment)
+       (set-language-environment lang-env))))
 
 (defun read-language-name (key prompt &optional default)
   "Read a language environment name which has information for KEY.
@@ -1789,7 +1798,9 @@ The default status is as follows:
 (defun set-display-table-and-terminal-coding-system (language-name &optional coding-system display)
   "Set up the display table and terminal coding system for LANGUAGE-NAME."
   (let ((coding (get-language-info language-name 'unibyte-display)))
-    (if coding
+    (if (and coding
+            (or (not coding-system)
+                (coding-system-equal coding coding-system)))
        (standard-display-european-internal)
       ;; The following 2 lines undo the 8-bit display that we set up
       ;; in standard-display-european-internal, which see.  This is in
@@ -2129,7 +2140,7 @@ of `buffer-file-coding-system' set by this function."
     ;; That's actually what the GNU locales define, modulo things like
     ;; en_IN -- fx.
     ("en_IN" "English" utf-8) ; glibc uses utf-8 for English in India
-    ("en" . "Latin-1") ; English
+    ("en" "English" iso-8859-1) ; English
     ("eo" . "Latin-3") ; Esperanto
     ("es" "Spanish" iso-8859-1)
     ("et" . "Latin-1") ; Estonian
@@ -2429,7 +2440,8 @@ See also `locale-charset-language-names', `locale-language-names',
   ;; to a system without X.
   (setq locale-translation-file-name
        (let ((files
-              '("/usr/lib/X11/locale/locale.alias" ; e.g. X11R6.4
+              '("/usr/share/X11/locale/locale.alias" ; e.g. X11R7
+                "/usr/lib/X11/locale/locale.alias" ; e.g. X11R6.4
                 "/usr/X11R6/lib/X11/locale/locale.alias" ; XFree86, e.g. RedHat 4.2
                 "/usr/openwin/lib/locale/locale.alias" ; e.g. Solaris 2.6
                 ;;
@@ -2449,7 +2461,7 @@ See also `locale-charset-language-names', `locale-language-names',
       (let ((vars '("LC_ALL" "LC_CTYPE" "LANG")))
        (while (and vars
                    (= 0 (length locale))) ; nil or empty string
-         (setq locale (server-getenv (pop vars))))))
+         (setq locale (getenv (pop vars) display)))))
 
     (unless locale
       ;; The two tests are kept separate so the byte-compiler sees
@@ -2562,7 +2574,7 @@ See also `locale-charset-language-names', `locale-language-names',
       ;; Mac OS X's Terminal.app by default uses utf-8 regardless of
       ;; the locale.
       (when (and (null window-system)
-                (equal (server-getenv "TERM_PROGRAM") "Apple_Terminal"))
+                (equal (getenv "TERM_PROGRAM" display) "Apple_Terminal"))
        (set-terminal-coding-system 'utf-8)
        (set-keyboard-coding-system 'utf-8)))
 
@@ -2580,7 +2592,7 @@ See also `locale-charset-language-names', `locale-language-names',
              (setq ps-paper-type 'a4)))
          (let ((vars '("LC_ALL" "LC_PAPER" "LANG")))
            (while (and vars (= 0 (length locale)))
-             (setq locale (server-getenv (pop vars)))))
+             (setq locale (getenv (pop vars) display))))
          (when locale
            ;; As of glibc 2.2.5, these are the only US Letter locales,
            ;; and the rest are A4.
@@ -2659,8 +2671,8 @@ It can be retrieved with `(get-char-code-property CHAR PROPNAME)'."
    (if (and coding-system (eq (coding-system-type coding-system) 2))
        ;; Try to get a pretty description for ISO 2022 escape sequences.
        (function (lambda (x) (or (cdr (assq x iso-2022-control-alist))
-                                (format "0x%02X" x))))
-     (function (lambda (x) (format "0x%02X" x))))
+                                (format "#x%02X" x))))
+     (function (lambda (x) (format "#x%02X" x))))
    str " "))
 
 (defun encode-coding-char (char coding-system)