]> git.eshelyaron.com Git - emacs.git/commitdiff
(what-cursor-position): If the character is displayed
authorKenichi Handa <handa@m17n.org>
Thu, 6 Oct 2005 06:57:41 +0000 (06:57 +0000)
committerKenichi Handa <handa@m17n.org>
Thu, 6 Oct 2005 06:57:41 +0000 (06:57 +0000)
by some `display' text property, show that.  Don't use
single-key-description for eight-bit characters in multibyte mode.

lisp/ChangeLog
lisp/simple.el

index ec06f7d42073c84290ad211fc9f710ab06910b26..f0a046c363d4cbb0d081b605345d8e5b29ddca2b 100644 (file)
@@ -1,3 +1,9 @@
+2005-10-06  Kenichi Handa  <handa@m17n.org>
+
+       * simple.el (what-cursor-position): If the character is displayed
+       by some `display' text property, show that.  Don't use
+       single-key-description for eight-bit characters in multibyte mode.
+
 2005-10-06  Nick Roberts  <nickrob@snap.net.nz>
 
        * progmodes/gdb-ui.el (gdb-fringe-width): New variable.
index 96ca1cc7ea1ef163e657b71c0b24e3892885c148..cab04c135d9bfb9009e98a684c8656738f904f76 100644 (file)
@@ -896,22 +896,42 @@ in *Help* buffer.  See also the command `describe-char'."
          (message "point=%d of %d (%d%%) column %d %s"
                   pos total percent col hscroll))
       (let ((coding buffer-file-coding-system)
-           encoded encoding-msg)
+           encoded encoding-msg display-prop under-display)
        (if (or (not coding)
                (eq (coding-system-type coding) t))
            (setq coding default-buffer-file-coding-system))
        (if (not (char-valid-p char))
            (setq encoding-msg
                  (format "(0%o, %d, 0x%x, invalid)" char char char))
-         (setq encoded (and (>= char 128) (encode-coding-char char coding)))
+         ;; Check if the character is displayed with some `display'
+         ;; text property.  In that case, set under-display to the
+         ;; buffer substring covered by that property.
+         (setq display-prop (get-text-property pos 'display))
+         (if display-prop
+             (let ((to (or (next-single-property-change pos 'display)
+                           (point-max))))
+               (if (< to (+ pos 4))
+                   (setq under-display "")
+                 (setq under-display "..."
+                       to (+ pos 4)))
+               (setq under-display
+                     (concat (buffer-substring-no-properties pos to)
+                             under-display)))
+           (setq encoded (and (>= char 128) (encode-coding-char char coding))))
          (setq encoding-msg
-               (if encoded
-                   (format "(0%o, %d, 0x%x, file %s)"
-                           char char char
-                           (if (> (length encoded) 1)
-                               "..."
-                             (encoded-string-description encoded coding)))
-                 (format "(0%o, %d, 0x%x)" char char char))))
+               (if display-prop
+                   (if (not (stringp display-prop))
+                       (format "(0%o, %d, 0x%x, part of display \"%s\")"
+                               char char char under-display)
+                     (format "(0%o, %d, 0x%x, part of display \"%s\"->\"%s\")"
+                             char char char under-display display-prop))
+                 (if encoded
+                     (format "(0%o, %d, 0x%x, file %s)"
+                             char char char
+                             (if (> (length encoded) 1)
+                                 "..."
+                               (encoded-string-description encoded coding)))
+                   (format "(0%o, %d, 0x%x)" char char char)))))
        (if detail
            ;; We show the detailed information about CHAR.
            (describe-char (point)))
@@ -922,9 +942,11 @@ in *Help* buffer.  See also the command `describe-char'."
                       (buffer-substring-no-properties (point) (1+ (point))))
                     encoding-msg pos total percent beg end col hscroll)
          (message "Char: %s %s point=%d of %d (%d%%) column %d %s"
-                  (if (< char 256)
-                      (single-key-description char)
-                    (buffer-substring-no-properties (point) (1+ (point))))
+                  (if enable-multibyte-characters
+                      (if (< char 128)
+                          (single-key-description char)
+                        (buffer-substring-no-properties (point) (1+ (point))))
+                    (single-key-description char))
                   encoding-msg pos total percent col hscroll))))))
 \f
 (defvar read-expression-map