diff options
| author | Dave Love | 2002-05-26 17:19:34 +0000 |
|---|---|---|
| committer | Dave Love | 2002-05-26 17:19:34 +0000 |
| commit | 8285fa96b16dededbdc6654f77b5b5a32e562abb (patch) | |
| tree | fa6bb1be6bf670fe3ffb5b720ec59fdd6db08e31 | |
| parent | cb269bb1045d6d4fdd12b7f88352297673dd8b30 (diff) | |
| download | emacs-8285fa96b16dededbdc6654f77b5b5a32e562abb.tar.gz emacs-8285fa96b16dededbdc6654f77b5b5a32e562abb.zip | |
(describe-current-coding-system): Fix
aliases listing.
(print-iso-2022-flags): Deleted.
(print-designation): Partly re-written.
(describe-coding-system): Deal with iso-2022 designations, flags.
Fix shift_jis case.
(describe-char-after): Use characterp. Print explicit unicode.
Remove some obsolete code.
| -rw-r--r-- | lisp/international/mule-diag.el | 98 |
1 files changed, 35 insertions, 63 deletions
diff --git a/lisp/international/mule-diag.el b/lisp/international/mule-diag.el index 75e9d49d329..60bea2fd41b 100644 --- a/lisp/international/mule-diag.el +++ b/lisp/international/mule-diag.el | |||
| @@ -392,21 +392,22 @@ which font is being used for displaying the character." | |||
| 392 | (nth 1 composition)))) | 392 | (nth 1 composition)))) |
| 393 | (multibyte-p enable-multibyte-characters) | 393 | (multibyte-p enable-multibyte-characters) |
| 394 | item-list max-width) | 394 | item-list max-width) |
| 395 | (if (eq charset 'unknown) | 395 | (if (not (characterp char)) |
| 396 | (setq item-list | 396 | (setq item-list |
| 397 | `(("character" | 397 | `(("character" |
| 398 | ,(format "%s (0%o, %d, 0x%x) -- invalid character code" | 398 | ,(format "%s (0%o, %d, 0x%x) -- invalid character code" |
| 399 | (if (< char 256) | 399 | (char-to-string char) char char char)))) |
| 400 | (single-key-description char) | ||
| 401 | (char-to-string char)) | ||
| 402 | char char char)))) | ||
| 403 | (setq item-list | 400 | (setq item-list |
| 404 | `(("character" | 401 | `(("character" |
| 405 | ,(format "%s (0%o, %d, 0x%x)" (if (< char 256) | 402 | ,(format "%s (0%o, %d, 0x%x%s)" |
| 406 | (single-key-description char) | 403 | (if (< char 256) |
| 407 | (char-to-string char)) | 404 | (single-key-description char) |
| 408 | char char char)) | 405 | (char-to-string char)) |
| 409 | ("charset" | 406 | char char char |
| 407 | (if (encode-char char 'ucs) | ||
| 408 | (format ", U+%04X" (encode-char char 'ucs)) | ||
| 409 | ""))) | ||
| 410 | ("preferred charset" | ||
| 410 | ,(symbol-name charset) | 411 | ,(symbol-name charset) |
| 411 | ,(format "(%s)" (charset-description charset))) | 412 | ,(format "(%s)" (charset-description charset))) |
| 412 | ("code point" | 413 | ("code point" |
| @@ -447,18 +448,8 @@ which font is being used for displaying the character." | |||
| 447 | (if encoded | 448 | (if encoded |
| 448 | (list (encoded-string-description encoded coding) | 449 | (list (encoded-string-description encoded coding) |
| 449 | (format "(encoded by coding system %S)" coding)) | 450 | (format "(encoded by coding system %S)" coding)) |
| 450 | ;; Fixme: this is wrong e.g. for chars in HELLO | ||
| 451 | (list "not encodable by coding system" | 451 | (list "not encodable by coding system" |
| 452 | (symbol-name coding))))) | 452 | (symbol-name coding))))) |
| 453 | ,@(if (or (memq 'mule-utf-8 | ||
| 454 | (find-coding-systems-region (point) (1+ (point)))) | ||
| 455 | (get-char-property (point) 'untranslated-utf-8)) | ||
| 456 | (let ((uc (or (get-char-property (point) | ||
| 457 | 'untranslated-utf-8) | ||
| 458 | (encode-char (char-after) 'ucs)))) | ||
| 459 | (if uc | ||
| 460 | (list (list "Unicode" | ||
| 461 | (format "%04X" uc)))))) | ||
| 462 | ,(if (display-graphic-p (selected-frame)) | 453 | ,(if (display-graphic-p (selected-frame)) |
| 463 | (list "font" (or (internal-char-font (point)) | 454 | (list "font" (or (internal-char-font (point)) |
| 464 | "-- none --")) | 455 | "-- none --")) |
| @@ -512,28 +503,20 @@ which font is being used for displaying the character." | |||
| 512 | 503 | ||
| 513 | ;;; CODING-SYSTEM | 504 | ;;; CODING-SYSTEM |
| 514 | 505 | ||
| 515 | ;; Fixme | 506 | (eval-when-compile ; dynamic bondage |
| 516 | (defun print-designation (charset-list initial request) | 507 | (defvar graphic-register)) |
| 517 | ;; Print information of designation of each graphic register in FLAGS | 508 | |
| 518 | ;; in human readable format. See the documentation of | 509 | ;; Print information about designation of each graphic register in |
| 519 | ;; `make-coding-system' for the meaning of FLAGS. | 510 | ;; DESIGNATIONS in human readable format. See the documentation of |
| 520 | (let ((gr (make-vector 4 nil)) | 511 | ;; `define-coding-system' for the meaning of DESIGNATIONS |
| 521 | charset) | 512 | ;; (`:designation' property). |
| 522 | (dotimes (i 4) | 513 | (defun print-designation (designations) |
| 523 | (let ((val (aref initial i))) | 514 | (let (charset) |
| 524 | (cond ((symbolp val) | 515 | (dotimes (graphic-register 4) |
| 525 | (aset gr i (list val))) | 516 | (setq charset (aref designations graphic-register)) |
| 526 | ((eq val -1) | ||
| 527 | (aset gr i (list t)))))) | ||
| 528 | (dolist (elt request) | ||
| 529 | (let ((reg (cdr elt))) | ||
| 530 | (nconc (aref gr reg) (list (car elt))))) | ||
| 531 | (dotimes (i 4) | ||
| 532 | ;; Fixme: | ||
| 533 | (setq charset (aref flags graphic-register)) | ||
| 534 | (princ (format | 517 | (princ (format |
| 535 | " G%d -- %s\n" | 518 | " G%d -- %s\n" |
| 536 | i | 519 | graphic-register |
| 537 | (cond ((null charset) | 520 | (cond ((null charset) |
| 538 | "never used") | 521 | "never used") |
| 539 | ((eq charset t) | 522 | ((eq charset t) |
| @@ -543,7 +526,7 @@ which font is being used for displaying the character." | |||
| 543 | charset (charset-description charset))) | 526 | charset (charset-description charset))) |
| 544 | ((listp charset) | 527 | ((listp charset) |
| 545 | (if (charsetp (car charset)) | 528 | (if (charsetp (car charset)) |
| 546 | (format "%s:%s, and also used by the followings:" | 529 | (format "%s:%s, and also used by the following:" |
| 547 | (car charset) | 530 | (car charset) |
| 548 | (charset-description (car charset))) | 531 | (charset-description (car charset))) |
| 549 | "no initial designation, and used by the followings:")) | 532 | "no initial designation, and used by the followings:")) |
| @@ -560,18 +543,7 @@ which font is being used for displaying the character." | |||
| 560 | (charset-description (car charset))))) | 543 | (charset-description (car charset))))) |
| 561 | (t | 544 | (t |
| 562 | "invalid designation information")) | 545 | "invalid designation information")) |
| 563 | (setq charset (cdr charset)))) | 546 | (setq charset (cdr charset))))))) |
| 564 | (setq graphic-register (1+ graphic-register))))) | ||
| 565 | |||
| 566 | (defun print-iso-2022-flags (flags) | ||
| 567 | (princ "Other specifications: \n ") | ||
| 568 | (let ((i 0) | ||
| 569 | (l nil)) | ||
| 570 | (dolist (elt coding-system-iso-2022-flags) | ||
| 571 | (if (/= (logand flags (lsh 1 i)) 0) | ||
| 572 | (setq l (cons elt l)))) | ||
| 573 | (princ l)) | ||
| 574 | (terpri)) | ||
| 575 | 547 | ||
| 576 | ;;;###autoload | 548 | ;;;###autoload |
| 577 | (defun describe-coding-system (coding-system) | 549 | (defun describe-coding-system (coding-system) |
| @@ -592,17 +564,18 @@ which font is being used for displaying the character." | |||
| 592 | (princ " (do automatic conversion)")) | 564 | (princ " (do automatic conversion)")) |
| 593 | ((eq type 'utf-8) | 565 | ((eq type 'utf-8) |
| 594 | (princ " (UTF-8: Emacs internal multibyte form)")) | 566 | (princ " (UTF-8: Emacs internal multibyte form)")) |
| 595 | ((eq type 'sjis) | 567 | ((eq type 'shift-jis) |
| 596 | (princ " (Shift-JIS, MS-KANJI)")) | 568 | (princ " (Shift-JIS, MS-KANJI)")) |
| 597 | ((eq type 'iso-2022) | 569 | ((eq type 'iso-2022) |
| 598 | (princ " (variant of ISO-2022)\n") | 570 | (princ " (variant of ISO-2022)\n") |
| 599 | ;; Fixme: | 571 | (princ "Initial designations:\n") |
| 600 | ;; (princ "Initial designations:\n") | 572 | (print-designation (coding-system-get coding-system |
| 601 | ;; (print-designation (coding-system-charset-list coding-system) | 573 | :designation)) |
| 602 | ;; (aref extra-spec 0) (aref extra-spec 1)) | 574 | |
| 603 | ;; (print-iso-2022-flags (aref extra-spec 2)) | 575 | (when (coding-system-get coding-system :flags) |
| 604 | ;; (princ ".") | 576 | (princ "Other specifications: \n ") |
| 605 | ) | 577 | (apply #'print-list |
| 578 | (coding-system-get coding-system :flags)))) | ||
| 606 | ((eq type 'charset) | 579 | ((eq type 'charset) |
| 607 | (princ " (charset)")) | 580 | (princ " (charset)")) |
| 608 | ((eq type 'ccl) | 581 | ((eq type 'ccl) |
| @@ -758,8 +731,7 @@ Priority order for recognizing coding systems when reading files:\n") | |||
| 758 | (let ((aliases (coding-system-aliases elt))) | 731 | (let ((aliases (coding-system-aliases elt))) |
| 759 | (if (eq elt (car aliases)) | 732 | (if (eq elt (car aliases)) |
| 760 | (if (cdr aliases) | 733 | (if (cdr aliases) |
| 761 | ;; Fixme: | 734 | (princ (cons 'alias: (cdr aliases)))) |
| 762 | (princ (cons 'alias: (cdr base-aliases)))) | ||
| 763 | (princ (list 'alias 'of (car aliases)))) | 735 | (princ (list 'alias 'of (car aliases)))) |
| 764 | (terpri) | 736 | (terpri) |
| 765 | (setq i (1+ i))))) | 737 | (setq i (1+ i))))) |