annotate lisp/mule/mule-debug.el @ 152:4c132ee2d62b

Added tag r20-3b2 for changeset 59463afc5666
author cvs
date Mon, 13 Aug 2007 09:37:21 +0200
parents fe104dbd9147
children e45d5e7c476e
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 "--------------------------------------------------------------------")
102
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 70
diff changeset
47 (dolist (charset (charset-list))
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 70
diff changeset
48 (setq charset (get-charset charset))
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 70
diff changeset
49 (princ (format
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 70
diff changeset
50 "%20s %15s %5d %5d %5d %7d %s\n"
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 70
diff changeset
51 (charset-name charset)
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 70
diff changeset
52 (charset-registry charset)
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 70
diff changeset
53 (charset-dimension charset)
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 70
diff changeset
54 (charset-chars charset)
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 70
diff changeset
55 (charset-final charset)
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 70
diff changeset
56 (charset-graphic charset)
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 70
diff changeset
57 (charset-direction charset)))
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 70
diff changeset
58 (princ " ")
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 70
diff changeset
59 (princ "%s\n" (charset-doc-string charset)))))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
60
102
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 70
diff changeset
61 ; (princ "## CCL PROGRAM TO CONVERT INTERNAL TO EXTERNAL CODE\n")
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 70
diff changeset
62 ; (princ "NAME CCL-PROGRAMS\n")
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 70
diff changeset
63 ; (mapcar
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 70
diff changeset
64 ; (lambda (name)
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 70
diff changeset
65 ; (let ((ccl (charset-ccl-program name)))
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 70
diff changeset
66 ; (if ccl
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 70
diff changeset
67 ; (let ((i 0) (len (length ccl)))
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 70
diff changeset
68 ; (princ (format "%20s " name))
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 70
diff changeset
69 ; (while (< i len)
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 70
diff changeset
70 ; (princ (format " %x" (aref ccl i)))
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 70
diff changeset
71 ; (setq i (1+ i)))
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 70
diff changeset
72 ; (princ "\n")))))
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 70
diff changeset
73 ; (charset-list))
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 70
diff changeset
74 ; ))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
75
102
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 70
diff changeset
76 (defun describe-designation (cs register)
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 70
diff changeset
77 (let ((charset
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 70
diff changeset
78 (coding-system-property
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 70
diff changeset
79 cs (intern (format "charset-g%d" register))))
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 70
diff changeset
80 (force
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 70
diff changeset
81 (coding-system-property
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 70
diff changeset
82 cs (intern (format "force-g%d-on-output" register)))))
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 70
diff changeset
83 (princ
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 70
diff changeset
84 (format
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 70
diff changeset
85 " G%d: %s%s\n"
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 70
diff changeset
86 register
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 70
diff changeset
87 (cond ((null charset) "never used")
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 70
diff changeset
88 ((eq t charset) "none")
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 70
diff changeset
89 (t (charset-name charset)))
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 70
diff changeset
90 (if force " (explicit designation required)" "")))))
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 70
diff changeset
91
70
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: ")
102
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 70
diff changeset
96 (setq cs (get-coding-system cs))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
97 (with-output-to-temp-buffer "*Help*"
102
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 70
diff changeset
98 (princ (format "Coding-system %s [%s]:\n"
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 70
diff changeset
99 (coding-system-name cs)
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 70
diff changeset
100 (coding-system-mnemonic cs)))
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 70
diff changeset
101 (princ (format " %s\n" (coding-system-doc-string cs)))
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 70
diff changeset
102 (let ((type (coding-system-type cs)))
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 70
diff changeset
103 (princ "Type: ") (princ type) (terpri)
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 70
diff changeset
104 (case type
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 70
diff changeset
105 ('iso2022
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 70
diff changeset
106 (princ "\nInitial designations:\n")
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 70
diff changeset
107 (dolist (register '(0 1 2 3))
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 70
diff changeset
108 (describe-designation cs register))
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 70
diff changeset
109 (princ "\nOther properties: \n")
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 70
diff changeset
110 (dolist (prop '(short no-ascii-eol no-ascii-cntl seven lock-shift no-iso6429))
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 70
diff changeset
111 (princ (format " %s: " (symbol-name prop)))
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 70
diff changeset
112 (princ (coding-system-property cs prop))
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 70
diff changeset
113 (terpri)))
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 70
diff changeset
114 ;;(princ " short: ") (princ (coding-system-short))
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 70
diff changeset
115 ;;(princ (if (aref flags 4) "ShortForm" "LongForm"))
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 70
diff changeset
116 ;;(if (aref flags 5) (princ ", ASCII@EOL"))
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 70
diff changeset
117 ;;(if (aref flags 6) (princ ", ASCII@CNTL"))
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 70
diff changeset
118 ;;(princ (if (coding-system-seven cs) ", 7bit" ", 8bit"))
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 70
diff changeset
119 ;;(if (aref flags 8) (princ ", UseLockingShift"))
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 70
diff changeset
120 ;;(if (aref flags 9) (princ ", UseRoman"))
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 70
diff changeset
121 ;;(if (aref flags 10) (princ ", UseOldJIS"))
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 70
diff changeset
122 ;;(if (aref flags 11) (princ ", No ISO6429"))
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 70
diff changeset
123 ;;(terpri))
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 70
diff changeset
124
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 70
diff changeset
125 ('big5
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 70
diff changeset
126 ;;(princ (if flags "Big-ETen\n" "Big-HKU\n")))
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 70
diff changeset
127 ))
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 70
diff changeset
128 (princ (format "\nEOL-Type: %s\n"
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 70
diff changeset
129 (case (coding-system-eol-type cs)
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 70
diff changeset
130 ('nil "null (= LF)")
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 70
diff changeset
131 ('lf "LF")
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 70
diff changeset
132 ('crlf "CRLF")
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 70
diff changeset
133 ('cr "CR")
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 70
diff changeset
134 (t "invalid"))))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
135 )))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
136
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
137 ;;;###autoload
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
138 (defun list-coding-system-briefly ()
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
139 "Display coding-systems currently used with a brief format in mini-buffer."
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
140 (interactive)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
141 (let ((cs (and (fboundp 'process-coding-system) (process-coding-system)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
142 eol-type)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
143 (message
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
144 "current: [FKDPp=%c%c%c%c%c%c%c%c] default: [FPp=%c%c%c%c%c%c]"
110
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 102
diff changeset
145 (coding-system-mnemonic buffer-file-coding-system)
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 102
diff changeset
146 (coding-system-eol-mnemonic buffer-file-coding-system)
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
147 (coding-system-mnemonic keyboard-coding-system)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
148 (coding-system-mnemonic terminal-coding-system)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
149 (coding-system-mnemonic (car cs))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
150 (coding-system-eol-mnemonic (car cs))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
151 (coding-system-mnemonic (cdr cs))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
152 (coding-system-eol-mnemonic (cdr cs))
110
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 102
diff changeset
153 (coding-system-mnemonic (default-value 'buffer-file-coding-system))
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 102
diff changeset
154 (coding-system-eol-mnemonic (default-value 'buffer-file-coding-system))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
155 (coding-system-mnemonic (car default-process-coding-system))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
156 (coding-system-eol-mnemonic (car default-process-coding-system))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
157 (coding-system-mnemonic (cdr default-process-coding-system))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
158 (coding-system-eol-mnemonic (cdr default-process-coding-system))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
159 )))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
160
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
161 (defun princ-coding-system (code)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
162 (princ ": ")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
163 (princ code)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
164 (princ " [")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
165 (princ (char-to-string (coding-system-mnemonic code)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
166 (princ (char-to-string (coding-system-eol-mnemonic code)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
167 (princ "]\n"))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
168
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
169 (defun todigit (flags idx &optional default-value)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
170 (if (aref flags idx)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
171 (if (numberp (aref flags idx)) (aref flags idx) 1)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
172 (or default-value 0)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
173
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
174 (defun print-coding-system-description (code)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
175 (let ((type (get-code-type code))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
176 (eol (or (get-code-eol code) 1))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
177 (flags (get-code-flags code))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
178 line)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
179 (setq type
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
180 (cond ((null type) 0)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
181 ((eq type t) 2)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
182 ((eq type 0) 1)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
183 ((eq type 1) 3)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
184 ((eq type 2) 4)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
185 ((eq type 3) 5)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
186 ((eq type 4) 6)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
187 (t nil)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
188 (if (or (null type)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
189 (get code 'post-read-conversion)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
190 (get (get-base-code code) 'post-read-conversion)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
191 (get code 'pre-write-conversion)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
192 (get (get-base-code code) 'pre-write-conversion)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
193 (eq code '*noconv*))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
194 nil
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
195 (princ
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
196 (format "%s:%d:%c:"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
197 code type (coding-system-mnemonic code)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
198 (princ (format "%d" (if (numberp eol) eol 0)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
199 (cond ((= type 4)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
200 (princ
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
201 (format
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
202 ":%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
203 (todigit flags 0 -1)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
204 (todigit flags 1 -1)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
205 (todigit flags 2 -1)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
206 (todigit flags 3 -1)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
207 (todigit flags 4)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
208 (todigit flags 5)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
209 (todigit flags 6)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
210 (todigit flags 7)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
211 (todigit flags 8)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
212 (todigit flags 9)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
213 (todigit flags 10)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
214 (todigit flags 11))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
215 ((= type 5)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
216 (princ ":0"))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
217 ((= type 6)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
218 (if (and (vectorp (car flags)) (vectorp (cdr flags)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
219 (let (i len)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
220 (princ ":")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
221 (setq i 0 len (length (car flags)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
222 (while (< i len)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
223 (princ (format " %x" (aref (car flags) i)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
224 (setq i (1+ i)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
225 (princ ",")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
226 (setq i 0 len (length (cdr flags)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
227 (while (< i len)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
228 (princ (format " %x" (aref (cdr flags) i)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
229 (setq i (1+ i))))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
230 (t (princ ":0")))
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 (princ (get-code-document code))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
233 (princ "\n"))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
234 ))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
235
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
236 ;;;###autoload
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
237 (defun list-coding-system (&optional all)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
238 "Describe coding-systems currently used with a detailed format.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
239 If optional arg ALL is non-nil, all coding-systems are listed in
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
240 machine readable simple format."
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
241 (interactive "P")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
242 (with-output-to-temp-buffer "*Help*"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
243 (if (null all)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
244 (let ((cs (and (fboundp 'process-coding-system)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
245 (process-coding-system))))
110
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 102
diff changeset
246 (princ "Current:\n buffer-file-coding-system")
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 102
diff changeset
247 (princ-coding-system buffer-file-coding-system)
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
248 (princ " keyboard-coding-system")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
249 (princ-coding-system keyboard-coding-system)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
250 (princ " terminal-coding-system")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
251 (princ-coding-system terminal-coding-system)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
252 (when cs
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
253 (princ " process-coding-system (input)")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
254 (princ-coding-system (car cs))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
255 (princ " process-coding-system (output)")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
256 (princ-coding-system (cdr cs)))
110
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 102
diff changeset
257 (princ "Default:\n buffer-file-coding-system")
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 102
diff changeset
258 (princ-coding-system (default-value 'buffer-file-coding-system))
70
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 default-process-coding-system))
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 default-process-coding-system))
110
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 102
diff changeset
263 (princ "Others:\n buffer-file-coding-system-for-read")
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 102
diff changeset
264 (princ-coding-system buffer-file-coding-system-for-read)
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
265 (princ "Coding categories by priority:\n")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
266 (princ (coding-priority-list)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
267 (princ "########################\n")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
268 (princ "## LIST OF CODING SYSTEM\n")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
269 (princ "## NAME(str):TYPE(int):MNEMONIC(char):EOL(int):FLAGS:DOC(str)\n")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
270 (princ "## TYPE = 0(no conversion),1(auto conversion),\n")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
271 (princ "## 2(Mule internal),3(SJIS),4(ISO2022),5(BIG5),6(CCL)\n")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
272 (princ "## EOL = 0(AUTO), 1(LF), 2(CRLF), 3(CR)\n")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
273 (princ "## FLAGS =\n")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
274 (princ "## if TYPE = 4 then\n")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
275 (princ "## G0,G1,G2,G3,SHORT,ASCII-EOL,ASCII-CNTL,SEVEN,\n")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
276 (princ "## LOCK-SHIFT,USE-ROMAN,USE-OLDJIS\n")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
277 (princ "## else if TYPE = 6 then\n")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
278 (princ "## CCL_PROGRAM_FOR_READ,CCL_PROGRAM_FOR_WRITE\n")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
279 (princ "## else\n")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
280 (princ "## 0\n")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
281 (princ "##\n")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
282 (let ((codings nil))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
283 (mapatoms
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
284 (function
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
285 (lambda (arg)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
286 (if (eq arg '*noconv*)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
287 nil
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
288 (if (and (or (vectorp (get arg 'coding-system))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
289 (vectorp (get arg 'eol-type)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
290 (null (get arg 'pre-write-conversion))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
291 (null (get arg 'post-read-conversion)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
292 (setq codings (cons arg codings)))))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
293 (while codings
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
294 (print-coding-system-description (car codings))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
295 (setq codings (cdr codings))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
296 (princ "############################\n")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
297 (princ "## LIST OF CODING CATEGORIES (ordered by priority)\n")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
298 (princ "## CATEGORY(str):CODING-SYSTEM(str)\n")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
299 (princ "##\n")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
300 (princ (coding-priority-list))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
301 )))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
302
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
303 ;;; FONT
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
304 (defun describe-font-internal (fontinfo &optional verbose)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
305 (let ((cs (character-set (aref fontinfo 3))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
306 (mule-debug-princ-list (format "Font #%02d for" (aref fontinfo 0))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
307 (nth 6 cs) (nth 7 cs) "--"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
308 (cond ((= (aref fontinfo 4) 0) "NOT YET OPENED")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
309 ((= (aref fontinfo 4) 1) "OPENED")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
310 (t "NOT FOUND")))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
311 (mule-debug-princ-list " request:" (aref fontinfo 1))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
312 (if (= (aref fontinfo 4) 1)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
313 (mule-debug-princ-list " opened:" (aref fontinfo 2)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
314 (if (and verbose (= (aref fontinfo 4) 1))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
315 (progn
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
316 (mule-debug-princ-list " size:" (format "%d" (aref fontinfo 5)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
317 (mule-debug-princ-list " encoding:" (if (= (aref fontinfo 6) 0) "low" "high"))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
318 (mule-debug-princ-list " yoffset:" (format "%d" (aref fontinfo 7)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
319 (mule-debug-princ-list " rel-cmp:" (format "%d" (aref fontinfo 8)))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
320 ))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
321
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
322 ;;;###autoload
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
323 (defun describe-font (fontname)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
324 "Display information about fonts which partially match FONTNAME."
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
325 (interactive "sFontname: ")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
326 (setq fontname (regexp-quote fontname))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
327 (with-output-to-temp-buffer "*Help*"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
328 (let ((fontlist (font-list)) fontinfo)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
329 (while fontlist
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
330 (setq fontinfo (car fontlist))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
331 (if (or (string-match fontname (aref fontinfo 1))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
332 (and (aref fontinfo 2)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
333 (string-match fontname (aref fontinfo 2))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
334 (describe-font-internal fontinfo 'verbose))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
335 (setq fontlist (cdr fontlist))))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
336
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
337 ;;;###autoload
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
338 (defun list-font ()
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
339 "Display a list of fonts."
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
340 (interactive)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
341 (with-output-to-temp-buffer "*Help*"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
342 (let ((fontlist (font-list)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
343 (while fontlist
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
344 (describe-font-internal (car fontlist))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
345 (setq fontlist (cdr fontlist))))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
346
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
347 ;;; FONTSET
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
348 (defun describe-fontset-internal (fontset-info)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
349 (mule-debug-princ-list "### Fontset-name:" (car fontset-info) "###")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
350 (let ((i 0) font)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
351 (while (< i 128)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
352 (if (>= (setq font (aref (cdr fontset-info) i)) 0)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
353 (describe-font-internal (get-font-info font)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
354 (setq i (1+ i)))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
355
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
356 ;;;###autoload
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
357 (defun describe-fontset (fontset)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
358 "Display information about FONTSET."
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
359 (interactive
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
360 (let ((fontset-list (mapcar '(lambda (x) (list x)) (fontset-list))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
361 (list (completing-read "Fontset: " fontset-list nil 'match))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
362 (let ((fontset-info (get-fontset-info fontset)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
363 (if fontset-info
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
364 (with-output-to-temp-buffer "*Help*"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
365 (describe-fontset-internal fontset-info))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
366 (error "No such fontset: %s" fontset))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
367
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
368 ;;;###autoload
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
369 (defun list-fontset ()
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
370 "Display a list of fontsets."
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
371 (interactive)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
372 (with-output-to-temp-buffer "*Help*"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
373 (let ((fontsetlist (fontset-list 'all)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
374 (while fontsetlist
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
375 (describe-fontset-internal (car fontsetlist))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
376 (setq fontsetlist (cdr fontsetlist))))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
377
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
378 ;;; DIAGNOSIS
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
379
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
380 (defun insert-list (args)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
381 (while (cdr args)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
382 (insert (or (car args) "nil") " ")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
383 (setq args (cdr args)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
384 (if args (insert (or (car args) "nil")))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
385 (insert "\n"))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
386
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
387 (defun insert-section (sec title)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
388 (insert "########################################\n"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
389 "# Section " (format "%d" sec) ". " title "\n"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
390 "########################################\n\n"))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
391
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
392 ;;;###autoload
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
393 (defun mule-diag ()
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
394 "Show diagnosis of the current running Mule."
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
395 (interactive)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
396 (let ((buf (get-buffer-create "*Diagnosis*")))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
397 (save-excursion
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
398 (set-buffer buf)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
399 (erase-buffer)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
400 (insert "\t##############################\n"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
401 "\t### DIAGNOSIS OF YOUR MULE ###\n"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
402 "\t##############################\n\n"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
403 "CONTENTS: Section 0. General information\n"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
404 " Section 1. Display\n"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
405 " Section 2. Input methods\n"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
406 " Section 3. Coding-systems\n"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
407 " Section 4. Character sets\n")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
408 (if window-system
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
409 (insert " Section 5. Fontset list\n"))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
410 (insert "\n")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
411
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
412 (insert-section 0 "General information")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
413 (insert "Mule's version: " mule-version " of " mule-version-date "\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 "Window-system: "
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
416 (symbol-name window-system)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
417 (format "%s" window-system-version))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
418 (insert "Terminal: " (getenv "TERM")))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
419 (insert "\n\n")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
420
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
421 (insert-section 1 "Display")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
422 (if (eq window-system 'x)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
423 (let* ((alist (nth 1 (assq (selected-frame)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
424 (current-frame-configuration))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
425 (fontset (cdr (assq 'font alist))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
426 (insert-list (cons "Defined fontsets:" (fontset-list)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
427 (insert "Current frame's fontset: " fontset "\n"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
428 "See Section 5 for more detail.\n\n"))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
429 (insert "Coding system for output to terminal: "
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
430 (symbol-name terminal-coding-system)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
431 "\n\n"))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
432 (insert-section 2 "Input methods")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
433 (if (featurep 'egg)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
434 (let (temp)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
435 (insert "EGG (Version " egg-version ")\n")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
436 (insert " jserver host list: ")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
437 (insert-list (if (boundp 'jserver-list) jserver-list
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
438 (if (setq temp (getenv "JSERVER"))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
439 (list temp))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
440 (insert " cserver host list: ")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
441 (insert-list (if (boundp 'cserver-list) cserver-list
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
442 (if (setq temp (getenv "CSERVER"))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
443 (list temp))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
444 (insert " loaded ITS mode:\n\t")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
445 (insert-list (mapcar 'car its:*mode-alist*))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
446 (insert " current server:" (symbol-name wnn-server-type) "\n"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
447 " current ITS mode:"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
448 (let ((mode its:*mode-alist*))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
449 (while (not (eq (cdr (car mode)) its:*current-map*))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
450 (setq mode (cdr mode)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
451 (car (car mode))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
452 (insert "\n")))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
453 (insert "QUAIL (Version " quail-version ")\n")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
454 (insert " Quail packages: (not-yet-loaded) [current]\n\t")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
455 (let ((l quail-package-alist)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
456 (current (or (car quail-current-package) "")))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
457 (while l
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
458 (cond ((string= current (car (car l)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
459 (insert "[" (car (car l)) "]"))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
460 ((nth 2 (car l))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
461 (insert (car (car l))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
462 (t
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
463 (insert "(" (car (car l)) ")")))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
464 (if (setq l (cdr l)) (insert " ") (insert "\n"))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
465 (if (featurep 'canna)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
466 (insert "CANNA (Version " canna-rcs-version ")\n"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
467 " server:" (or canna-server "Not specified") "\n"))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
468 (if (featurep 'sj3-egg)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
469 (insert "SJ3 (Version" sj3-egg-version ")\n"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
470 " server:" (get-sj3-host-name) "\n"))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
471 (insert "\n")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
472
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
473 (insert-section 3 "Coding systems")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
474 (save-excursion (list-coding-systems))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
475 (insert-buffer "*Help*")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
476 (goto-char (point-max))
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 4 "Character sets")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
480 (save-excursion (list-charsets))
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 (if window-system
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
486 (progn
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
487 (insert-section 5 "Fontset list")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
488 (save-excursion (list-fontset))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
489 (insert-buffer "*Help*")))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
490
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
491 (set-buffer-modified-p nil)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
492 )
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
493 (let ((win (display-buffer buf)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
494 (set-window-point win 1)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
495 (set-window-start win 1))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
496 ))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
497
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
498 ;;; DUMP DATA FILE
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
499
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
500 ;;;###autoload
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
501 (defun dump-charsets ()
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
502 (list-charsets)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
503 (set-buffer (get-buffer "*Help*"))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
504 (let (make-backup-files)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
505 (write-region (point-min) (point-max) "charsets.lst"))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
506 (kill-emacs))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
507
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
508 ;;;###autoload
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
509 (defun dump-coding-systems ()
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
510 (list-coding-systems 'all)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
511 (set-buffer (get-buffer "*Help*"))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
512 (let (make-backup-files)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
513 (write-region (point-min) (point-max) "coding-systems.lst"))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
514 (kill-emacs))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
515