aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/ChangeLog17
-rw-r--r--lisp/international/mule-diag.el261
2 files changed, 151 insertions, 127 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 64b6d2215d0..c0586ec82d1 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,20 @@
12002-02-11 Pavel Jan,Bm(Bk <Pavel@Janik.cz>
2
3 * international/mule-diag.el: Various doc and message fixes.
4 (non-iso-charset-alist): Add mac-roman. Don't add entries for
5 codepages already present.
6 (list-block-of-chars): Display space for null entries in
7 translation table. Display tab specially.
8 (list-non-iso-charset-chars): Check for null charsets. Use pop
9 for clarity. Don't break 8-bit sets into sections between ranges.
10 (list-charset-chars): Avoid indent-tabs-mode.
11 (describe-char-after): Maybe use the text property for syntax
12 table information. Maybe report char-code-property-table info.
13 Maybe report character's unicode. Tweak printing of list info.
14 (list-input-methods): Add xref buttons.
15 (dump-charsets, dump-codings): Deleted (obsolete).
16 From Dave Love <fx@gnu.org>.
17
12002-02-10 Pavel Jan,Bm(Bk <Pavel@Janik.cz> 182002-02-10 Pavel Jan,Bm(Bk <Pavel@Janik.cz>
2 19
3 * menu-bar.el (menu-bar-showhide-menu): Rename functions for 20 * menu-bar.el (menu-bar-showhide-menu): Rename functions for
diff --git a/lisp/international/mule-diag.el b/lisp/international/mule-diag.el
index a9288e10c7a..efbefdca6e9 100644
--- a/lisp/international/mule-diag.el
+++ b/lisp/international/mule-diag.el
@@ -2,7 +2,7 @@
2 2
3;; Copyright (C) 1995 Electrotechnical Laboratory, JAPAN. 3;; Copyright (C) 1995 Electrotechnical Laboratory, JAPAN.
4;; Licensed to the Free Software Foundation. 4;; Licensed to the Free Software Foundation.
5;; Copyright (C) 2001 Free Software Foundation, Inc. 5;; Copyright (C) 2001, 2002 Free Software Foundation, Inc.
6 6
7;; Keywords: multilingual, charset, coding system, fontset, diagnosis, i18n 7;; Keywords: multilingual, charset, coding system, fontset, diagnosis, i18n
8 8
@@ -66,19 +66,19 @@
66(defun list-character-sets (arg) 66(defun list-character-sets (arg)
67 "Display a list of all character sets. 67 "Display a list of all character sets.
68 68
69The ID-NUM column contains a charset identification number 69The ID-NUM column contains a charset identification number for
70 for internal Emacs use. 70internal Emacs use.
71 71
72The MULTIBYTE-FORM column contains a format of multibyte sequence 72The MULTIBYTE-FORM column contains the format of the buffer and string
73 of characters in the charset for buffer and string 73multibyte sequence of characters in the charset using one to four
74 by one to four hexadecimal digits. 74hexadecimal digits.
75 `xx' stands for any byte in the range 0..127. 75 `xx' stands for any byte in the range 0..127.
76 `XX' stands for any byte in the range 160..255. 76 `XX' stands for any byte in the range 160..255.
77 77
78The D column contains a dimension of this character set. 78The D column contains the dimension of this character set. The CH
79The CH column contains a number of characters in a block of this character set. 79column contains the number of characters in a block of this character
80The FINAL-CHAR column contains an ISO-2022's <final-char> to use for 80set. The FINAL-CHAR column contains an ISO-2022 <final-char> to use
81 designating this character set in ISO-2022-based coding systems. 81for designating this character set in ISO-2022-based coding systems.
82 82
83With prefix arg, the output format gets more cryptic, 83With prefix arg, the output format gets more cryptic,
84but still shows the full information." 84but still shows the full information."
@@ -119,9 +119,6 @@ but still shows the full information."
119 ;; Insert body sorted by charset IDs. 119 ;; Insert body sorted by charset IDs.
120 (list-character-sets-1 'id))))) 120 (list-character-sets-1 'id)))))
121 121
122
123;; Sort character set list by SORT-KEY.
124
125(defun sort-listed-character-sets (sort-key) 122(defun sort-listed-character-sets (sort-key)
126 (if sort-key 123 (if sort-key
127 (save-excursion 124 (save-excursion
@@ -252,7 +249,11 @@ but still shows the full information."
252 (charset-description charset)))))) 249 (charset-description charset))))))
253 250
254(defvar non-iso-charset-alist 251(defvar non-iso-charset-alist
255 `((viscii 252 `((mac-roman
253 nil
254 mac-roman-decoder
255 ((0 255)))
256 (viscii
256 (ascii vietnamese-viscii-lower vietnamese-viscii-upper) 257 (ascii vietnamese-viscii-lower vietnamese-viscii-upper)
257 viet-viscii-nonascii-translation-table 258 viet-viscii-nonascii-translation-table
258 ((0 255))) 259 ((0 255)))
@@ -274,25 +275,27 @@ but still shows the full information."
274 decode-sjis-char 275 decode-sjis-char
275 ((32 127 ?\xA1 ?\xDF) 276 ((32 127 ?\xA1 ?\xDF)
276 ((?\x81 ?\x9F ?\xE0 ?\xEF) . (?\x40 ?\x7E ?\x80 ?\xFC))))) 277 ((?\x81 ?\x9F ?\xE0 ?\xEF) . (?\x40 ?\x7E ?\x80 ?\xFC)))))
277 "Alist of non-ISO charset names vs the corresponding information. 278 "Alist of charset names vs the corresponding information.
278 279This is mis-named for historical reasons. The charsets are actually
279Non-ISO charsets are what Emacs can read (or write) by mapping to (or 280non-built-in ones. They correspond to Emacs coding systems, not Emacs
280from) some Emacs' charsets that correspond to ISO charsets. 281charsets, i.e. what Emacs can read (or write) by mapping to (or
282from) Emacs internal charsets that typically correspond to a limited
283set of ISO charsets.
281 284
282Each element has the following format: 285Each element has the following format:
283 (NON-ISO-CHARSET CHARSET-LIST TRANSLATION-METHOD [ CODE-RANGE ]) 286 (CHARSET CHARSET-LIST TRANSLATION-METHOD [ CODE-RANGE ])
284 287
285NON-ISO-CHARSET is a name (symbol) of the non-ISO charset. 288CHARSET is the name (symbol) of the charset.
286 289
287CHARSET-LIST is a list of Emacs' charsets into which characters of 290CHARSET-LIST is a list of Emacs charsets into which characters of
288NON-ISO-CHARSET are mapped. 291CHARSET are mapped.
289 292
290TRANSLATION-METHOD is a translation table (symbol) to translate a 293TRANSLATION-METHOD is a translation table (symbol) to translate a
291character code of NON-ISO-CHARSET to the corresponding Emacs character 294character code of CHARSET to the corresponding Emacs character
292code. It can also be a function to call with one argument, a 295code. It can also be a function to call with one argument, a
293character code in NON-ISO-CHARSET. 296character code in CHARSET.
294 297
295CODE-RANGE specifies the valid code ranges of NON-ISO-CHARSET. 298CODE-RANGE specifies the valid code ranges of CHARSET.
296It is a list of RANGEs, where each RANGE is of the form: 299It is a list of RANGEs, where each RANGE is of the form:
297 (FROM1 TO1 FROM2 TO2 ...) 300 (FROM1 TO1 FROM2 TO2 ...)
298or 301or
@@ -303,11 +306,10 @@ The second form is used for 2-byte codes. The car part is the ranges
303of the first byte, and the cdr part is the ranges of the second byte.") 306of the first byte, and the cdr part is the ranges of the second byte.")
304 307
305 308
306;; Decode a character that has code CODE in CODEPAGE. Value is a
307;; string of decoded character.
308
309(defun decode-codepage-char (codepage code) 309(defun decode-codepage-char (codepage code)
310 ;; Each CODEPAGE corresponds to a coding system cpCODEPAGE. 310 "Decode a character that has code CODE in CODEPAGE.
311Return a decoded character string. Each CODEPAGE corresponds to a
312coding system cpCODEPAGE."
311 (let ((coding-system (intern (format "cp%d" codepage)))) 313 (let ((coding-system (intern (format "cp%d" codepage))))
312 (or (coding-system-p coding-system) 314 (or (coding-system-p coding-system)
313 (codepage-setup codepage)) 315 (codepage-setup codepage))
@@ -324,14 +326,15 @@ of the first byte, and the cdr part is the ranges of the second byte.")
324 ;; Now ELT is (CODEPAGE . CHARSET), where CODEPAGE is a string 326 ;; Now ELT is (CODEPAGE . CHARSET), where CODEPAGE is a string
325 ;; (e.g. "850"), CHARSET is a charset that characters in CODEPAGE 327 ;; (e.g. "850"), CHARSET is a charset that characters in CODEPAGE
326 ;; are mapped to. 328 ;; are mapped to.
327 (setq non-iso-charset-alist 329 (unless (assq (intern (concat "cp" (car elt))) non-iso-charset-alist)
328 (cons (list (intern (concat "cp" (car elt))) 330 (setq non-iso-charset-alist
329 (list 'ascii (cdr elt)) 331 (cons (list (intern (concat "cp" (car elt)))
330 `(lambda (code) 332 (list 'ascii (cdr elt))
331 (decode-codepage-char ,(string-to-int (car elt)) 333 `(lambda (code)
332 code)) 334 (decode-codepage-char ,(string-to-int (car elt))
333 (list (list 0 255))) 335 code))
334 non-iso-charset-alist)))) 336 (list (list 0 255)))
337 non-iso-charset-alist)))))
335 338
336 339
337;; A variable to hold charset input history. 340;; A variable to hold charset input history.
@@ -341,7 +344,7 @@ of the first byte, and the cdr part is the ranges of the second byte.")
341;;;###autoload 344;;;###autoload
342(defun read-charset (prompt &optional default-value initial-input) 345(defun read-charset (prompt &optional default-value initial-input)
343 "Read a character set from the minibuffer, prompting with string PROMPT. 346 "Read a character set from the minibuffer, prompting with string PROMPT.
344It reads an Emacs' character set listed in the variable `charset-list' 347It must be an Emacs character set listed in the variable `charset-list'
345or a non-ISO character set listed in the variable 348or a non-ISO character set listed in the variable
346`non-iso-charset-alist'. 349`non-iso-charset-alist'.
347 350
@@ -395,20 +398,25 @@ detailed meanings of these arguments."
395 (or (< ch 32) (and (>= ch 127) (<= ch 255)))) 398 (or (< ch 32) (and (>= ch 127) (<= ch 255))))
396 ;; Don't insert a control code. 399 ;; Don't insert a control code.
397 (setq ch 32)) 400 (setq ch 32))
401 (unless ch (setq ch 32))
402 (if (eq ch ?\t)
403 ;; Make it visible.
404 (setq ch (propertize "\t" 'display "^I")))
405 ;; This doesn't DTRT. Maybe it's better to insert "^J" and not
406 ;; worry about the buffer contents not being correct.
407;;; (if (eq ch ?\n)
408;;; (setq ch (propertize "\n" 'display "^J")))
398 (indent-to (+ (* (% i 16) 3) 6)) 409 (indent-to (+ (* (% i 16) 3) 6))
399 (insert ch) 410 (insert ch)
400 (setq i (1+ i)))) 411 (setq i (1+ i))))
401 (insert "\n")) 412 (insert "\n"))
402 413
403
404;; List all characters in ISO charset CHARSET.
405
406(defun list-iso-charset-chars (charset) 414(defun list-iso-charset-chars (charset)
407 (let ((dim (charset-dimension charset)) 415 (let ((dim (charset-dimension charset))
408 (chars (charset-chars charset)) 416 (chars (charset-chars charset))
409 (plane (charset-iso-graphic-plane charset)) 417 (plane (charset-iso-graphic-plane charset))
410 min max) 418 min max)
411 (insert (format "Characters in the charset %s.\n" charset)) 419 (insert (format "Characters in the coded character set %s.\n" charset))
412 420
413 (cond ((eq charset 'eight-bit-control) 421 (cond ((eq charset 'eight-bit-control)
414 (setq min 128 max 159)) 422 (setq min 128 max 159))
@@ -428,29 +436,36 @@ detailed meanings of these arguments."
428 (list-block-of-chars charset i min max) 436 (list-block-of-chars charset i min max)
429 (setq i (1+ i))))))) 437 (setq i (1+ i)))))))
430 438
431
432;; List all characters in non-ISO charset CHARSET.
433
434(defun list-non-iso-charset-chars (charset) 439(defun list-non-iso-charset-chars (charset)
440 "List all characters in non-built-in coded character set CHARSET."
435 (let* ((slot (assq charset non-iso-charset-alist)) 441 (let* ((slot (assq charset non-iso-charset-alist))
436 (charsets (nth 1 slot)) 442 (charsets (nth 1 slot))
437 (translate-method (nth 2 slot)) 443 (translate-method (nth 2 slot))
438 (ranges (nth 3 slot)) 444 (ranges (nth 3 slot))
439 range) 445 range)
440 (or slot 446 (or slot
441 (error "Unknown external charset: %s" charset)) 447 (error "Unknown character set: %s" charset))
442 (insert (format "Characters in non-ISO charset %s.\n" charset)) 448 (insert (format "Characters in the coded character set %s.\n" charset))
443 (insert "They are mapped to: " 449 (if charsets
444 (mapconcat #'symbol-name charsets ", ") 450 (insert "They are mapped to: "
445 "\n") 451 (mapconcat #'symbol-name charsets ", ")
452 "\n"))
446 (while ranges 453 (while ranges
447 (setq range (car ranges) ranges (cdr ranges)) 454 (setq range (pop ranges))
448 (if (integerp (car range)) 455 (if (integerp (car range))
449 ;; The form of RANGES is (FROM1 TO1 FROM2 TO2 ...). 456 ;; The form of RANGES is (FROM1 TO1 FROM2 TO2 ...).
450 (while range 457 (if (and (not (functionp translate-method))
451 (list-block-of-chars translate-method 458 (< (car (last range)) 256))
452 0 (car range) (nth 1 range)) 459 ;; Do it all in one block to avoid the listing being
453 (setq range (nthcdr 2 range))) 460 ;; broken up at gaps in the range. Don't do that for
461 ;; function translate-method, since not all codes in
462 ;; that range may be valid.
463 (list-block-of-chars translate-method
464 0 (car range) (car (last range)))
465 (while range
466 (list-block-of-chars translate-method
467 0 (car range) (nth 1 range))
468 (setq range (nthcdr 2 range))))
454 ;; The form of RANGES is ((FROM1-1 TO1-1 ...) . (FROM2-1 TO2-1 ...)). 469 ;; The form of RANGES is ((FROM1-1 TO1-1 ...) . (FROM2-1 TO2-1 ...)).
455 (let ((row-range (car range)) 470 (let ((row-range (car range))
456 row row-max 471 row row-max
@@ -469,22 +484,26 @@ detailed meanings of these arguments."
469 484
470;;;###autoload 485;;;###autoload
471(defun list-charset-chars (charset) 486(defun list-charset-chars (charset)
472 "Display a list of characters in the specified character set." 487 "Display a list of characters in the specified character set.
488This can list both Emacs `official' (ISO standard) charsets and the
489characters encoded by various Emacs coding systems which correspond to
490PC `codepages' and other coded character sets. See `non-iso-charset-alist'."
473 (interactive (list (read-charset "Character set: "))) 491 (interactive (list (read-charset "Character set: ")))
474 (with-output-to-temp-buffer "*Help*" 492 (with-output-to-temp-buffer "*Help*"
475 (with-current-buffer standard-output 493 (with-current-buffer standard-output
494 (setq indent-tabs-mode nil)
476 (set-buffer-multibyte t) 495 (set-buffer-multibyte t)
477 (cond ((charsetp charset) 496 (cond ((charsetp charset)
478 (list-iso-charset-chars charset)) 497 (list-iso-charset-chars charset))
479 ((assq charset non-iso-charset-alist) 498 ((assq charset non-iso-charset-alist)
480 (list-non-iso-charset-chars charset)) 499 (list-non-iso-charset-chars charset))
481 (t 500 (t
482 (error "Invalid charset %s" charset)))))) 501 (error "Invalid character set %s" charset))))))
483 502
484 503
485;;;###autoload 504;;;###autoload
486(defun describe-character-set (charset) 505(defun describe-character-set (charset)
487 "Display information about character set CHARSET." 506 "Display information about built-in character set CHARSET."
488 (interactive (list (let ((non-iso-charset-alist nil)) 507 (interactive (list (let ((non-iso-charset-alist nil))
489 (read-charset "Charset: ")))) 508 (read-charset "Charset: "))))
490 (or (charsetp charset) 509 (or (charsetp charset)
@@ -496,21 +515,21 @@ detailed meanings of these arguments."
496 (insert "Character set: " (symbol-name charset) 515 (insert "Character set: " (symbol-name charset)
497 (format " (ID:%d)\n\n" (aref info 0))) 516 (format " (ID:%d)\n\n" (aref info 0)))
498 (insert (aref info 13) "\n\n") ; description 517 (insert (aref info 13) "\n\n") ; description
499 (insert "number of contained characters: " 518 (insert "Number of contained characters: "
500 (if (= (aref info 2) 1) 519 (if (= (aref info 2) 1)
501 (format "%d\n" (aref info 3)) 520 (format "%d\n" (aref info 3))
502 (format "%dx%d\n" (aref info 3) (aref info 3)))) 521 (format "%dx%d\n" (aref info 3) (aref info 3))))
503 (insert "the final char of ISO2022's designation sequence: ") 522 (insert "Final char of ISO2022 designation sequence: ")
504 (if (>= (aref info 8) 0) 523 (if (>= (aref info 8) 0)
505 (insert (format "`%c'\n" (aref info 8))) 524 (insert (format "`%c'\n" (aref info 8)))
506 (insert "not assigned\n")) 525 (insert "not assigned\n"))
507 (insert (format "width (how many columns on screen): %d\n" 526 (insert (format "Width (how many columns on screen): %d\n"
508 (aref info 4))) 527 (aref info 4)))
509 (insert (format "internal multibyte sequence: %s\n" 528 (insert (format "Internal multibyte sequence: %s\n"
510 (charset-multibyte-form-string charset))) 529 (charset-multibyte-form-string charset)))
511 (let ((coding (plist-get (aref info 14) 'preferred-coding-system))) 530 (let ((coding (plist-get (aref info 14) 'preferred-coding-system)))
512 (when coding 531 (when coding
513 (insert (format "preferred coding system: %s\n" coding)) 532 (insert (format "Preferred coding system: %s\n" coding))
514 (search-backward (symbol-name coding)) 533 (search-backward (symbol-name coding))
515 (help-xref-button 0 'help-coding-system coding))))))) 534 (help-xref-button 0 'help-coding-system coding)))))))
516 535
@@ -557,10 +576,17 @@ which font is being used for displaying the character."
557 (format "%d" (nth 1 split)) 576 (format "%d" (nth 1 split))
558 (format "%d %d" (nth 1 split) (nth 2 split))))) 577 (format "%d %d" (nth 1 split) (nth 2 split)))))
559 ("syntax" 578 ("syntax"
560 ,(let ((syntax (aref (syntax-table) char))) 579 ,(let* ((old-table (syntax-table))
561 (with-temp-buffer 580 (table (get-char-property (point) 'syntax-table)))
562 (internal-describe-syntax-value syntax) 581 (if (consp table)
563 (buffer-string)))) 582 (nth 1 (assq (car table)
583 (mapcar #'cdr syntax-code-table)))
584 (unwind-protect
585 (progn
586 (if (syntax-table-p table)
587 (set-syntax-table table))
588 (nth 2 (assq (char-syntax char) syntax-code-table)))
589 (set-syntax-table old-table)))))
564 ("category" 590 ("category"
565 ,@(let ((category-set (char-category-set char))) 591 ,@(let ((category-set (char-category-set char)))
566 (if (not category-set) 592 (if (not category-set)
@@ -568,6 +594,13 @@ which font is being used for displaying the character."
568 (mapcar #'(lambda (x) (format "%c:%s " 594 (mapcar #'(lambda (x) (format "%c:%s "
569 x (category-docstring x))) 595 x (category-docstring x)))
570 (category-set-mnemonics category-set))))) 596 (category-set-mnemonics category-set)))))
597 ,@(let ((props (aref char-code-property-table char))
598 ps)
599 (when props
600 (while props
601 (push (format "%s:" (pop props)) ps)
602 (push (format "%s;" (pop props)) ps))
603 (list (cons "Properties" (nreverse ps)))))
571 ("buffer code" 604 ("buffer code"
572 ,(encoded-string-description 605 ,(encoded-string-description
573 (string-as-unibyte (char-to-string char)) nil)) 606 (string-as-unibyte (char-to-string char)) nil))
@@ -579,6 +612,15 @@ which font is being used for displaying the character."
579 (format "(encoded by coding system %S)" coding)) 612 (format "(encoded by coding system %S)" coding))
580 (list "not encodable by coding system" 613 (list "not encodable by coding system"
581 (symbol-name coding))))) 614 (symbol-name coding)))))
615 ,@(if (or (memq 'mule-utf-8
616 (find-coding-systems-region (point) (1+ (point))))
617 (get-char-property (point) 'untranslated-utf-8))
618 (let ((uc (or (get-char-property (point)
619 'untranslated-utf-8)
620 (encode-char (char-after) 'ucs))))
621 (if uc
622 (list (list "Unicode"
623 (format "%04X" uc))))))
582 ,(if (display-graphic-p (selected-frame)) 624 ,(if (display-graphic-p (selected-frame))
583 (list "font" (or (internal-char-font (point)) 625 (list "font" (or (internal-char-font (point))
584 "-- none --")) 626 "-- none --"))
@@ -620,7 +662,8 @@ which font is being used for displaying the character."
620 (nth 2 composition) 662 (nth 2 composition)
621 " ") 663 " ")
622 ").\n" 664 ").\n"
623 "See the variable `reference-point-alist' for the meaning of the rule.\n"))) 665 "See the variable `reference-point-alist' for "
666 "the meaning of the rule.\n")))
624 (if props 667 (if props
625 (insert "\nText properties\n")) 668 (insert "\nText properties\n"))
626 (while props 669 (while props
@@ -768,7 +811,7 @@ eight-bit-control and eight-bit-graphic.\n")
768 811
769The format is \"F[..],K[..],T[..],P>[..],P<[..], default F[..],P<[..],P<[..]\", 812The format is \"F[..],K[..],T[..],P>[..],P<[..], default F[..],P<[..],P<[..]\",
770where mnemonics of the following coding systems come in this order 813where mnemonics of the following coding systems come in this order
771at the place of `..': 814in place of `..':
772 `buffer-file-coding-system' (of the current buffer) 815 `buffer-file-coding-system' (of the current buffer)
773 eol-type of `buffer-file-coding-system' (of the current buffer) 816 eol-type of `buffer-file-coding-system' (of the current buffer)
774 Value returned by `keyboard-coding-system' 817 Value returned by `keyboard-coding-system'
@@ -857,7 +900,8 @@ at the place of `..':
857 900
858 (with-current-buffer standard-output 901 (with-current-buffer standard-output
859 902
860 (princ "\nPriority order for recognizing coding systems when reading files:\n") 903 (princ "
904Priority order for recognizing coding systems when reading files:\n")
861 (let ((l coding-category-list) 905 (let ((l coding-category-list)
862 (i 1) 906 (i 1)
863 (coding-list nil) 907 (coding-list nil)
@@ -898,7 +942,9 @@ at the place of `..':
898 (if codings 942 (if codings
899 (let ((max-col (frame-width)) 943 (let ((max-col (frame-width))
900 pos) 944 pos)
901 (princ (format " The followings are decoded correctly but recognized as %s:\n " coding-system)) 945 (princ (format "\
946 The following are decoded correctly but recognized as %s:\n "
947 coding-system))
902 (while codings 948 (while codings
903 (setq pos (point)) 949 (setq pos (point))
904 (insert (format " %s" (car codings))) 950 (insert (format " %s" (car codings)))
@@ -1094,10 +1140,11 @@ but still contains full information about each coding system."
1094 (with-output-to-temp-buffer "*Help*" 1140 (with-output-to-temp-buffer "*Help*"
1095 (describe-font-internal font-info 'verbose))))) 1141 (describe-font-internal font-info 'verbose)))))
1096 1142
1097;; Print information of FONTSET. If optional arg PRINT-FONTS is
1098;; non-nil, print also names of all opened fonts for FONTSET. This
1099;; function actually INSERT such information in the current buffer.
1100(defun print-fontset (fontset &optional print-fonts) 1143(defun print-fontset (fontset &optional print-fonts)
1144 "Print information about FONTSET.
1145If optional arg PRINT-FONTS is non-nil, also print names of all opened
1146fonts for FONTSET. This function actually inserts the information in
1147the current buffer."
1101 (let ((tail (aref (fontset-info fontset) 2)) 1148 (let ((tail (aref (fontset-info fontset) 2))
1102 elt chars font-spec opened prev-charset charset from to) 1149 elt chars font-spec opened prev-charset charset from to)
1103 (beginning-of-line) 1150 (beginning-of-line)
@@ -1163,7 +1210,7 @@ but still contains full information about each coding system."
1163 1210
1164;;;###autoload 1211;;;###autoload
1165(defun describe-fontset (fontset) 1212(defun describe-fontset (fontset)
1166 "Display information of FONTSET. 1213 "Display information about FONTSET.
1167This shows which font is used for which character(s)." 1214This shows which font is used for which character(s)."
1168 (interactive 1215 (interactive
1169 (if (not (and window-system (fboundp 'fontset-list))) 1216 (if (not (and window-system (fboundp 'fontset-list)))
@@ -1189,7 +1236,7 @@ This shows which font is used for which character(s)."
1189(defun list-fontsets (arg) 1236(defun list-fontsets (arg)
1190 "Display a list of all fontsets. 1237 "Display a list of all fontsets.
1191This shows the name, size, and style of each fontset. 1238This shows the name, size, and style of each fontset.
1192With prefix arg, it also list the fonts contained in each fontset; 1239With prefix arg, also list the fonts contained in each fontset;
1193see the function `describe-fontset' for the format of the list." 1240see the function `describe-fontset' for the format of the list."
1194 (interactive "P") 1241 (interactive "P")
1195 (if (not (and window-system (fboundp 'fontset-list))) 1242 (if (not (and window-system (fboundp 'fontset-list)))
@@ -1214,14 +1261,23 @@ see the function `describe-fontset' for the format of the list."
1214 "Display information about all input methods." 1261 "Display information about all input methods."
1215 (interactive) 1262 (interactive)
1216 (with-output-to-temp-buffer "*Help*" 1263 (with-output-to-temp-buffer "*Help*"
1217 (list-input-methods-1))) 1264 (list-input-methods-1)
1265 (with-current-buffer standard-output
1266 (save-excursion
1267 (goto-char (point-min))
1268 (while (re-search-forward
1269 "^ \\([^ ]+\\) (`.*' in mode line)$" nil t)
1270 (help-xref-button 1 #'describe-input-method
1271 (match-string 1)
1272 "mouse-2: describe this method")))
1273 (help-setup-xref '(list-input-methods) (interactive-p)))))
1218 1274
1219(defun list-input-methods-1 () 1275(defun list-input-methods-1 ()
1220 (if (not input-method-alist) 1276 (if (not input-method-alist)
1221 (progn 1277 (progn
1222 (princ " 1278 (princ "
1223No input method is available, perhaps because you have not yet 1279No input method is available, perhaps because you have not yet
1224installed LEIM (Libraries of Emacs Input Method). 1280installed LEIM (Libraries of Emacs Input Methods).
1225 1281
1226LEIM is available from the same ftp directory as Emacs. For instance, 1282LEIM is available from the same ftp directory as Emacs. For instance,
1227if there exists an archive file `emacs-M.N.tar.gz', there should also 1283if there exists an archive file `emacs-M.N.tar.gz', there should also
@@ -1344,53 +1400,4 @@ system which uses fontsets)."
1344 (setq fontsets (cdr fontsets))))) 1400 (setq fontsets (cdr fontsets)))))
1345 (print-help-return-message)))) 1401 (print-help-return-message))))
1346 1402
1347
1348;;; DUMP DATA FILE
1349
1350;;;###autoload
1351(defun dump-charsets ()
1352 "Dump information about all charsets into the file `CHARSETS'.
1353The file is saved in the directory `data-directory'."
1354 (let ((file (expand-file-name "CHARSETS" data-directory))
1355 buf)
1356 (or (file-writable-p file)
1357 (error "Can't write to file %s" file))
1358 (setq buf (find-file-noselect file))
1359 (save-window-excursion
1360 (with-current-buffer buf
1361 (setq buffer-read-only nil)
1362 (erase-buffer)
1363 (list-character-sets-2)
1364 (insert-buffer-substring "*Help*")
1365 (let (make-backup-files
1366 coding-system-for-write)
1367 (save-buffer))))
1368 (kill-buffer buf))
1369 (if noninteractive
1370 (kill-emacs)))
1371
1372;;;###autoload
1373(defun dump-codings ()
1374 "Dump information about all coding systems into the file `CODINGS'.
1375The file is saved in the directory `data-directory'."
1376 (let ((file (expand-file-name "CODINGS" data-directory))
1377 buf)
1378 (or (file-writable-p file)
1379 (error "Can't write to file %s" file))
1380 (setq buf (find-file-noselect file))
1381 (save-window-excursion
1382 (with-current-buffer buf
1383 (setq buffer-read-only nil)
1384 (erase-buffer)
1385 (list-coding-systems t)
1386 (insert-buffer-substring "*Help*")
1387 (list-coding-categories)
1388 (insert-buffer-substring "*Help*")
1389 (let (make-backup-files
1390 coding-system-for-write)
1391 (save-buffer))))
1392 (kill-buffer buf))
1393 (if noninteractive
1394 (kill-emacs)))
1395
1396;;; mule-diag.el ends here 1403;;; mule-diag.el ends here