annotate lisp/mule/mule-debug.el @ 70:131b0175ea99 r20-0b30

Import from CVS: tag r20-0b30
author cvs
date Mon, 13 Aug 2007 09:02:59 +0200
parents
children a145efe76779
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1 ;;; mule-diag.el --- debugging functions for Mule.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
3 ;; Copyright (C) 1992 Free Software Foundation, Inc.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
4 ;; Copyright (C) 1995 Sun Microsystems.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
5
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
6 ;; This file is part of XEmacs.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
7
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
8 ;; XEmacs is free software; you can redistribute it and/or modify it
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
9 ;; under the terms of the GNU General Public License as published by
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
10 ;; the Free Software Foundation; either version 2, or (at your option)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
11 ;; any later version.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
12
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
13 ;; XEmacs is distributed in the hope that it will be useful, but
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
14 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
15 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
16 ;; General Public License for more details.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
17
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
18 ;; You should have received a copy of the GNU General Public License
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
19 ;; along with XEmacs; see the file COPYING. If not, write to the
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
20 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
21 ;; Boston, MA 02111-1307, USA.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
22
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
23 ;;; 93.7.28 created for Mule Ver.0.9.8 by K.Handa <handa@etl.go.jp>
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
24
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
25 ;;; General utility function
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
26
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
27 (defun mule-debug-princ-list (&rest args)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
28 (while (cdr args)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
29 (if (car args)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
30 (progn (princ (car args)) (princ " ")))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
31 (setq args (cdr args)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
32 (princ (car args))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
33 (princ "\n"))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
34
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
35 ;;; character sets
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
36
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
37 ;;;###autoload
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
38 (defun list-charsets ()
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
39 "Display a list of existing character sets."
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
40 (interactive)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
41 (with-output-to-temp-buffer "*Charset List*"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
42 (princ "## LIST OF CHARACTER SETS\n")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
43 (princ
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
44 "NAME REGISTRY BYTES CHARS FINAL GRAPHIC DIR\n")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
45 (princ
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
46 "--------------------------------------------------------------------")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
47 (mapcar
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
48 (lambda (name)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
49 (let ((charset (get-charset name)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
50 (princ (format
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
51 "%20s %15s %5d %5d %5d %7d %s\n"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
52 name
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
53 (charset-registry charset)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
54 (charset-dimension charset)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
55 (charset-chars charset)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
56 (charset-final charset)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
57 (charset-graphic charset)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
58 (charset-direction charset)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
59 (princ " ")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
60 (princ "%s\n" (charset-doc-string charset))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
61 (charset-list))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
62
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
63 (princ "## CCL PROGRAM TO CONVERT INTERNAL TO EXTERNAL CODE\n")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
64 (princ "NAME CCL-PROGRAMS\n")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
65 (mapcar
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
66 (lambda (name)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
67 (let ((ccl (charset-ccl-program name)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
68 (if ccl
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
69 (let ((i 0) (len (length ccl)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
70 (princ (format "%20s " name))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
71 (while (< i len)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
72 (princ (format " %x" (aref ccl i)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
73 (setq i (1+ i)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
74 (princ "\n")))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
75 (charset-list))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
76 ))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
77
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
78 (defun describe-designation (flags graphic)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
79 (let ((lc (aref flags graphic))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
80 lc1)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
81 (if (integerp lc) (setq lc1 (if (> lc 0) lc (- lc))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
82 (princ (format " G%d -- %s"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
83 graphic
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
84 (or (and lc1 (char-description lc1))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
85 (and (eq lc t) "never used")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
86 "none")))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
87 (princ (if (and lc1 (< lc 0))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
88 " (explicit designation required)\n"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
89 "\n"))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
90 ;; end of patch
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
91
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
92 ;;;###autoload
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
93 (defun describe-coding-system (cs)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
94 "Display documentation of the coding-system CS."
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
95 (interactive "zCoding-system: ")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
96 (get-coding-system cs);; correctness check
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
97 (with-output-to-temp-buffer "*Help*"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
98 (princ "Coding-system ")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
99 (princ cs)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
100 (princ " [")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
101 (princ (coding-system-mnemonic cs))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
102 (princ "]: \n")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
103 (if (not cs) nil
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
104 (princ " ")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
105 (princ (coding-system-doc-string cs))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
106 (princ "\nType: ")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
107 (let ((type (coding-system-type cs)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
108 (princ type)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
109 (cond ((eq type 'iso2022)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
110 (princ "ISO-2022]\n")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
111 (princ "Initial designations:\n")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
112 (describe-designation coding-system 0)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
113 (describe-designation coding-system 1)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
114 (describe-designation coding-system 2)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
115 (describe-designation coding-system 3)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
116 (princ "Other Form: \n")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
117 (princ (if (aref flags 4) "ShortForm" "LongForm"))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
118 (if (aref flags 5) (princ ", ASCII@EOL"))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
119 (if (aref flags 6) (princ ", ASCII@CNTL"))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
120 (princ (if (aref flags 7) ", 7bit" ", 8bit"))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
121 (if (aref flags 8) (princ ", UseLockingShift"))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
122 (if (aref flags 9) (princ ", UseRoman"))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
123 (if (aref flags 10) (princ ", UseOldJIS"))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
124 (if (aref flags 11) (princ ", No ISO6429"))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
125 (princ ".\n"))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
126 ((eq type 'big5)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
127 (princ (if flags "Big-ETen\n" "Big-HKU\n")))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
128 ))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
129 (princ "\nEOL-Type: ")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
130 (let ((eol-type (coding-system-eol-type cs)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
131 (cond ((null eol-type)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
132 (princ "null (= LF)\n"))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
133 ((vectorp eol-type)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
134 (princ "Automatic selection from ")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
135 (princ eol-type)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
136 (princ "\n"))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
137 ((eq eol-type 1) (princ "LF\n"))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
138 ((eq eol-type 2) (princ "CRLF\n"))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
139 ((eq eol-type 3) (princ "CR\n"))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
140 (t (princ "invalid\n"))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
141 )))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
142
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
143 ;;;###autoload
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
144 (defun list-coding-system-briefly ()
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
145 "Display coding-systems currently used with a brief format in mini-buffer."
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
146 (interactive)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
147 (let ((cs (and (fboundp 'process-coding-system) (process-coding-system)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
148 eol-type)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
149 (message
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
150 "current: [FKDPp=%c%c%c%c%c%c%c%c] default: [FPp=%c%c%c%c%c%c]"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
151 (coding-system-mnemonic file-coding-system)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
152 (coding-system-eol-mnemonic file-coding-system)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
153 (coding-system-mnemonic keyboard-coding-system)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
154 (coding-system-mnemonic terminal-coding-system)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
155 (coding-system-mnemonic (car cs))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
156 (coding-system-eol-mnemonic (car cs))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
157 (coding-system-mnemonic (cdr cs))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
158 (coding-system-eol-mnemonic (cdr cs))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
159 (coding-system-mnemonic (default-value 'file-coding-system))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
160 (coding-system-eol-mnemonic (default-value 'file-coding-system))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
161 (coding-system-mnemonic (car default-process-coding-system))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
162 (coding-system-eol-mnemonic (car default-process-coding-system))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
163 (coding-system-mnemonic (cdr default-process-coding-system))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
164 (coding-system-eol-mnemonic (cdr default-process-coding-system))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
165 )))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
166
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
167 (defun princ-coding-system (code)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
168 (princ ": ")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
169 (princ code)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
170 (princ " [")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
171 (princ (char-to-string (coding-system-mnemonic code)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
172 (princ (char-to-string (coding-system-eol-mnemonic code)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
173 (princ "]\n"))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
174
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
175 (defun todigit (flags idx &optional default-value)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
176 (if (aref flags idx)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
177 (if (numberp (aref flags idx)) (aref flags idx) 1)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
178 (or default-value 0)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
179
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
180 (defun print-coding-system-description (code)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
181 (let ((type (get-code-type code))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
182 (eol (or (get-code-eol code) 1))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
183 (flags (get-code-flags code))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
184 line)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
185 (setq type
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
186 (cond ((null type) 0)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
187 ((eq type t) 2)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
188 ((eq type 0) 1)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
189 ((eq type 1) 3)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
190 ((eq type 2) 4)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
191 ((eq type 3) 5)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
192 ((eq type 4) 6)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
193 (t nil)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
194 (if (or (null type)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
195 (get code 'post-read-conversion)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
196 (get (get-base-code code) 'post-read-conversion)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
197 (get code 'pre-write-conversion)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
198 (get (get-base-code code) 'pre-write-conversion)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
199 (eq code '*noconv*))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
200 nil
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
201 (princ
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
202 (format "%s:%d:%c:"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
203 code type (coding-system-mnemonic code)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
204 (princ (format "%d" (if (numberp eol) eol 0)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
205 (cond ((= type 4)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
206 (princ
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
207 (format
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
208 ":%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
209 (todigit flags 0 -1)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
210 (todigit flags 1 -1)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
211 (todigit flags 2 -1)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
212 (todigit flags 3 -1)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
213 (todigit flags 4)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
214 (todigit flags 5)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
215 (todigit flags 6)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
216 (todigit flags 7)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
217 (todigit flags 8)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
218 (todigit flags 9)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
219 (todigit flags 10)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
220 (todigit flags 11))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
221 ((= type 5)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
222 (princ ":0"))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
223 ((= type 6)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
224 (if (and (vectorp (car flags)) (vectorp (cdr flags)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
225 (let (i len)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
226 (princ ":")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
227 (setq i 0 len (length (car flags)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
228 (while (< i len)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
229 (princ (format " %x" (aref (car flags) i)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
230 (setq i (1+ i)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
231 (princ ",")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
232 (setq i 0 len (length (cdr flags)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
233 (while (< i len)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
234 (princ (format " %x" (aref (cdr flags) i)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
235 (setq i (1+ i))))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
236 (t (princ ":0")))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
237 (princ ":")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
238 (princ (get-code-document code))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
239 (princ "\n"))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
240 ))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
241
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
242 ;;;###autoload
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
243 (defun list-coding-system (&optional all)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
244 "Describe coding-systems currently used with a detailed format.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
245 If optional arg ALL is non-nil, all coding-systems are listed in
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
246 machine readable simple format."
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
247 (interactive "P")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
248 (with-output-to-temp-buffer "*Help*"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
249 (if (null all)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
250 (let ((cs (and (fboundp 'process-coding-system)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
251 (process-coding-system))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
252 (princ "Current:\n file-coding-system")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
253 (princ-coding-system file-coding-system)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
254 (princ " keyboard-coding-system")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
255 (princ-coding-system keyboard-coding-system)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
256 (princ " terminal-coding-system")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
257 (princ-coding-system terminal-coding-system)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
258 (when cs
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
259 (princ " process-coding-system (input)")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
260 (princ-coding-system (car cs))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
261 (princ " process-coding-system (output)")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
262 (princ-coding-system (cdr cs)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
263 (princ "Default:\n file-coding-system")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
264 (princ-coding-system (default-value 'file-coding-system))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
265 (princ " process-coding-system (input)")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
266 (princ-coding-system (car default-process-coding-system))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
267 (princ " process-coding-system (output)")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
268 (princ-coding-system (cdr default-process-coding-system))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
269 (princ "Others:\n file-coding-system-for-read")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
270 (princ-coding-system file-coding-system-for-read)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
271 (princ "Coding categories by priority:\n")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
272 (princ (coding-priority-list)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
273 (princ "########################\n")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
274 (princ "## LIST OF CODING SYSTEM\n")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
275 (princ "## NAME(str):TYPE(int):MNEMONIC(char):EOL(int):FLAGS:DOC(str)\n")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
276 (princ "## TYPE = 0(no conversion),1(auto conversion),\n")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
277 (princ "## 2(Mule internal),3(SJIS),4(ISO2022),5(BIG5),6(CCL)\n")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
278 (princ "## EOL = 0(AUTO), 1(LF), 2(CRLF), 3(CR)\n")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
279 (princ "## FLAGS =\n")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
280 (princ "## if TYPE = 4 then\n")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
281 (princ "## G0,G1,G2,G3,SHORT,ASCII-EOL,ASCII-CNTL,SEVEN,\n")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
282 (princ "## LOCK-SHIFT,USE-ROMAN,USE-OLDJIS\n")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
283 (princ "## else if TYPE = 6 then\n")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
284 (princ "## CCL_PROGRAM_FOR_READ,CCL_PROGRAM_FOR_WRITE\n")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
285 (princ "## else\n")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
286 (princ "## 0\n")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
287 (princ "##\n")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
288 (let ((codings nil))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
289 (mapatoms
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
290 (function
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
291 (lambda (arg)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
292 (if (eq arg '*noconv*)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
293 nil
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
294 (if (and (or (vectorp (get arg 'coding-system))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
295 (vectorp (get arg 'eol-type)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
296 (null (get arg 'pre-write-conversion))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
297 (null (get arg 'post-read-conversion)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
298 (setq codings (cons arg codings)))))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
299 (while codings
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
300 (print-coding-system-description (car codings))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
301 (setq codings (cdr codings))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
302 (princ "############################\n")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
303 (princ "## LIST OF CODING CATEGORIES (ordered by priority)\n")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
304 (princ "## CATEGORY(str):CODING-SYSTEM(str)\n")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
305 (princ "##\n")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
306 (princ (coding-priority-list))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
307 )))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
308
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
309 ;;; FONT
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
310 (defun describe-font-internal (fontinfo &optional verbose)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
311 (let ((cs (character-set (aref fontinfo 3))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
312 (mule-debug-princ-list (format "Font #%02d for" (aref fontinfo 0))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
313 (nth 6 cs) (nth 7 cs) "--"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
314 (cond ((= (aref fontinfo 4) 0) "NOT YET OPENED")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
315 ((= (aref fontinfo 4) 1) "OPENED")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
316 (t "NOT FOUND")))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
317 (mule-debug-princ-list " request:" (aref fontinfo 1))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
318 (if (= (aref fontinfo 4) 1)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
319 (mule-debug-princ-list " opened:" (aref fontinfo 2)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
320 (if (and verbose (= (aref fontinfo 4) 1))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
321 (progn
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
322 (mule-debug-princ-list " size:" (format "%d" (aref fontinfo 5)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
323 (mule-debug-princ-list " encoding:" (if (= (aref fontinfo 6) 0) "low" "high"))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
324 (mule-debug-princ-list " yoffset:" (format "%d" (aref fontinfo 7)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
325 (mule-debug-princ-list " rel-cmp:" (format "%d" (aref fontinfo 8)))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
326 ))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
327
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
328 ;;;###autoload
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
329 (defun describe-font (fontname)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
330 "Display information about fonts which partially match FONTNAME."
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
331 (interactive "sFontname: ")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
332 (setq fontname (regexp-quote fontname))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
333 (with-output-to-temp-buffer "*Help*"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
334 (let ((fontlist (font-list)) fontinfo)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
335 (while fontlist
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
336 (setq fontinfo (car fontlist))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
337 (if (or (string-match fontname (aref fontinfo 1))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
338 (and (aref fontinfo 2)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
339 (string-match fontname (aref fontinfo 2))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
340 (describe-font-internal fontinfo 'verbose))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
341 (setq fontlist (cdr fontlist))))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
342
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
343 ;;;###autoload
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
344 (defun list-font ()
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
345 "Display a list of fonts."
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
346 (interactive)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
347 (with-output-to-temp-buffer "*Help*"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
348 (let ((fontlist (font-list)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
349 (while fontlist
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
350 (describe-font-internal (car fontlist))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
351 (setq fontlist (cdr fontlist))))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
352
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
353 ;;; FONTSET
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
354 (defun describe-fontset-internal (fontset-info)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
355 (mule-debug-princ-list "### Fontset-name:" (car fontset-info) "###")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
356 (let ((i 0) font)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
357 (while (< i 128)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
358 (if (>= (setq font (aref (cdr fontset-info) i)) 0)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
359 (describe-font-internal (get-font-info font)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
360 (setq i (1+ i)))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
361
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
362 ;;;###autoload
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
363 (defun describe-fontset (fontset)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
364 "Display information about FONTSET."
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
365 (interactive
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
366 (let ((fontset-list (mapcar '(lambda (x) (list x)) (fontset-list))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
367 (list (completing-read "Fontset: " fontset-list nil 'match))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
368 (let ((fontset-info (get-fontset-info fontset)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
369 (if fontset-info
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
370 (with-output-to-temp-buffer "*Help*"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
371 (describe-fontset-internal fontset-info))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
372 (error "No such fontset: %s" fontset))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
373
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
374 ;;;###autoload
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
375 (defun list-fontset ()
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
376 "Display a list of fontsets."
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
377 (interactive)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
378 (with-output-to-temp-buffer "*Help*"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
379 (let ((fontsetlist (fontset-list 'all)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
380 (while fontsetlist
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
381 (describe-fontset-internal (car fontsetlist))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
382 (setq fontsetlist (cdr fontsetlist))))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
383
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
384 ;;; DIAGNOSIS
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
385
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
386 (defun insert-list (args)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
387 (while (cdr args)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
388 (insert (or (car args) "nil") " ")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
389 (setq args (cdr args)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
390 (if args (insert (or (car args) "nil")))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
391 (insert "\n"))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
392
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
393 (defun insert-section (sec title)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
394 (insert "########################################\n"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
395 "# Section " (format "%d" sec) ". " title "\n"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
396 "########################################\n\n"))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
397
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
398 ;;;###autoload
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
399 (defun mule-diag ()
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
400 "Show diagnosis of the current running Mule."
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
401 (interactive)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
402 (let ((buf (get-buffer-create "*Diagnosis*")))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
403 (save-excursion
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
404 (set-buffer buf)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
405 (erase-buffer)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
406 (insert "\t##############################\n"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
407 "\t### DIAGNOSIS OF YOUR MULE ###\n"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
408 "\t##############################\n\n"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
409 "CONTENTS: Section 0. General information\n"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
410 " Section 1. Display\n"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
411 " Section 2. Input methods\n"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
412 " Section 3. Coding-systems\n"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
413 " Section 4. Character sets\n")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
414 (if window-system
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
415 (insert " Section 5. Fontset list\n"))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
416 (insert "\n")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
417
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
418 (insert-section 0 "General information")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
419 (insert "Mule's version: " mule-version " of " mule-version-date "\n")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
420 (if window-system
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
421 (insert "Window-system: "
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
422 (symbol-name window-system)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
423 (format "%s" window-system-version))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
424 (insert "Terminal: " (getenv "TERM")))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
425 (insert "\n\n")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
426
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
427 (insert-section 1 "Display")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
428 (if (eq window-system 'x)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
429 (let* ((alist (nth 1 (assq (selected-frame)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
430 (current-frame-configuration))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
431 (fontset (cdr (assq 'font alist))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
432 (insert-list (cons "Defined fontsets:" (fontset-list)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
433 (insert "Current frame's fontset: " fontset "\n"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
434 "See Section 5 for more detail.\n\n"))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
435 (insert "Coding system for output to terminal: "
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
436 (symbol-name terminal-coding-system)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
437 "\n\n"))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
438 (insert-section 2 "Input methods")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
439 (if (featurep 'egg)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
440 (let (temp)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
441 (insert "EGG (Version " egg-version ")\n")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
442 (insert " jserver host list: ")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
443 (insert-list (if (boundp 'jserver-list) jserver-list
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
444 (if (setq temp (getenv "JSERVER"))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
445 (list temp))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
446 (insert " cserver host list: ")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
447 (insert-list (if (boundp 'cserver-list) cserver-list
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
448 (if (setq temp (getenv "CSERVER"))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
449 (list temp))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
450 (insert " loaded ITS mode:\n\t")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
451 (insert-list (mapcar 'car its:*mode-alist*))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
452 (insert " current server:" (symbol-name wnn-server-type) "\n"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
453 " current ITS mode:"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
454 (let ((mode its:*mode-alist*))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
455 (while (not (eq (cdr (car mode)) its:*current-map*))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
456 (setq mode (cdr mode)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
457 (car (car mode))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
458 (insert "\n")))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
459 (insert "QUAIL (Version " quail-version ")\n")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
460 (insert " Quail packages: (not-yet-loaded) [current]\n\t")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
461 (let ((l quail-package-alist)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
462 (current (or (car quail-current-package) "")))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
463 (while l
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
464 (cond ((string= current (car (car l)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
465 (insert "[" (car (car l)) "]"))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
466 ((nth 2 (car l))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
467 (insert (car (car l))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
468 (t
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
469 (insert "(" (car (car l)) ")")))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
470 (if (setq l (cdr l)) (insert " ") (insert "\n"))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
471 (if (featurep 'canna)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
472 (insert "CANNA (Version " canna-rcs-version ")\n"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
473 " server:" (or canna-server "Not specified") "\n"))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
474 (if (featurep 'sj3-egg)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
475 (insert "SJ3 (Version" sj3-egg-version ")\n"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
476 " server:" (get-sj3-host-name) "\n"))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
477 (insert "\n")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
478
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
479 (insert-section 3 "Coding systems")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
480 (save-excursion (list-coding-systems))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
481 (insert-buffer "*Help*")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
482 (goto-char (point-max))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
483 (insert "\n")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
484
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
485 (insert-section 4 "Character sets")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
486 (save-excursion (list-charsets))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
487 (insert-buffer "*Help*")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
488 (goto-char (point-max))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
489 (insert "\n")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
490
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
491 (if window-system
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
492 (progn
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
493 (insert-section 5 "Fontset list")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
494 (save-excursion (list-fontset))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
495 (insert-buffer "*Help*")))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
496
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
497 (set-buffer-modified-p nil)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
498 )
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
499 (let ((win (display-buffer buf)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
500 (set-window-point win 1)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
501 (set-window-start win 1))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
502 ))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
503
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
504 ;;; DUMP DATA FILE
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
505
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
506 ;;;###autoload
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
507 (defun dump-charsets ()
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
508 (list-charsets)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
509 (set-buffer (get-buffer "*Help*"))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
510 (let (make-backup-files)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
511 (write-region (point-min) (point-max) "charsets.lst"))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
512 (kill-emacs))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
513
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
514 ;;;###autoload
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
515 (defun dump-coding-systems ()
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
516 (list-coding-systems 'all)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
517 (set-buffer (get-buffer "*Help*"))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
518 (let (make-backup-files)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
519 (write-region (point-min) (point-max) "coding-systems.lst"))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
520 (kill-emacs))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
521