aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKarl Heuer1998-06-03 14:38:07 +0000
committerKarl Heuer1998-06-03 14:38:07 +0000
commit13cef08d9d28029c66622f8f2aeda2b1aa3c3a6f (patch)
tree7dbbe37d680836331762e13b0dbc84bf03bd5208
parentca597f41ea26ecb93acf53b448b5a85e1931ec1b (diff)
downloademacs-13cef08d9d28029c66622f8f2aeda2b1aa3c3a6f.tar.gz
emacs-13cef08d9d28029c66622f8f2aeda2b1aa3c3a6f.zip
(list-character-sets-1): New subroutine.
(list-character-sets): Use it. (list-coding-systems-1): New subroutine. (list-coding-systems): Use it. (list-input-methods-1): New subroutine. (list-input-methods): Use it. (mule-diag): Avoid method of displaying text in *Help* then copying it. Instead, insert it directly into *Mule-Diagnosis*. Use list-character-sets-1, list-coding-systems-1, list-input-methods-1. Copy the code from list-fontsets and list-coding-categories. Improve the display buffer's header.
-rw-r--r--lisp/international/mule-diag.el178
1 files changed, 99 insertions, 79 deletions
diff --git a/lisp/international/mule-diag.el b/lisp/international/mule-diag.el
index 2ebf0eaf7e0..188a681370c 100644
--- a/lisp/international/mule-diag.el
+++ b/lisp/international/mule-diag.el
@@ -59,21 +59,26 @@ but still shows the full information."
59 (with-output-to-temp-buffer "*Help*" 59 (with-output-to-temp-buffer "*Help*"
60 (save-excursion 60 (save-excursion
61 (set-buffer standard-output) 61 (set-buffer standard-output)
62 (let ((l charset-list) 62 (list-character-sets-1 arg)
63 charset) 63 (help-mode)
64 (if (null arg) 64 (setq truncate-lines t))))
65 (progn 65
66 (insert "ID Name B W Description\n") 66(defun list-character-sets-1 (arg)
67 (insert "-- ---- - - -----------\n") 67 (let ((l charset-list)
68 (while l 68 charset)
69 (setq charset (car l) l (cdr l)) 69 (if (null arg)
70 (insert (format "%03d %s" (charset-id charset) charset)) 70 (progn
71 (indent-to 28) 71 (insert "ID Name B W Description\n")
72 (insert (format "%d %d %s\n" 72 (insert "-- ---- - - -----------\n")
73 (charset-bytes charset) 73 (while l
74 (charset-width charset) 74 (setq charset (car l) l (cdr l))
75 (charset-description charset))))) 75 (insert (format "%03d %s" (charset-id charset) charset))
76 (insert "\ 76 (indent-to 28)
77 (insert (format "%d %d %s\n"
78 (charset-bytes charset)
79 (charset-width charset)
80 (charset-description charset)))))
81 (insert "\
77######################### 82#########################
78## LIST OF CHARSETS 83## LIST OF CHARSETS
79## Each line corresponds to one charset. 84## Each line corresponds to one charset.
@@ -90,21 +95,19 @@ but still shows the full information."
90## ISO-GRAPHIC-PLANE (ISO-2022's graphic plane, 0:GL, 1:GR) 95## ISO-GRAPHIC-PLANE (ISO-2022's graphic plane, 0:GL, 1:GR)
91## DESCRIPTION (describing string of the charset) 96## DESCRIPTION (describing string of the charset)
92") 97")
93 (while l 98 (while l
94 (setq charset (car l) l (cdr l)) 99 (setq charset (car l) l (cdr l))
95 (princ (format "%03d:%s:%d:%d:%d:%d:%d:%d:%d:%s\n" 100 (princ (format "%03d:%s:%d:%d:%d:%d:%d:%d:%d:%s\n"
96 (charset-id charset) 101 (charset-id charset)
97 charset 102 charset
98 (charset-dimension charset) 103 (charset-dimension charset)
99 (charset-chars charset) 104 (charset-chars charset)
100 (charset-bytes charset) 105 (charset-bytes charset)
101 (charset-width charset) 106 (charset-width charset)
102 (charset-direction charset) 107 (charset-direction charset)
103 (charset-iso-final-char charset) 108 (charset-iso-final-char charset)
104 (charset-iso-graphic-plane charset) 109 (charset-iso-graphic-plane charset)
105 (charset-description charset)))))) 110 (charset-description charset)))))))
106 (help-mode)
107 (setq truncate-lines t))))
108 111
109;;; CODING-SYSTEM 112;;; CODING-SYSTEM
110 113
@@ -475,14 +478,17 @@ With prefix arg, the output format gets more cryptic,
475but still contains full information about each coding system." 478but still contains full information about each coding system."
476 (interactive "P") 479 (interactive "P")
477 (with-output-to-temp-buffer "*Help*" 480 (with-output-to-temp-buffer "*Help*"
478 (if (null arg) 481 (list-coding-systems-1 arg)))
479 (princ "\ 482
483(defun list-coding-systems-1 (arg)
484 (if (null arg)
485 (princ "\
480############################################### 486###############################################
481# List of coding systems in the following format: 487# List of coding systems in the following format:
482# MNEMONIC-LETTER -- CODING-SYSTEM-NAME 488# MNEMONIC-LETTER -- CODING-SYSTEM-NAME
483# DOC-STRING 489# DOC-STRING
484") 490")
485 (princ "\ 491 (princ "\
486######################### 492#########################
487## LIST OF CODING SYSTEMS 493## LIST OF CODING SYSTEMS
488## Each line corresponds to one coding system 494## Each line corresponds to one coding system
@@ -507,14 +513,14 @@ but still contains full information about each coding system."
507## POST-READ-CONVERSION, PRE-WRITE-CONVERSION = function name to be called 513## POST-READ-CONVERSION, PRE-WRITE-CONVERSION = function name to be called
508## 514##
509")) 515"))
510 (let ((bases (coding-system-list 'base-only)) 516 (let ((bases (coding-system-list 'base-only))
511 coding-system) 517 coding-system)
512 (while bases 518 (while bases
513 (setq coding-system (car bases)) 519 (setq coding-system (car bases))
514 (if (null arg) 520 (if (null arg)
515 (print-coding-system-briefly coding-system 'doc-string) 521 (print-coding-system-briefly coding-system 'doc-string)
516 (print-coding-system coding-system)) 522 (print-coding-system coding-system))
517 (setq bases (cdr bases)))))) 523 (setq bases (cdr bases)))))
518 524
519;;;###automatic 525;;;###automatic
520(defun list-coding-categories () 526(defun list-coding-categories ()
@@ -662,6 +668,7 @@ see the function `describe-fontset' for the format of the list."
662 (error "No fontsets being used") 668 (error "No fontsets being used")
663 (with-output-to-temp-buffer "*Help*" 669 (with-output-to-temp-buffer "*Help*"
664 (save-excursion 670 (save-excursion
671 ;; This code is duplicated near the end of mule-diag.
665 (set-buffer standard-output) 672 (set-buffer standard-output)
666 (insert "Fontset-Name\t\t\t\t\t\t WDxHT Style\n") 673 (insert "Fontset-Name\t\t\t\t\t\t WDxHT Style\n")
667 (insert "------------\t\t\t\t\t\t ----- -----\n") 674 (insert "------------\t\t\t\t\t\t ----- -----\n")
@@ -675,9 +682,12 @@ see the function `describe-fontset' for the format of the list."
675 "Display information about all input methods." 682 "Display information about all input methods."
676 (interactive) 683 (interactive)
677 (with-output-to-temp-buffer "*Help*" 684 (with-output-to-temp-buffer "*Help*"
678 (if (not input-method-alist) 685 (list-input-methods-1)))
679 (progn 686
680 (princ " 687(defun list-input-methods-1 ()
688 (if (not input-method-alist)
689 (progn
690 (princ "
681No input method is available, perhaps because you have not yet 691No input method is available, perhaps because you have not yet
682installed LEIM (Libraries of Emacs Input Method). 692installed LEIM (Libraries of Emacs Input Method).
683 693
@@ -686,28 +696,28 @@ if there exists an archive file `emacs-20.N.tar.gz', there should also
686be a file `leim-20.N.tar.gz'. When you extract this file, LEIM files 696be a file `leim-20.N.tar.gz'. When you extract this file, LEIM files
687are put under the subdirectory `emacs-20.N/leim'. When you install 697are put under the subdirectory `emacs-20.N/leim'. When you install
688Emacs again, you should be able to use various input methods.")) 698Emacs again, you should be able to use various input methods."))
689 (princ "LANGUAGE\n NAME (`TITLE' in mode line)\n") 699 (princ "LANGUAGE\n NAME (`TITLE' in mode line)\n")
690 (princ " SHORT-DESCRIPTION\n------------------------------\n") 700 (princ " SHORT-DESCRIPTION\n------------------------------\n")
691 (setq input-method-alist 701 (setq input-method-alist
692 (sort input-method-alist 702 (sort input-method-alist
693 (function (lambda (x y) (string< (nth 1 x) (nth 1 y)))))) 703 (function (lambda (x y) (string< (nth 1 x) (nth 1 y))))))
694 (let ((l input-method-alist) 704 (let ((l input-method-alist)
695 language elt) 705 language elt)
696 (while l 706 (while l
697 (setq elt (car l) l (cdr l)) 707 (setq elt (car l) l (cdr l))
698 (when (not (equal language (nth 1 elt))) 708 (when (not (equal language (nth 1 elt)))
699 (setq language (nth 1 elt)) 709 (setq language (nth 1 elt))
700 (princ language) 710 (princ language)
701 (terpri)) 711 (terpri))
702 (princ (format " %s (`%s' in mode line)\n %s\n" 712 (princ (format " %s (`%s' in mode line)\n %s\n"
703 (car elt) 713 (car elt)
704 (let ((title (nth 3 elt))) 714 (let ((title (nth 3 elt)))
705 (if (and (consp title) (stringp (car title))) 715 (if (and (consp title) (stringp (car title)))
706 (car title) 716 (car title)
707 title)) 717 title))
708 (let ((description (nth 4 elt))) 718 (let ((description (nth 4 elt)))
709 (string-match ".*" description) 719 (string-match ".*" description)
710 (match-string 0 description))))))))) 720 (match-string 0 description))))))))
711 721
712;;; DIAGNOSIS 722;;; DIAGNOSIS
713 723
@@ -729,9 +739,9 @@ system which uses fontsets)."
729 (with-output-to-temp-buffer "*Mule-Diagnosis*" 739 (with-output-to-temp-buffer "*Mule-Diagnosis*"
730 (save-excursion 740 (save-excursion
731 (set-buffer standard-output) 741 (set-buffer standard-output)
732 (insert "\t###############################\n" 742 (insert "###############################################\n"
733 "\t### Diagnosis of your Emacs ###\n" 743 "### Current Status of Multilingual Features ###\n"
734 "\t###############################\n\n" 744 "###############################################\n\n"
735 "CONTENTS: Section 1. General Information\n" 745 "CONTENTS: Section 1. General Information\n"
736 " Section 2. Display\n" 746 " Section 2. Display\n"
737 " Section 3. Input methods\n" 747 " Section 3. Input methods\n"
@@ -762,29 +772,39 @@ system which uses fontsets)."
762 (insert "\n\n") 772 (insert "\n\n")
763 773
764 (insert-section 3 "Input methods") 774 (insert-section 3 "Input methods")
765 (save-excursion (list-input-methods)) 775 (list-input-methods-1)
766 (insert-buffer-substring "*Help*")
767 (insert "\n") 776 (insert "\n")
768 (if default-input-method 777 (if default-input-method
769 (insert "Default input method: " default-input-method "\n") 778 (insert "Default input method: " default-input-method "\n")
770 (insert "No default input method is specified\n")) 779 (insert "No default input method is specified\n"))
771 780
772 (insert-section 4 "Coding systems") 781 (insert-section 4 "Coding systems")
773 (save-excursion (list-coding-systems t)) 782 (list-coding-systems-1 t)
774 (insert-buffer-substring "*Help*") 783 (princ "\
775 (save-excursion (list-coding-categories)) 784############################
776 (insert-buffer-substring "*Help*") 785## LIST OF CODING CATEGORIES (ordered by priority)
786## CATEGORY:CODING-SYSTEM
787##
788")
789 (let ((l coding-category-list))
790 (while l
791 (princ (format "%s:%s\n" (car l) (symbol-value (car l))))
792 (setq l (cdr l))))
777 (insert "\n") 793 (insert "\n")
778 794
779 (insert-section 5 "Character sets") 795 (insert-section 5 "Character sets")
780 (save-excursion (list-character-sets t)) 796 (list-character-sets-1 t)
781 (insert-buffer-substring "*Help*")
782 (insert "\n") 797 (insert "\n")
783 798
784 (when (and window-system (boundp 'global-fontset-alist)) 799 (when (and window-system (boundp 'global-fontset-alist))
800 ;; This code duplicates most of list-fontsets.
785 (insert-section 6 "Fontsets") 801 (insert-section 6 "Fontsets")
786 (save-excursion (list-fontsets t)) 802 (insert "Fontset-Name\t\t\t\t\t\t WDxHT Style\n")
787 (insert-buffer-substring "*Help*")) 803 (insert "------------\t\t\t\t\t\t ----- -----\n")
804 (let ((fontsets (fontset-list)))
805 (while fontsets
806 (print-fontset (car fontsets) t)
807 (setq fontsets (cdr fontsets)))))
788 (print-help-return-message)))) 808 (print-help-return-message))))
789 809
790 810