aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKenichi Handa2005-10-06 06:57:41 +0000
committerKenichi Handa2005-10-06 06:57:41 +0000
commita41b50cadd056bc6f851c03ad7aa751d42d66d41 (patch)
tree05c45697ed9e9605614bf34d296c6f06009e3ea8
parent475a41c957e354e9be67fb061f0249a6c54e2401 (diff)
downloademacs-a41b50cadd056bc6f851c03ad7aa751d42d66d41.tar.gz
emacs-a41b50cadd056bc6f851c03ad7aa751d42d66d41.zip
(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.
-rw-r--r--lisp/ChangeLog6
-rw-r--r--lisp/simple.el46
2 files changed, 40 insertions, 12 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index ec06f7d4207..f0a046c363d 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,9 @@
12005-10-06 Kenichi Handa <handa@m17n.org>
2
3 * simple.el (what-cursor-position): If the character is displayed
4 by some `display' text property, show that. Don't use
5 single-key-description for eight-bit characters in multibyte mode.
6
12005-10-06 Nick Roberts <nickrob@snap.net.nz> 72005-10-06 Nick Roberts <nickrob@snap.net.nz>
2 8
3 * progmodes/gdb-ui.el (gdb-fringe-width): New variable. 9 * progmodes/gdb-ui.el (gdb-fringe-width): New variable.
diff --git a/lisp/simple.el b/lisp/simple.el
index 96ca1cc7ea1..cab04c135d9 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -896,22 +896,42 @@ in *Help* buffer. See also the command `describe-char'."
896 (message "point=%d of %d (%d%%) column %d %s" 896 (message "point=%d of %d (%d%%) column %d %s"
897 pos total percent col hscroll)) 897 pos total percent col hscroll))
898 (let ((coding buffer-file-coding-system) 898 (let ((coding buffer-file-coding-system)
899 encoded encoding-msg) 899 encoded encoding-msg display-prop under-display)
900 (if (or (not coding) 900 (if (or (not coding)
901 (eq (coding-system-type coding) t)) 901 (eq (coding-system-type coding) t))
902 (setq coding default-buffer-file-coding-system)) 902 (setq coding default-buffer-file-coding-system))
903 (if (not (char-valid-p char)) 903 (if (not (char-valid-p char))
904 (setq encoding-msg 904 (setq encoding-msg
905 (format "(0%o, %d, 0x%x, invalid)" char char char)) 905 (format "(0%o, %d, 0x%x, invalid)" char char char))
906 (setq encoded (and (>= char 128) (encode-coding-char char coding))) 906 ;; Check if the character is displayed with some `display'
907 ;; text property. In that case, set under-display to the
908 ;; buffer substring covered by that property.
909 (setq display-prop (get-text-property pos 'display))
910 (if display-prop
911 (let ((to (or (next-single-property-change pos 'display)
912 (point-max))))
913 (if (< to (+ pos 4))
914 (setq under-display "")
915 (setq under-display "..."
916 to (+ pos 4)))
917 (setq under-display
918 (concat (buffer-substring-no-properties pos to)
919 under-display)))
920 (setq encoded (and (>= char 128) (encode-coding-char char coding))))
907 (setq encoding-msg 921 (setq encoding-msg
908 (if encoded 922 (if display-prop
909 (format "(0%o, %d, 0x%x, file %s)" 923 (if (not (stringp display-prop))
910 char char char 924 (format "(0%o, %d, 0x%x, part of display \"%s\")"
911 (if (> (length encoded) 1) 925 char char char under-display)
912 "..." 926 (format "(0%o, %d, 0x%x, part of display \"%s\"->\"%s\")"
913 (encoded-string-description encoded coding))) 927 char char char under-display display-prop))
914 (format "(0%o, %d, 0x%x)" char char char)))) 928 (if encoded
929 (format "(0%o, %d, 0x%x, file %s)"
930 char char char
931 (if (> (length encoded) 1)
932 "..."
933 (encoded-string-description encoded coding)))
934 (format "(0%o, %d, 0x%x)" char char char)))))
915 (if detail 935 (if detail
916 ;; We show the detailed information about CHAR. 936 ;; We show the detailed information about CHAR.
917 (describe-char (point))) 937 (describe-char (point)))
@@ -922,9 +942,11 @@ in *Help* buffer. See also the command `describe-char'."
922 (buffer-substring-no-properties (point) (1+ (point)))) 942 (buffer-substring-no-properties (point) (1+ (point))))
923 encoding-msg pos total percent beg end col hscroll) 943 encoding-msg pos total percent beg end col hscroll)
924 (message "Char: %s %s point=%d of %d (%d%%) column %d %s" 944 (message "Char: %s %s point=%d of %d (%d%%) column %d %s"
925 (if (< char 256) 945 (if enable-multibyte-characters
926 (single-key-description char) 946 (if (< char 128)
927 (buffer-substring-no-properties (point) (1+ (point)))) 947 (single-key-description char)
948 (buffer-substring-no-properties (point) (1+ (point))))
949 (single-key-description char))
928 encoding-msg pos total percent col hscroll)))))) 950 encoding-msg pos total percent col hscroll))))))
929 951
930(defvar read-expression-map 952(defvar read-expression-map