896 |
(message "point=%d of %d (%d%%) column %d %s" |
(message "point=%d of %d (%d%%) column %d %s" |
897 |
pos total percent col hscroll)) |
pos total percent col hscroll)) |
898 |
(let ((coding buffer-file-coding-system) |
(let ((coding buffer-file-coding-system) |
899 |
encoded encoding-msg) |
encoded encoding-msg display-prop under-display) |
900 |
(if (or (not coding) |
(if (or (not coding) |
901 |
(eq (coding-system-type coding) t)) |
(eq (coding-system-type coding) t)) |
902 |
(setq coding default-buffer-file-coding-system)) |
(setq coding default-buffer-file-coding-system)) |
903 |
(if (not (char-valid-p char)) |
(if (not (char-valid-p char)) |
904 |
(setq encoding-msg |
(setq encoding-msg |
905 |
(format "(0%o, %d, 0x%x, invalid)" char char char)) |
(format "(0%o, %d, 0x%x, invalid)" char char char)) |
906 |
(setq encoded (and (>= char 128) (encode-coding-char char coding))) |
;; 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)))) |
921 |
(setq encoding-msg |
(setq encoding-msg |
922 |
(if encoded |
(if display-prop |
923 |
(format "(0%o, %d, 0x%x, file %s)" |
(if (not (stringp display-prop)) |
924 |
char char char |
(format "(0%o, %d, 0x%x, part of display \"%s\")" |
925 |
(if (> (length encoded) 1) |
char char char under-display) |
926 |
"..." |
(format "(0%o, %d, 0x%x, part of display \"%s\"->\"%s\")" |
927 |
(encoded-string-description encoded coding))) |
char char char under-display display-prop)) |
928 |
(format "(0%o, %d, 0x%x)" char char char)))) |
(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))))) |
935 |
(if detail |
(if detail |
936 |
;; We show the detailed information about CHAR. |
;; We show the detailed information about CHAR. |
937 |
(describe-char (point))) |
(describe-char (point))) |
942 |
(buffer-substring-no-properties (point) (1+ (point)))) |
(buffer-substring-no-properties (point) (1+ (point)))) |
943 |
encoding-msg pos total percent beg end col hscroll) |
encoding-msg pos total percent beg end col hscroll) |
944 |
(message "Char: %s %s point=%d of %d (%d%%) column %d %s" |
(message "Char: %s %s point=%d of %d (%d%%) column %d %s" |
945 |
(if (< char 256) |
(if enable-multibyte-characters |
946 |
(single-key-description char) |
(if (< char 128) |
947 |
(buffer-substring-no-properties (point) (1+ (point)))) |
(single-key-description char) |
948 |
|
(buffer-substring-no-properties (point) (1+ (point)))) |
949 |
|
(single-key-description char)) |
950 |
encoding-msg pos total percent col hscroll)))))) |
encoding-msg pos total percent col hscroll)))))) |
951 |
|
|
952 |
(defvar read-expression-map |
(defvar read-expression-map |