Revision: miles@gnu.org--gnu-2004/emacs--unicode--0--patch-15
[bpt/emacs.git] / lisp / descr-text.el
index c4758a0..5ce8cab 100644 (file)
@@ -476,16 +476,12 @@ as well as widgets, buttons, overlays, and text properties."
         (multibyte-p enable-multibyte-characters)
         (overlays (mapcar #'(lambda (o) (overlay-properties o))
                           (overlays-at pos)))
-        item-list max-width unicode)
+        item-list max-width code)
 
-    (if (or (< char 256)
-           (memq 'mule-utf-8 (find-coding-systems-region pos (1+ pos)))
-           (get-char-property pos 'untranslated-utf-8))
-       (setq unicode (or (get-char-property pos 'untranslated-utf-8)
-                         (encode-char char 'ucs))))
+    (setq code (encode-char char charset))
     (setq item-list
          `(("character"
-           ,(format "%s (0%o, %d, 0x%x%s)"
+           ,(format "%s (0%o, %d, 0x%x)"
                     (apply 'propertize (if (not multibyte-p)
                                            (single-key-description char)
                                          (if (< char 128)
@@ -493,18 +489,12 @@ as well as widgets, buttons, overlays, and text properties."
                                            (string-to-multibyte
                                             (char-to-string char))))
                            (text-properties-at pos))
-                    char char char
-                    (if unicode
-                        (format ", U+%04X" unicode)
-                      "")))
-           ("charset"
+                    char char char))
+           ("preferred charset"
             ,(symbol-name charset)
             ,(format "(%s)" (charset-description charset)))
            ("code point"
-            ,(let ((split (split-char char)))
-               (if (= (charset-dimension charset) 1)
-                   (format "%d" (nth 1 split))
-                 (format "%d %d" (nth 1 split) (nth 2 split)))))
+            ,(format (if (< code 256) "0x%02X" "0x%04X") code))
            ("syntax"
             ,(let ((syntax (syntax-after pos)))
                (with-temp-buffer
@@ -582,8 +572,7 @@ as well as widgets, buttons, overlays, and text properties."
                    (if display
                        (format "terminal code %s" display)
                      "not encodable for terminal"))))))
-           ,@(let ((unicodedata (and unicode
-                                     (describe-char-unicode-data unicode))))
+           ,@(let ((unicodedata (describe-char-unicode-data char)))
                (if unicodedata
                    (cons (list "Unicode data" " ") unicodedata)))))
     (setq max-width (apply #'max (mapcar #'(lambda (x) (length (car x)))