diff options
| author | Stefan Monnier | 2002-09-19 05:06:16 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2002-09-19 05:06:16 +0000 |
| commit | 02e91426a52df44c233f604686a81f3f4c8aab64 (patch) | |
| tree | 66101c6771fee570c0047bb5718b73ace3e1c40d | |
| parent | 3da91622f43bd4f62edfcc0c3e9aeba44e6912a0 (diff) | |
| download | emacs-02e91426a52df44c233f604686a81f3f4c8aab64.tar.gz emacs-02e91426a52df44c233f604686a81f3f4c8aab64.zip | |
(describe-coding-system): Remove unused `coding-spec' variable.
(list-input-methods): Be more careful when setting up the help buffer.
| -rw-r--r-- | lisp/international/mule-diag.el | 148 |
1 files changed, 72 insertions, 76 deletions
diff --git a/lisp/international/mule-diag.el b/lisp/international/mule-diag.el index d4c4af4a19a..cee82fb6b50 100644 --- a/lisp/international/mule-diag.el +++ b/lisp/international/mule-diag.el | |||
| @@ -46,7 +46,7 @@ | |||
| 46 | (defun sort-charset-list () | 46 | (defun sort-charset-list () |
| 47 | (setq charset-list | 47 | (setq charset-list |
| 48 | (sort charset-list | 48 | (sort charset-list |
| 49 | (function (lambda (x y) (< (charset-id x) (charset-id y))))))) | 49 | (lambda (x y) (< (charset-id x) (charset-id y)))))) |
| 50 | 50 | ||
| 51 | ;;; CHARSET | 51 | ;;; CHARSET |
| 52 | 52 | ||
| @@ -175,20 +175,19 @@ but still shows the full information." | |||
| 175 | ;; Determine a predicate for `sort' by SORT-KEY. | 175 | ;; Determine a predicate for `sort' by SORT-KEY. |
| 176 | (setq sort-func | 176 | (setq sort-func |
| 177 | (cond ((eq sort-key 'id) | 177 | (cond ((eq sort-key 'id) |
| 178 | (function (lambda (x y) (< (car x) (car y))))) | 178 | (lambda (x y) (< (car x) (car y)))) |
| 179 | 179 | ||
| 180 | ((eq sort-key 'name) | 180 | ((eq sort-key 'name) |
| 181 | (function (lambda (x y) (string< (nth 1 x) (nth 1 y))))) | 181 | (lambda (x y) (string< (nth 1 x) (nth 1 y)))) |
| 182 | 182 | ||
| 183 | ((eq sort-key 'iso-spec) | 183 | ((eq sort-key 'iso-spec) |
| 184 | ;; Sort by DIMENSION CHARS FINAL-CHAR | 184 | ;; Sort by DIMENSION CHARS FINAL-CHAR |
| 185 | (function | 185 | (lambda (x y) |
| 186 | (lambda (x y) | 186 | (or (< (nth 3 x) (nth 3 y)) |
| 187 | (or (< (nth 3 x) (nth 3 y)) | 187 | (and (= (nth 3 x) (nth 3 y)) |
| 188 | (and (= (nth 3 x) (nth 3 y)) | 188 | (or (< (nth 4 x) (nth 4 y)) |
| 189 | (or (< (nth 4 x) (nth 4 y)) | 189 | (and (= (nth 4 x) (nth 4 y)) |
| 190 | (and (= (nth 4 x) (nth 4 y)) | 190 | (< (nth 5 x) (nth 5 y)))))))) |
| 191 | (< (nth 5 x) (nth 5 y))))))))) | ||
| 192 | (t | 191 | (t |
| 193 | (error "Invalid charset sort key: %s" sort-key)))) | 192 | (error "Invalid charset sort key: %s" sort-key)))) |
| 194 | 193 | ||
| @@ -353,10 +352,9 @@ DEFAULT-VALUE, if non-nil, is the default value. | |||
| 353 | INITIAL-INPUT, if non-nil, is a string inserted in the minibuffer initially. | 352 | INITIAL-INPUT, if non-nil, is a string inserted in the minibuffer initially. |
| 354 | See the documentation of the function `completing-read' for the | 353 | See the documentation of the function `completing-read' for the |
| 355 | detailed meanings of these arguments." | 354 | detailed meanings of these arguments." |
| 356 | (let* ((table (append (mapcar (function (lambda (x) (list (symbol-name x)))) | 355 | (let* ((table (append (mapcar (lambda (x) (list (symbol-name x))) |
| 357 | charset-list) | 356 | charset-list) |
| 358 | (mapcar (function (lambda (x) | 357 | (mapcar (lambda (x) (list (symbol-name (car x)))) |
| 359 | (list (symbol-name (car x))))) | ||
| 360 | non-iso-charset-alist))) | 358 | non-iso-charset-alist))) |
| 361 | (charset (completing-read prompt table | 359 | (charset (completing-read prompt table |
| 362 | nil t initial-input 'charset-history | 360 | nil t initial-input 'charset-history |
| @@ -586,55 +584,54 @@ PC `codepages' and other coded character sets. See `non-iso-charset-alist'." | |||
| 586 | (with-output-to-temp-buffer (help-buffer) | 584 | (with-output-to-temp-buffer (help-buffer) |
| 587 | (print-coding-system-briefly coding-system 'doc-string) | 585 | (print-coding-system-briefly coding-system 'doc-string) |
| 588 | (princ "\n") | 586 | (princ "\n") |
| 589 | (let ((coding-spec (coding-system-spec coding-system))) | 587 | (princ "Type: ") |
| 590 | (princ "Type: ") | 588 | (let ((type (coding-system-type coding-system)) |
| 591 | (let ((type (coding-system-type coding-system)) | 589 | (flags (coding-system-flags coding-system))) |
| 592 | (flags (coding-system-flags coding-system))) | 590 | (princ type) |
| 593 | (princ type) | 591 | (cond ((eq type nil) |
| 594 | (cond ((eq type nil) | 592 | (princ " (do no conversion)")) |
| 595 | (princ " (do no conversion)")) | 593 | ((eq type t) |
| 596 | ((eq type t) | 594 | (princ " (do automatic conversion)")) |
| 597 | (princ " (do automatic conversion)")) | 595 | ((eq type 0) |
| 598 | ((eq type 0) | 596 | (princ " (Emacs internal multibyte form)")) |
| 599 | (princ " (Emacs internal multibyte form)")) | 597 | ((eq type 1) |
| 600 | ((eq type 1) | 598 | (princ " (Shift-JIS, MS-KANJI)")) |
| 601 | (princ " (Shift-JIS, MS-KANJI)")) | 599 | ((eq type 2) |
| 602 | ((eq type 2) | 600 | (princ " (variant of ISO-2022)\n") |
| 603 | (princ " (variant of ISO-2022)\n") | 601 | (princ "Initial designations:\n") |
| 604 | (princ "Initial designations:\n") | 602 | (print-designation flags) |
| 605 | (print-designation flags) | 603 | (princ "Other Form: \n ") |
| 606 | (princ "Other Form: \n ") | 604 | (princ (if (aref flags 4) "short-form" "long-form")) |
| 607 | (princ (if (aref flags 4) "short-form" "long-form")) | 605 | (if (aref flags 5) (princ ", ASCII@EOL")) |
| 608 | (if (aref flags 5) (princ ", ASCII@EOL")) | 606 | (if (aref flags 6) (princ ", ASCII@CNTL")) |
| 609 | (if (aref flags 6) (princ ", ASCII@CNTL")) | 607 | (princ (if (aref flags 7) ", 7-bit" ", 8-bit")) |
| 610 | (princ (if (aref flags 7) ", 7-bit" ", 8-bit")) | 608 | (if (aref flags 8) (princ ", use-locking-shift")) |
| 611 | (if (aref flags 8) (princ ", use-locking-shift")) | 609 | (if (aref flags 9) (princ ", use-single-shift")) |
| 612 | (if (aref flags 9) (princ ", use-single-shift")) | 610 | (if (aref flags 10) (princ ", use-roman")) |
| 613 | (if (aref flags 10) (princ ", use-roman")) | 611 | (if (aref flags 11) (princ ", use-old-jis")) |
| 614 | (if (aref flags 11) (princ ", use-old-jis")) | 612 | (if (aref flags 12) (princ ", no-ISO6429")) |
| 615 | (if (aref flags 12) (princ ", no-ISO6429")) | 613 | (if (aref flags 13) (princ ", init-bol")) |
| 616 | (if (aref flags 13) (princ ", init-bol")) | 614 | (if (aref flags 14) (princ ", designation-bol")) |
| 617 | (if (aref flags 14) (princ ", designation-bol")) | 615 | (if (aref flags 15) (princ ", convert-unsafe")) |
| 618 | (if (aref flags 15) (princ ", convert-unsafe")) | 616 | (if (aref flags 16) (princ ", accept-latin-extra-code")) |
| 619 | (if (aref flags 16) (princ ", accept-latin-extra-code")) | 617 | (princ ".")) |
| 620 | (princ ".")) | 618 | ((eq type 3) |
| 621 | ((eq type 3) | 619 | (princ " (Big5)")) |
| 622 | (princ " (Big5)")) | 620 | ((eq type 4) |
| 623 | ((eq type 4) | 621 | (princ " (do conversion by CCL program)")) |
| 624 | (princ " (do conversion by CCL program)")) | 622 | ((eq type 5) |
| 625 | ((eq type 5) | 623 | (princ " (text with random binary characters)")) |
| 626 | (princ " (text with random binary characters)")) | 624 | (t (princ ": invalid coding-system.")))) |
| 627 | (t (princ ": invalid coding-system.")))) | 625 | (princ "\nEOL type: ") |
| 628 | (princ "\nEOL type: ") | 626 | (let ((eol-type (coding-system-eol-type coding-system))) |
| 629 | (let ((eol-type (coding-system-eol-type coding-system))) | 627 | (cond ((vectorp eol-type) |
| 630 | (cond ((vectorp eol-type) | 628 | (princ "Automatic selection from:\n\t") |
| 631 | (princ "Automatic selection from:\n\t") | 629 | (princ eol-type) |
| 632 | (princ eol-type) | 630 | (princ "\n")) |
| 633 | (princ "\n")) | 631 | ((or (null eol-type) (eq eol-type 0)) (princ "LF\n")) |
| 634 | ((or (null eol-type) (eq eol-type 0)) (princ "LF\n")) | 632 | ((eq eol-type 1) (princ "CRLF\n")) |
| 635 | ((eq eol-type 1) (princ "CRLF\n")) | 633 | ((eq eol-type 2) (princ "CR\n")) |
| 636 | ((eq eol-type 2) (princ "CR\n")) | 634 | (t (princ "invalid\n")))) |
| 637 | (t (princ "invalid\n"))))) | ||
| 638 | (let ((postread (coding-system-get coding-system 'post-read-conversion))) | 635 | (let ((postread (coding-system-get coding-system 'post-read-conversion))) |
| 639 | (when postread | 636 | (when postread |
| 640 | (princ "After decoding text normally,") | 637 | (princ "After decoding text normally,") |
| @@ -800,13 +797,12 @@ Priority order for recognizing coding systems when reading files:\n") | |||
| 800 | (while categories | 797 | (while categories |
| 801 | (setq coding-system (symbol-value (car categories))) | 798 | (setq coding-system (symbol-value (car categories))) |
| 802 | (mapcar | 799 | (mapcar |
| 803 | (function | 800 | (lambda (x) |
| 804 | (lambda (x) | 801 | (if (and (not (eq x coding-system)) |
| 805 | (if (and (not (eq x coding-system)) | 802 | (coding-system-get x 'no-initial-designation) |
| 806 | (coding-system-get x 'no-initial-designation) | 803 | (let ((flags (coding-system-flags x))) |
| 807 | (let ((flags (coding-system-flags x))) | 804 | (not (or (aref flags 10) (aref flags 11))))) |
| 808 | (not (or (aref flags 10) (aref flags 11))))) | 805 | (setq codings (cons x codings)))) |
| 809 | (setq codings (cons x codings))))) | ||
| 810 | (get (car categories) 'coding-systems)) | 806 | (get (car categories) 'coding-systems)) |
| 811 | (if codings | 807 | (if codings |
| 812 | (let ((max-col (frame-width)) | 808 | (let ((max-col (frame-width)) |
| @@ -1115,9 +1111,9 @@ see the function `describe-fontset' for the format of the list." | |||
| 1115 | ;; This code is duplicated near the end of mule-diag. | 1111 | ;; This code is duplicated near the end of mule-diag. |
| 1116 | (let ((fontsets | 1112 | (let ((fontsets |
| 1117 | (sort (fontset-list) | 1113 | (sort (fontset-list) |
| 1118 | (function (lambda (x y) | 1114 | (lambda (x y) |
| 1119 | (string< (fontset-plain-name x) | 1115 | (string< (fontset-plain-name x) |
| 1120 | (fontset-plain-name y))))))) | 1116 | (fontset-plain-name y)))))) |
| 1121 | (while fontsets | 1117 | (while fontsets |
| 1122 | (if arg | 1118 | (if arg |
| 1123 | (print-fontset (car fontsets) nil) | 1119 | (print-fontset (car fontsets) nil) |
| @@ -1128,7 +1124,8 @@ see the function `describe-fontset' for the format of the list." | |||
| 1128 | (defun list-input-methods () | 1124 | (defun list-input-methods () |
| 1129 | "Display information about all input methods." | 1125 | "Display information about all input methods." |
| 1130 | (interactive) | 1126 | (interactive) |
| 1131 | (with-output-to-temp-buffer "*Help*" | 1127 | (help-setup-xref '(list-input-methods) (interactive-p)) |
| 1128 | (with-output-to-temp-buffer (help-buffer) | ||
| 1132 | (list-input-methods-1) | 1129 | (list-input-methods-1) |
| 1133 | (with-current-buffer standard-output | 1130 | (with-current-buffer standard-output |
| 1134 | (save-excursion | 1131 | (save-excursion |
| @@ -1137,8 +1134,7 @@ see the function `describe-fontset' for the format of the list." | |||
| 1137 | "^ \\([^ ]+\\) (`.*' in mode line)$" nil t) | 1134 | "^ \\([^ ]+\\) (`.*' in mode line)$" nil t) |
| 1138 | (help-xref-button 1 #'help-input-method | 1135 | (help-xref-button 1 #'help-input-method |
| 1139 | (match-string 1) | 1136 | (match-string 1) |
| 1140 | "mouse-2: describe this method"))) | 1137 | "mouse-2: describe this method")))))) |
| 1141 | (help-setup-xref '(list-input-methods) (interactive-p))))) | ||
| 1142 | 1138 | ||
| 1143 | (defun list-input-methods-1 () | 1139 | (defun list-input-methods-1 () |
| 1144 | (if (not input-method-alist) | 1140 | (if (not input-method-alist) |
| @@ -1150,7 +1146,7 @@ installed LEIM (Libraries of Emacs Input Methods).")) | |||
| 1150 | (princ " SHORT-DESCRIPTION\n------------------------------\n") | 1146 | (princ " SHORT-DESCRIPTION\n------------------------------\n") |
| 1151 | (setq input-method-alist | 1147 | (setq input-method-alist |
| 1152 | (sort input-method-alist | 1148 | (sort input-method-alist |
| 1153 | (function (lambda (x y) (string< (nth 1 x) (nth 1 y)))))) | 1149 | (lambda (x y) (string< (nth 1 x) (nth 1 y))))) |
| 1154 | (let ((l input-method-alist) | 1150 | (let ((l input-method-alist) |
| 1155 | language elt) | 1151 | language elt) |
| 1156 | (while l | 1152 | (while l |