]> code.delx.au - gnu-emacs/blobdiff - lisp/international/mule-cmds.el
Merge changes from emacs-23 branch.
[gnu-emacs] / lisp / international / mule-cmds.el
index c21bfb23ba96dab768003123bcb9ab1fe11849b4..a3609c0ccfc053936b40141d87ccca78e278ac60 100644 (file)
 
     (define-key-after map [describe-language-environment]
       `(menu-item ,(purecopy "Describe Language Environment")
-            describe-language-environment-map
+            ,describe-language-environment-map
             :help ,(purecopy "Show multilingual settings for a specific language")))
     (define-key-after map [describe-input-method]
       `(menu-item ,(purecopy "Describe Input Method...") describe-input-method
@@ -226,19 +226,22 @@ how text is formatted automatically while decoding."
 ;; and delimiter characters.  Support function of
 ;; coding-system-from-name.
 (defun canonicalize-coding-system-name (name)
-  (if (string-match "^iso[-_ ]?[0-9]" name)
-      ;; "iso-8859-1" -> "8859-1", "iso-2022-jp" ->"2022-jp"
-      (setq name (substring name (1- (match-end 0)))))
-  (let ((idx (string-match "[-_ /]" name)))
-    ;; Delete "-", "_", " ", "/" but do distinguish "16-be" and "16be".
-    (while idx
-      (if (and (>= idx 2)
-              (eq (string-match "16-[lb]e$" name (- idx 2))
-                  (- idx 2)))
-         (setq idx (string-match "[-_ /]" name (match-end 0)))
-       (setq name (concat (substring name 0 idx) (substring name (1+ idx)))
-             idx (string-match "[-_ /]" name idx))))
-    name))
+  (if (string-match "^\\(ms\\|ibm\\|windows-\\)\\([0-9]+\\)$" name)
+      ;; "ms950", "ibm950", "windows-950" -> "cp950"
+      (concat "cp" (match-string 2 name))
+    (if (string-match "^iso[-_ ]?[0-9]" name)
+       ;; "iso-8859-1" -> "8859-1", "iso-2022-jp" ->"2022-jp"
+       (setq name (substring name (1- (match-end 0)))))
+    (let ((idx (string-match "[-_ /]" name)))
+      ;; Delete "-", "_", " ", "/" but do distinguish "16-be" and "16be".
+      (while idx
+       (if (and (>= idx 2)
+                (eq (string-match "16-[lb]e$" name (- idx 2))
+                    (- idx 2)))
+           (setq idx (string-match "[-_ /]" name (match-end 0)))
+         (setq name (concat (substring name 0 idx) (substring name (1+ idx)))
+               idx (string-match "[-_ /]" name idx))))
+      name)))
 
 (defun coding-system-from-name (name)
   "Return a coding system whose name matches with NAME (string or symbol)."
@@ -283,9 +286,8 @@ wrong, use this command again to toggle back to the right mode."
   "Display the HELLO file, which lists many languages and characters."
   (interactive)
   ;; We have to decode the file in any environment.
-  (letf (((default-value 'enable-multibyte-characters) t)
-        (coding-system-for-read 'iso-2022-7bit))
-       (view-file (expand-file-name "HELLO" data-directory))))
+  (letf ((coding-system-for-read 'iso-2022-7bit))
+    (view-file (expand-file-name "HELLO" data-directory))))
 
 (defun universal-coding-system-argument (coding-system)
   "Execute an I/O command using the specified coding system."
@@ -1950,7 +1952,7 @@ See `set-language-info-alist' for use in programs."
                     (> (aref (number-to-string (nth 2 (x-server-version))) 0)
                        ?3))
          ;; Make non-line-break space display as a plain space.
-         (aset standard-display-table 160 [32]))
+         (aset standard-display-table (unibyte-char-to-multibyte 160) [32]))
        ;; Most Windows programs send out apostrophes as \222.  Most X fonts
        ;; don't contain a character at that position.  Map it to the ASCII
        ;; apostrophe.  [This is actually RIGHT SINGLE QUOTATION MARK,
@@ -1958,7 +1960,7 @@ See `set-language-info-alist' for use in programs."
        ;; fonts probably have the appropriate glyph at this position,
        ;; so they could use standard-display-8bit.  It's better to use a
        ;; proper windows-1252 coding system.  --fx]
-       (aset standard-display-table 146 [39]))))
+       (aset standard-display-table (unibyte-char-to-multibyte 146) [39]))))
 
 (defun set-language-environment-coding-systems (language-name)
   "Do various coding system setups for language environment LANGUAGE-NAME."
@@ -2177,7 +2179,7 @@ See `set-language-info-alist' for use in programs."
     ("af" . "Latin-1") ; Afrikaans
     ("am" "Ethiopic" utf-8) ; Amharic
     ("an" . "Latin-9") ; Aragonese
-    ; ar Arabic glibc uses 8859-6
+    ("ar" . "Arabic")
     ; as Assamese
     ; ay Aymara
     ("az" . "UTF-8") ; Azerbaijani
@@ -2880,8 +2882,10 @@ on encoding."
   :group 'mule
   :global t)
 
-(defvar nonascii-insert-offset 0 "This variable is obsolete.")
-(defvar nonascii-translation-table nil "This variable is obsolete.")
+(defvar nonascii-insert-offset 0)
+(make-obsolete-variable 'nonascii-insert-offset "do not use it." "23.1")
+(defvar nonascii-translation-table nil)
+(make-obsolete-variable 'nonascii-translation-table "do not use it." "23.1")
 
 (defvar ucs-names nil
   "Alist of cached (CHAR-NAME . CHAR-CODE) pairs.")
@@ -2891,17 +2895,21 @@ on encoding."
   (or ucs-names
       (let ((bmp-ranges
             '((#x0000 . #x33FF)
-              ;; (#x3400 . #x4DBF) CJK Ideograph Extension A
+              ;; (#x3400 . #x4DBF) CJK Ideographs Extension A
               (#x4DC0 . #x4DFF)
-              ;; (#x4E00 . #x9FFF) CJK Ideograph
-              (#xA000 . #x0D7FF)
+              ;; (#x4E00 . #x9FFF) CJK Unified Ideographs
+              (#xA000 . #xD7FF)
               ;; (#xD800 . #xFAFF) Surrogate/Private
               (#xFB00 . #xFFFD)))
            (upper-ranges
             '((#x10000 . #x134FF)
-              ;; (#x13500 . #x1CFFF) unsed
+              ;; (#x13500 . #x167FF) unused
+              (#x16800 . #x16A3F)
+              ;; (#x16A40 . #x1AFFF) unused
+              (#x1B000 . #x1B0FF)
+              ;; (#x1B100 . #x1CFFF) unused
               (#x1D000 . #x1FFFF)
-              ;; (#x20000 . #xDFFFF) CJK Ideograph Extension A, B, etc, unsed
+              ;; (#x20000 . #xDFFFF) CJK Ideograph Extension A, B, etc, unused
               (#xE0000 . #xE01FF)))
            (gc-cons-threshold 10000000)
            c end name names)