]> code.delx.au - gnu-emacs/blobdiff - lisp/international/ucs-tables.el
(quail-start-translation): Fix prompt
[gnu-emacs] / lisp / international / ucs-tables.el
index f182b3d1928eb4cbc93f74efe25d0796640962cc..5574cf3d954e6dd18225793e82c863344a656d78 100644 (file)
@@ -1180,7 +1180,9 @@ everything on input operations."
 
   (when for-encode
     ;; Make mule-utf-* encode all characters in ucs-mule-to-mule-unicode.
-    (let ((coding-list '(mule-utf-8 mule-utf-16-be mule-utf-16-le)))
+    (let ((coding-list '(mule-utf-8 mule-utf-16be mule-utf-16le
+                                   mule-utf-16be-with-signature
+                                   mule-utf-16le-with-signature)))
       (define-translation-table 'utf-translation-table-for-encode
        ucs-mule-to-mule-unicode)
       (dolist (coding coding-list)
@@ -1219,7 +1221,9 @@ unification on input operations."
     ;; ucs-mule-to-mule-unicode except what was originally supported
     ;; and what is translated by utf-translation-table-for-decode when
     ;; `utf-fragment-on-decoding' is non-nil.
-    (let ((coding-list '(mule-utf-8 mule-utf-16-be mule-utf-16-le))
+    (let ((coding-list '(mule-utf-8 mule-utf-16be mule-utf-16le
+                                   mule-utf-16be-with-signature
+                                   mule-utf-16le-with-signature))
          (safe (coding-system-get 'mule-utf-8 'safe-chars)))
       (dolist (coding coding-list)
        (set-char-table-parent (coding-system-get coding 'safe-chars) nil))
@@ -1243,12 +1247,14 @@ unification on input operations."
   "Insert the Emacs character representation of the given Unicode.
 Interactively, prompts for a hex string giving the code."
   (interactive "sUnicode (hex): ")
-  (let ((c (decode-char 'ucs (if (integerp arg)
-                                arg
-                              (string-to-number arg 16)))))
+  (or (integerp arg)
+      (setq arg (string-to-number arg 16)))
+  (let ((c (decode-char 'ucs arg)))
     (if c
        (insert c)
-      (error "Character can't be decoded to UCS"))))
+      (if (or (< arg 0) (> arg #x10FFFF))
+         (error "Not a Unicode character code: 0x%X" arg)
+       (error "Character U+%04X is not yet supported" arg)))))
 
 ;;; Dealing with non-8859 character sets.
 
@@ -2503,6 +2509,8 @@ BUFFER defaults to the current buffer."
                     (coding-system-base default-buffer-file-coding-system))))
       (when cs
        (setq table (coding-system-get cs 'translation-table-for-encode))
+       (if (and table (symbolp table))
+           (setq table (get table 'translation-table)))
        (unless (char-table-p table)
          (setq table (coding-system-get cs 'translation-table-for-input)))
        (when (char-table-p table)
@@ -2527,4 +2535,5 @@ Intended to be added to `minibuffer-setup-hook'."
 
 (provide 'ucs-tables)
 
+;;; arch-tag: b497e22b-7fe1-486a-9352-e2d7f7d76a76
 ;;; ucs-tables.el ends here