diff options
| author | Kenichi Handa | 2004-01-16 00:35:16 +0000 |
|---|---|---|
| committer | Kenichi Handa | 2004-01-16 00:35:16 +0000 |
| commit | b242d1fa98144945ee4fbb04e6950ee4a204ceda (patch) | |
| tree | 7091328b4c748cbf4a2b7dabe40fae621b0ff85c | |
| parent | c30686b7aa0633991f1f2477e5bb766d04ee6695 (diff) | |
| download | emacs-b242d1fa98144945ee4fbb04e6950ee4a204ceda.tar.gz emacs-b242d1fa98144945ee4fbb04e6950ee4a204ceda.zip | |
(describe-char): Check `charset' property.
Show the code point in the charset in hexadigits.
| -rw-r--r-- | lisp/descr-text.el | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lisp/descr-text.el b/lisp/descr-text.el index c65043f86cf..47e18751c95 100644 --- a/lisp/descr-text.el +++ b/lisp/descr-text.el | |||
| @@ -446,13 +446,15 @@ as well as widgets, buttons, overlays, and text properties." | |||
| 446 | (if (>= pos (point-max)) | 446 | (if (>= pos (point-max)) |
| 447 | (error "No character follows specified position")) | 447 | (error "No character follows specified position")) |
| 448 | (let* ((char (char-after pos)) | 448 | (let* ((char (char-after pos)) |
| 449 | (charset (char-charset char)) | 449 | (charset (get-char-property pos 'charset)) |
| 450 | (buffer (current-buffer)) | 450 | (buffer (current-buffer)) |
| 451 | (composition (find-composition pos nil nil t)) | 451 | (composition (find-composition pos nil nil t)) |
| 452 | (composed (if composition (buffer-substring (car composition) | 452 | (composed (if composition (buffer-substring (car composition) |
| 453 | (nth 1 composition)))) | 453 | (nth 1 composition)))) |
| 454 | (multibyte-p enable-multibyte-characters) | 454 | (multibyte-p enable-multibyte-characters) |
| 455 | item-list max-width) | 455 | code item-list max-width) |
| 456 | (or (and (charsetp charset) (encode-char char charset)) | ||
| 457 | (setq charset (char-charset char))) | ||
| 456 | (if (eq charset 'eight-bit) | 458 | (if (eq charset 'eight-bit) |
| 457 | (setq item-list | 459 | (setq item-list |
| 458 | `(("character" | 460 | `(("character" |
| @@ -460,6 +462,7 @@ as well as widgets, buttons, overlays, and text properties." | |||
| 460 | (char-to-string char) char char char | 462 | (char-to-string char) char char char |
| 461 | (multibyte-char-to-unibyte char))))) | 463 | (multibyte-char-to-unibyte char))))) |
| 462 | 464 | ||
| 465 | (setq code (encode-char char charset)) | ||
| 463 | (setq item-list | 466 | (setq item-list |
| 464 | `(("character" | 467 | `(("character" |
| 465 | ,(format "%s (0%o, %d, 0x%x)" (if (< char 256) | 468 | ,(format "%s (0%o, %d, 0x%x)" (if (< char 256) |
| @@ -470,8 +473,7 @@ as well as widgets, buttons, overlays, and text properties." | |||
| 470 | ,(symbol-name charset) | 473 | ,(symbol-name charset) |
| 471 | ,(format "(%s)" (charset-description charset))) | 474 | ,(format "(%s)" (charset-description charset))) |
| 472 | ("code point" | 475 | ("code point" |
| 473 | ,(let ((split (split-char char))) | 476 | ,(format (if (< code 256) "0x%02X" "0x%04X") code)) |
| 474 | (mapconcat #'number-to-string (cdr split) " "))) | ||
| 475 | ("syntax" | 477 | ("syntax" |
| 476 | ,(let ((syntax (syntax-after pos))) | 478 | ,(let ((syntax (syntax-after pos))) |
| 477 | (with-temp-buffer | 479 | (with-temp-buffer |