diff options
| author | Eli Zaretskii | 2011-10-13 13:58:54 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2011-10-13 13:58:54 +0200 |
| commit | 12587bbbc6477b48ab766ae43381120ce3cfcc9e (patch) | |
| tree | 671f3846edb2e1845713e5f95a6967b447583270 /lisp | |
| parent | d4172c3be980b14b640da20f3ed6fa723273e735 (diff) | |
| download | emacs-12587bbbc6477b48ab766ae43381120ce3cfcc9e.tar.gz emacs-12587bbbc6477b48ab766ae43381120ce3cfcc9e.zip | |
Fix the "C-x =" display of the character info for LRE, LRO, RLE, and RLO.
lisp/simple.el (what-cursor-position): Fix the display of the
character info for LRE, LRO, RLE, and RLO characters, by appending a
PDF to them.
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/simple.el | 18 |
2 files changed, 19 insertions, 4 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 1ec96318116..39f13eb8db8 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2011-10-13 Eli Zaretskii <eliz@gnu.org> | ||
| 2 | |||
| 3 | * simple.el (what-cursor-position): Fix the display of the | ||
| 4 | character info for LRE, LRO, RLE, and RLO characters. | ||
| 5 | |||
| 1 | 2011-10-13 Stefan Monnier <monnier@iro.umontreal.ca> | 6 | 2011-10-13 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 7 | ||
| 3 | * emacs-lisp/timer.el (with-timeout): Make sure we cancel the timer | 8 | * emacs-lisp/timer.el (with-timeout): Make sure we cancel the timer |
diff --git a/lisp/simple.el b/lisp/simple.el index af6d855d9c0..6d0e7543549 100644 --- a/lisp/simple.el +++ b/lisp/simple.el | |||
| @@ -1050,6 +1050,16 @@ In addition, with prefix argument, show details about that character | |||
| 1050 | in *Help* buffer. See also the command `describe-char'." | 1050 | in *Help* buffer. See also the command `describe-char'." |
| 1051 | (interactive "P") | 1051 | (interactive "P") |
| 1052 | (let* ((char (following-char)) | 1052 | (let* ((char (following-char)) |
| 1053 | ;; If the character is one of LRE, LRO, RLE, RLO, it will | ||
| 1054 | ;; start a directional embedding, which could completely | ||
| 1055 | ;; disrupt the rest of the line (e.g., RLO will display the | ||
| 1056 | ;; rest of the line right-to-left). So we put an invisible | ||
| 1057 | ;; PDF character after these characters, to end the | ||
| 1058 | ;; embedding, which eliminates any effects on the rest of the | ||
| 1059 | ;; line. | ||
| 1060 | (pdf (if (memq char '(?\x202a ?\x202b ?\x202d ?\x202e)) | ||
| 1061 | (propertize (string ?\x202c) 'invisible t) | ||
| 1062 | "")) | ||
| 1053 | (beg (point-min)) | 1063 | (beg (point-min)) |
| 1054 | (end (point-max)) | 1064 | (end (point-max)) |
| 1055 | (pos (point)) | 1065 | (pos (point)) |
| @@ -1109,18 +1119,18 @@ in *Help* buffer. See also the command `describe-char'." | |||
| 1109 | ;; We show the detailed information about CHAR. | 1119 | ;; We show the detailed information about CHAR. |
| 1110 | (describe-char (point))) | 1120 | (describe-char (point))) |
| 1111 | (if (or (/= beg 1) (/= end (1+ total))) | 1121 | (if (or (/= beg 1) (/= end (1+ total))) |
| 1112 | (message "Char: %s %s point=%d of %d (%d%%) <%d-%d> column=%d%s" | 1122 | (message "Char: %s%s %s point=%d of %d (%d%%) <%d-%d> column=%d%s" |
| 1113 | (if (< char 256) | 1123 | (if (< char 256) |
| 1114 | (single-key-description char) | 1124 | (single-key-description char) |
| 1115 | (buffer-substring-no-properties (point) (1+ (point)))) | 1125 | (buffer-substring-no-properties (point) (1+ (point)))) |
| 1116 | encoding-msg pos total percent beg end col hscroll) | 1126 | pdf encoding-msg pos total percent beg end col hscroll) |
| 1117 | (message "Char: %s %s point=%d of %d (%d%%) column=%d%s" | 1127 | (message "Char: %s%s %s point=%d of %d (%d%%) column=%d%s" |
| 1118 | (if enable-multibyte-characters | 1128 | (if enable-multibyte-characters |
| 1119 | (if (< char 128) | 1129 | (if (< char 128) |
| 1120 | (single-key-description char) | 1130 | (single-key-description char) |
| 1121 | (buffer-substring-no-properties (point) (1+ (point)))) | 1131 | (buffer-substring-no-properties (point) (1+ (point)))) |
| 1122 | (single-key-description char)) | 1132 | (single-key-description char)) |
| 1123 | encoding-msg pos total percent col hscroll)))))) | 1133 | pdf encoding-msg pos total percent col hscroll)))))) |
| 1124 | 1134 | ||
| 1125 | ;; Initialize read-expression-map. It is defined at C level. | 1135 | ;; Initialize read-expression-map. It is defined at C level. |
| 1126 | (let ((m (make-sparse-keymap))) | 1136 | (let ((m (make-sparse-keymap))) |