annotate lisp/international/mule-diag.el @ 19942:b960ef5a1ecc

(viper-mouse-search-key): Fix custom type. (viper-mouse-insert-key): Likewise.
author Richard M. Stallman <rms@gnu.org>
date Mon, 15 Sep 1997 23:21:03 +0000
parents d3df40315378
children 2b49d1c59b83
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
17315
a3ca5e15c82a Fix the format of the first line.
Kenichi Handa <handa@m17n.org>
parents: 17071
diff changeset
1 ;;; mule-diag.el --- Show diagnosis of multilingual environment (MULE)
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
3 ;; Copyright (C) 1995 Electrotechnical Laboratory, JAPAN.
18377
8b4a66c66dd6 Change copyright notice.
Richard M. Stallman <rms@gnu.org>
parents: 18300
diff changeset
4 ;; Licensed to the Free Software Foundation.
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6 ;; Keywords: multilingual, charset, coding system, fontset, diagnosis
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
7
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
8 ;; This file is part of GNU Emacs.
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
9
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
10 ;; GNU Emacs is free software; you can redistribute it and/or modify
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
11 ;; it under the terms of the GNU General Public License as published by
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
12 ;; the Free Software Foundation; either version 2, or (at your option)
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
13 ;; any later version.
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
14
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
15 ;; GNU Emacs is distributed in the hope that it will be useful,
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
16 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
18 ;; GNU General Public License for more details.
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
19
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
20 ;; You should have received a copy of the GNU General Public License
17071
70194012fb3a Fix FSF address in comment.
Karl Heuer <kwzh@gnu.org>
parents: 17052
diff changeset
21 ;; along with GNU Emacs; see the file COPYING. If not, write to the
70194012fb3a Fix FSF address in comment.
Karl Heuer <kwzh@gnu.org>
parents: 17052
diff changeset
22 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
70194012fb3a Fix FSF address in comment.
Karl Heuer <kwzh@gnu.org>
parents: 17052
diff changeset
23 ;; Boston, MA 02111-1307, USA.
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
24
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
25 ;;; General utility function
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
26
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
27 ;; Print all arguments with single space separator in one line.
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
28 (defun print-list (&rest args)
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
29 (while (cdr args)
18559
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
30 (when (car args)
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
31 (princ (car args))
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
32 (princ " "))
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
33 (setq args (cdr args)))
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
34 (princ (car args))
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
35 (princ "\n"))
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
36
18559
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
37 ;; Re-order the elements of charset-list.
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
38 (defun sort-charset-list ()
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
39 (setq charset-list
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
40 (sort charset-list
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
41 (function (lambda (x y) (< (charset-id x) (charset-id y)))))))
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
42
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
43 ;;; CHARSET
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
44
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
45 ;;;###autoload
18559
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
46 (defun list-character-sets (&optional arg)
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
47 "Display a list of all character sets.
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
48
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
49 The ID column contains a charset identification number for internal use.
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
50 The B column contains a number of bytes occupied in a buffer.
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
51 The W column contains a number of columns occupied in a screen.
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
52
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
53 With prefix arg, the output format gets more cryptic
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
54 but contains full information about each character sets."
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
55 (interactive "P")
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
56 (sort-charset-list)
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
57 (with-output-to-temp-buffer "*Help*"
18300
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
58 (save-excursion
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
59 (set-buffer standard-output)
18559
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
60 (let ((l charset-list)
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
61 charset)
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
62 (if (null arg)
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
63 (progn
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
64 (insert "ID Name B W Description\n")
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
65 (insert "-- ---- - - -----------\n")
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
66 (while l
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
67 (setq charset (car l) l (cdr l))
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
68 (insert (format "%03d %s" (charset-id charset) charset))
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
69 (indent-to 28)
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
70 (insert (format "%d %d %s\n"
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
71 (charset-bytes charset)
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
72 (charset-width charset)
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
73 (charset-description charset)))))
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
74 (insert "\
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
75 #########################
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
76 ## LIST OF CHARSETS
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
77 ## Each line corresponds to one charset.
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
78 ## The following attributes are listed in this order
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
79 ## separated by a colon `:' in one line.
18559
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
80 ## CHARSET-ID,
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
81 ## CHARSET-SYMBOL-NAME,
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
82 ## DIMENSION (1 or 2)
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
83 ## CHARS (94 or 96)
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
84 ## BYTES (of multibyte form: 1, 2, 3, or 4),
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
85 ## WIDTH (occupied column numbers: 1 or 2),
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
86 ## DIRECTION (0:left-to-right, 1:right-to-left),
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
87 ## ISO-FINAL-CHAR (character code of ISO-2022's final character)
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
88 ## ISO-GRAPHIC-PLANE (ISO-2022's graphic plane, 0:GL, 1:GR)
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
89 ## DESCRIPTION (describing string of the charset)
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
90 ")
18559
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
91 (while l
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
92 (setq charset (car l) l (cdr l))
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
93 (princ (format "%03d:%s:%d:%d:%d:%d:%d:%d:%d:%s\n"
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
94 (charset-id charset)
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
95 charset
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
96 (charset-dimension charset)
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
97 (charset-chars charset)
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
98 (charset-bytes charset)
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
99 (charset-width charset)
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
100 (charset-direction charset)
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
101 (charset-iso-final-char charset)
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
102 (charset-iso-graphic-plane charset)
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
103 (charset-description charset))))))
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
104 (help-mode)
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
105 (setq truncate-lines t))))
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
106
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
107 ;;; CODING-SYSTEM
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
108
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
109 ;; Print information of designation of each graphic register in FLAGS
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
110 ;; in human readable format. See the documentation of
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
111 ;; `make-coding-system' for the meaning of FLAGS.
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
112 (defun print-designation (flags)
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
113 (let ((graphic-register 0)
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
114 charset)
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
115 (while (< graphic-register 4)
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
116 (setq charset (aref flags graphic-register))
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
117 (princ (format
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
118 " G%d -- %s\n"
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
119 graphic-register
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
120 (cond ((null charset)
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
121 "never used")
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
122 ((eq charset t)
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
123 "no initial designation, and used by any charsets")
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
124 ((symbolp charset)
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
125 (format "%s:%s"
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
126 charset (charset-description charset)))
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
127 ((listp charset)
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
128 (if (charsetp (car charset))
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
129 (format "%s:%s, and also used by the followings:"
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
130 (car charset)
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
131 (charset-description (car charset)))
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
132 "no initial designation, and used by the followings:"))
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
133 (t
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
134 "invalid designation information"))))
18559
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
135 (when (listp charset)
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
136 (setq charset (cdr charset))
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
137 (while charset
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
138 (cond ((eq (car charset) t)
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
139 (princ "\tany other charsets\n"))
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
140 ((charsetp (car charset))
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
141 (princ (format "\t%s:%s\n"
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
142 (car charset)
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
143 (charset-description (car charset)))))
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
144 (t
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
145 "invalid designation information"))
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
146 (setq charset (cdr charset))))
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
147 (setq graphic-register (1+ graphic-register)))))
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
148
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
149 ;;;###autoload
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
150 (defun describe-coding-system (coding-system)
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
151 "Display information of CODING-SYSTEM."
18300
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
152 (interactive "zDescribe coding system (default, current choices): ")
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
153 (if (null coding-system)
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
154 (describe-current-coding-system)
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
155 (with-output-to-temp-buffer "*Help*"
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
156 (print-coding-system-briefly coding-system 'doc-string)
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
157 (let ((coding-spec (coding-system-spec coding-system)))
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
158 (princ "Type: ")
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
159 (let ((type (coding-system-type coding-system))
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
160 (flags (coding-system-flags coding-system)))
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
161 (princ type)
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
162 (cond ((eq type nil)
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
163 (princ " (do no conversion)"))
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
164 ((eq type t)
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
165 (princ " (do automatic conversion)"))
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
166 ((eq type 0)
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
167 (princ " (Emacs internal multibyte form)"))
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
168 ((eq type 1)
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
169 (princ " (Shift-JIS, MS-KANJI)"))
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
170 ((eq type 2)
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
171 (princ " (variant of ISO-2022)\n")
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
172 (princ "Initial designations:\n")
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
173 (print-designation flags)
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
174 (princ "Other Form: \n ")
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
175 (princ (if (aref flags 4) "short-form" "long-form"))
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
176 (if (aref flags 5) (princ ", ASCII@EOL"))
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
177 (if (aref flags 6) (princ ", ASCII@CNTL"))
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
178 (princ (if (aref flags 7) ", 7-bit" ", 8-bit"))
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
179 (if (aref flags 8) (princ ", use-locking-shift"))
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
180 (if (aref flags 9) (princ ", use-single-shift"))
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
181 (if (aref flags 10) (princ ", use-roman"))
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
182 (if (aref flags 10) (princ ", use-old-jis"))
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
183 (if (aref flags 11) (princ ", no-ISO6429"))
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
184 (princ "."))
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
185 ((eq type 3)
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
186 (princ " (Big5)"))
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
187 ((eq type 4)
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
188 (princ " (do conversion by CCL program)"))
19876
d3df40315378 (describe-coding-system): Describe coding systems of type 5, raw-text.
Richard M. Stallman <rms@gnu.org>
parents: 19657
diff changeset
189 ((eq type 5)
d3df40315378 (describe-coding-system): Describe coding systems of type 5, raw-text.
Richard M. Stallman <rms@gnu.org>
parents: 19657
diff changeset
190 (princ " (text with random binary characters)"))
d3df40315378 (describe-coding-system): Describe coding systems of type 5, raw-text.
Richard M. Stallman <rms@gnu.org>
parents: 19657
diff changeset
191 (t (princ ": invalid coding-system."))))
18300
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
192 (princ "\nEOL type:\n ")
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
193 (let ((eol-type (coding-system-eol-type coding-system)))
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
194 (cond ((vectorp eol-type)
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
195 (princ "Automatic selection from:\n\t")
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
196 (princ eol-type)
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
197 (princ "\n"))
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
198 ((or (null eol-type) (eq eol-type 0)) (princ "LF\n"))
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
199 ((eq eol-type 1) (princ "CRLF\n"))
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
200 ((eq eol-type 2) (princ "CR\n"))
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
201 (t (princ "invalid\n")))))
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
202 (save-excursion
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
203 (set-buffer standard-output)
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
204 (help-mode)))))
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
205
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
206 ;;;###autoload
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
207 (defun describe-current-coding-system-briefly ()
18199
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
208 "Display coding systems currently used in a brief format in echo area.
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
209
18199
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
210 The format is \"F[..],K[..],T[..],P>[..],P<[..], default F[..],P<[..],P<[..]\",
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
211 where mnemonics of the following coding systems come in this order
18199
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
212 at the place of `..':
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
213 buffer-file-coding-system (of the current buffer)
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
214 eol-type of buffer-file-coding-system (of the current buffer)
18199
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
215 (keyboard-coding-system)
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
216 eol-type of (keyboard-coding-system)
18300
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
217 (terminal-coding-system)
18199
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
218 eol-type of (terminal-coding-system)
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
219 process-coding-system for read (of the current buffer, if any)
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
220 eol-type of process-coding-system for read (of the current buffer, if any)
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
221 process-coding-system for write (of the current buffer, if any)
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
222 eol-type of process-coding-system for write (of the current buffer, if any)
18199
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
223 default-buffer-file-coding-system
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
224 eol-type of default-buffer-file-coding-system
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
225 default-process-coding-system for read
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
226 eol-type of default-process-coding-system for read
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
227 default-process-coding-system for write
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
228 eol-type of default-process-coding-system"
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
229 (interactive)
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
230 (let* ((proc (get-buffer-process (current-buffer)))
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
231 (process-coding-systems (if proc (process-coding-system proc))))
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
232 (message
18199
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
233 "F[%c%c],K[%c%c],T[%c%c],P>[%c%c],P<[%c%c], default F[%c%c],P>[%c%c],P<[%c%c]"
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
234 (coding-system-mnemonic buffer-file-coding-system)
18199
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
235 (coding-system-eol-type-mnemonic buffer-file-coding-system)
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
236 (coding-system-mnemonic (keyboard-coding-system))
18199
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
237 (coding-system-eol-type-mnemonic (keyboard-coding-system))
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
238 (coding-system-mnemonic (terminal-coding-system))
18199
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
239 (coding-system-eol-type-mnemonic (terminal-coding-system))
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
240 (coding-system-mnemonic (car process-coding-systems))
18199
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
241 (coding-system-eol-type-mnemonic (car process-coding-systems))
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
242 (coding-system-mnemonic (cdr process-coding-systems))
18199
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
243 (coding-system-eol-type-mnemonic (cdr process-coding-systems))
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
244 (coding-system-mnemonic default-buffer-file-coding-system)
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
245 (coding-system-eol-type-mnemonic default-buffer-file-coding-system)
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
246 (coding-system-mnemonic (car default-process-coding-system))
18199
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
247 (coding-system-eol-type-mnemonic (car default-process-coding-system))
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
248 (coding-system-mnemonic (cdr default-process-coding-system))
18199
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
249 (coding-system-eol-type-mnemonic (cdr default-process-coding-system))
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
250 )))
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
251
18199
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
252 ;; Print symbol name and mnemonic letter of CODING-SYSTEM by `princ'.
18300
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
253 (defun print-coding-system-briefly (coding-system &optional doc-string)
18199
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
254 (if (not coding-system)
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
255 (princ "nil\n")
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
256 (princ (format "%c -- %s"
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
257 (coding-system-mnemonic coding-system)
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
258 coding-system))
18300
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
259 (let ((parent (coding-system-parent coding-system)))
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
260 (if parent
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
261 (princ (format " (alias of %s)" parent))))
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
262 (let ((aliases (get coding-system 'alias-coding-systems)))
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
263 (if aliases
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
264 (princ (format " %S" (cons 'alias: aliases)))))
18199
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
265 (princ "\n")
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
266 (if (and doc-string
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
267 (setq doc-string (coding-system-doc-string coding-system)))
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
268 (princ (format " %s\n" doc-string)))))
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
269
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
270 ;;;###autoload
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
271 (defun describe-current-coding-system ()
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
272 "Display coding systems currently used in a detailed format."
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
273 (interactive)
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
274 (with-output-to-temp-buffer "*Help*"
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
275 (let* ((proc (get-buffer-process (current-buffer)))
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
276 (process-coding-systems (if proc (process-coding-system proc))))
19081
f33df9d64fe8 (describe-current-coding-system): Clean up output format.
Richard M. Stallman <rms@gnu.org>
parents: 18799
diff changeset
277 (princ "Coding system for saving this buffer:\n ")
18199
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
278 (if (local-variable-p 'buffer-file-coding-system)
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
279 (print-coding-system-briefly buffer-file-coding-system)
19081
f33df9d64fe8 (describe-current-coding-system): Clean up output format.
Richard M. Stallman <rms@gnu.org>
parents: 18799
diff changeset
280 (princ "Not set locally, use the default.\n"))
f33df9d64fe8 (describe-current-coding-system): Clean up output format.
Richard M. Stallman <rms@gnu.org>
parents: 18799
diff changeset
281 (princ "Default coding system (for new files):\n ")
18199
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
282 (print-coding-system-briefly default-buffer-file-coding-system)
19081
f33df9d64fe8 (describe-current-coding-system): Clean up output format.
Richard M. Stallman <rms@gnu.org>
parents: 18799
diff changeset
283 (princ "Coding system for keyboard input:\n ")
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
284 (print-coding-system-briefly (keyboard-coding-system))
19081
f33df9d64fe8 (describe-current-coding-system): Clean up output format.
Richard M. Stallman <rms@gnu.org>
parents: 18799
diff changeset
285 (princ "Coding system for terminal output:\n ")
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
286 (print-coding-system-briefly (terminal-coding-system))
19081
f33df9d64fe8 (describe-current-coding-system): Clean up output format.
Richard M. Stallman <rms@gnu.org>
parents: 18799
diff changeset
287 (when (get-buffer-process (current-buffer))
f33df9d64fe8 (describe-current-coding-system): Clean up output format.
Richard M. Stallman <rms@gnu.org>
parents: 18799
diff changeset
288 (princ "Coding systems for process I/O:\n")
f33df9d64fe8 (describe-current-coding-system): Clean up output format.
Richard M. Stallman <rms@gnu.org>
parents: 18799
diff changeset
289 (princ " encoding input to the process: ")
f33df9d64fe8 (describe-current-coding-system): Clean up output format.
Richard M. Stallman <rms@gnu.org>
parents: 18799
diff changeset
290 (print-coding-system-briefly (cdr process-coding-systems))
f33df9d64fe8 (describe-current-coding-system): Clean up output format.
Richard M. Stallman <rms@gnu.org>
parents: 18799
diff changeset
291 (princ " decoding output from the process: ")
f33df9d64fe8 (describe-current-coding-system): Clean up output format.
Richard M. Stallman <rms@gnu.org>
parents: 18799
diff changeset
292 (print-coding-system-briefly (car process-coding-systems)))
19657
940d50684d68 (describe-current-coding-system): Add missing newline in output.
Richard M. Stallman <rms@gnu.org>
parents: 19557
diff changeset
293 (princ "Defaults for subprocess I/O:\n")
18199
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
294 (princ " decoding: ")
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
295 (print-coding-system-briefly (car default-process-coding-system))
18199
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
296 (princ " encoding: ")
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
297 (print-coding-system-briefly (cdr default-process-coding-system)))
18300
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
298
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
299 (save-excursion
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
300 (set-buffer standard-output)
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
301
19081
f33df9d64fe8 (describe-current-coding-system): Clean up output format.
Richard M. Stallman <rms@gnu.org>
parents: 18799
diff changeset
302 (princ "\nPriority order for recognizing coding systems when reading files:\n")
18300
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
303 (let ((l coding-category-list)
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
304 (i 1)
19265
6b31dac7f72b (print-fontset): Don't hang even if a
Kenichi Handa <handa@m17n.org>
parents: 19081
diff changeset
305 (coding-list nil)
18300
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
306 coding aliases)
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
307 (while l
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
308 (setq coding (symbol-value (car l)))
19265
6b31dac7f72b (print-fontset): Don't hang even if a
Kenichi Handa <handa@m17n.org>
parents: 19081
diff changeset
309 (when (not (memq coding coding-list))
6b31dac7f72b (print-fontset): Don't hang even if a
Kenichi Handa <handa@m17n.org>
parents: 19081
diff changeset
310 (setq coding-list (cons coding coding-list))
6b31dac7f72b (print-fontset): Don't hang even if a
Kenichi Handa <handa@m17n.org>
parents: 19081
diff changeset
311 (princ (format " %d. %s" i coding))
6b31dac7f72b (print-fontset): Don't hang even if a
Kenichi Handa <handa@m17n.org>
parents: 19081
diff changeset
312 (when (setq aliases (get coding 'alias-coding-systems))
6b31dac7f72b (print-fontset): Don't hang even if a
Kenichi Handa <handa@m17n.org>
parents: 19081
diff changeset
313 (princ " ")
6b31dac7f72b (print-fontset): Don't hang even if a
Kenichi Handa <handa@m17n.org>
parents: 19081
diff changeset
314 (princ (cons 'alias: aliases)))
6b31dac7f72b (print-fontset): Don't hang even if a
Kenichi Handa <handa@m17n.org>
parents: 19081
diff changeset
315 (terpri)
6b31dac7f72b (print-fontset): Don't hang even if a
Kenichi Handa <handa@m17n.org>
parents: 19081
diff changeset
316 (setq i (1+ i)))
6b31dac7f72b (print-fontset): Don't hang even if a
Kenichi Handa <handa@m17n.org>
parents: 19081
diff changeset
317 (setq l (cdr l))))
18300
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
318 (princ "\n Other coding systems cannot be distinguished automatically
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
319 from these, and therefore cannot be recognized automatically
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
320 with the present coding system priorities.\n\n")
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
321
18799
6c0d648d2cf8 (describe-current-coding-system): Use coding-category-iso-7-else
Kenichi Handa <handa@m17n.org>
parents: 18696
diff changeset
322 (let ((categories '(coding-category-iso-7 coding-category-iso-7-else))
18300
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
323 coding-system codings)
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
324 (while categories
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
325 (setq coding-system (symbol-value (car categories)))
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
326 (mapcar
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
327 (function
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
328 (lambda (x)
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
329 (if (and (not (eq x coding-system))
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
330 (get x 'no-initial-designation)
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
331 (let ((flags (coding-system-flags x)))
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
332 (not (or (aref flags 10) (aref flags 11)))))
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
333 (setq codings (cons x codings)))))
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
334 (get (car categories) 'coding-systems))
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
335 (if codings
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
336 (let ((max-col (frame-width))
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
337 pos)
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
338 (princ (format " The followings are decoded correctly but recognized as %s:\n " coding-system))
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
339 (while codings
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
340 (setq pos (point))
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
341 (insert (format " %s" (car codings)))
18559
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
342 (when (> (current-column) max-col)
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
343 (goto-char pos)
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
344 (insert "\n ")
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
345 (goto-char (point-max)))
18300
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
346 (setq codings (cdr codings)))
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
347 (insert "\n\n")))
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
348 (setq categories (cdr categories))))
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
349
19081
f33df9d64fe8 (describe-current-coding-system): Clean up output format.
Richard M. Stallman <rms@gnu.org>
parents: 18799
diff changeset
350 (princ "Particular coding systems specified for certain file names:\n")
18300
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
351 (terpri)
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
352 (princ " OPERATION\tTARGET PATTERN\t\tCODING SYSTEM(s)\n")
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
353 (princ " ---------\t--------------\t\t----------------\n")
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
354 (let ((func (lambda (operation alist)
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
355 (princ " ")
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
356 (princ operation)
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
357 (if (not alist)
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
358 (princ "\tnothing specified\n")
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
359 (while alist
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
360 (indent-to 16)
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
361 (prin1 (car (car alist)))
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
362 (indent-to 40)
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
363 (princ (cdr (car alist)))
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
364 (princ "\n")
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
365 (setq alist (cdr alist)))))))
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
366 (funcall func "File I/O" file-coding-system-alist)
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
367 (funcall func "Process I/O" process-coding-system-alist)
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
368 (funcall func "Network I/O" network-coding-system-alist))
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
369 (help-mode))))
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
370
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
371 ;; Print detailed information on CODING-SYSTEM.
18199
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
372 (defun print-coding-system (coding-system &optional aliases)
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
373 (let ((type (coding-system-type coding-system))
18199
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
374 (eol-type (coding-system-eol-type coding-system))
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
375 (flags (coding-system-flags coding-system))
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
376 (base (coding-system-base coding-system)))
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
377 (if (not (eq base coding-system))
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
378 (princ (format "%s (alias of %s)\n" coding-system base))
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
379 (princ coding-system)
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
380 (while aliases
18559
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
381 (princ ",")
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
382 (princ (car aliases))
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
383 (setq aliases (cdr aliases)))
18199
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
384 (princ (format ":%s:%c:%d:"
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
385 type
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
386 (coding-system-mnemonic coding-system)
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
387 (if (integerp eol-type) eol-type 3)))
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
388 (cond ((eq type 2) ; ISO-2022
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
389 (let ((idx 0)
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
390 charset)
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
391 (while (< idx 4)
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
392 (setq charset (aref flags idx))
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
393 (cond ((null charset)
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
394 (princ -1))
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
395 ((eq charset t)
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
396 (princ -2))
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
397 ((charsetp charset)
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
398 (princ charset))
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
399 ((listp charset)
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
400 (princ "(")
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
401 (princ (car charset))
18199
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
402 (setq charset (cdr charset))
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
403 (while charset
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
404 (princ ",")
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
405 (princ (car charset))
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
406 (setq charset (cdr charset)))
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
407 (princ ")")))
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
408 (princ ",")
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
409 (setq idx (1+ idx)))
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
410 (while (< idx 12)
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
411 (princ (if (aref flags idx) 1 0))
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
412 (princ ",")
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
413 (setq idx (1+ idx)))
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
414 (princ (if (aref flags idx) 1 0))))
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
415 ((eq type 4) ; CCL
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
416 (let (i len)
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
417 (setq i 0 len (length (car flags)))
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
418 (while (< i len)
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
419 (princ (format " %x" (aref (car flags) i)))
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
420 (setq i (1+ i)))
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
421 (princ ",")
18199
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
422 (setq i 0 len (length (cdr flags)))
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
423 (while (< i len)
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
424 (princ (format " %x" (aref (cdr flags) i)))
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
425 (setq i (1+ i)))))
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
426 (t (princ 0)))
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
427 (princ ":")
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
428 (princ (coding-system-doc-string coding-system))
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
429 (princ "\n"))))
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
430
18199
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
431 ;;;###autoload
18559
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
432 (defun list-coding-systems (&optional arg)
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
433 "Display a list of all coding systems.
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
434 It prints mnemonic letter, name, and description of each coding systems.
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
435
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
436 With prefix arg, the output format gets more cryptic,
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
437 but contains full information about each coding systems."
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
438 (interactive "P")
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
439 (with-output-to-temp-buffer "*Help*"
18559
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
440 (if (null arg)
18199
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
441 (princ "\
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
442 ###############################################
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
443 # List of coding systems in the following format:
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
444 # MNEMONIC-LETTER -- CODING-SYSTEM-NAME
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
445 # DOC-STRING
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
446 ")
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
447 (princ "\
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
448 #########################
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
449 ## LIST OF CODING SYSTEMS
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
450 ## Each line corresponds to one coding system
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
451 ## Format of a line is:
18199
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
452 ## NAME[,ALIAS...]:TYPE:MNEMONIC:EOL:FLAGS:POST-READ-CONVERSION
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
453 ## :PRE-WRITE-CONVERSION:DOC-STRING,
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
454 ## where
18199
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
455 ## NAME = coding system name
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
456 ## ALIAS = alias of the coding system
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
457 ## TYPE = nil (no conversion), t (undecided or automatic detection),
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
458 ## 0 (EMACS-MULE), 1 (SJIS), 2 (ISO2022), 3 (BIG5), or 4 (CCL)
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
459 ## EOL = 0 (LF), 1 (CRLF), 2 (CR), or 3 (Automatic detection)
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
460 ## FLAGS =
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
461 ## if TYPE = 2 then
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
462 ## comma (`,') separated data of the followings:
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
463 ## G0, G1, G2, G3, SHORT-FORM, ASCII-EOL, ASCII-CNTL, SEVEN,
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
464 ## LOCKING-SHIFT, SINGLE-SHIFT, USE-ROMAN, USE-OLDJIS, NO-ISO6429
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
465 ## else if TYPE = 4 then
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
466 ## comma (`,') separated CCL programs for read and write
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
467 ## else
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
468 ## 0
18199
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
469 ## POST-READ-CONVERSION, PRE-WRITE-CONVERSION = function name to be called
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
470 ##
18199
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
471 "))
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
472 (let ((bases (coding-system-list 'base-only))
18300
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
473 coding-system)
18199
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
474 (while bases
18300
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
475 (setq coding-system (car bases))
18799
6c0d648d2cf8 (describe-current-coding-system): Use coding-category-iso-7-else
Kenichi Handa <handa@m17n.org>
parents: 18696
diff changeset
476 (if (null arg)
18300
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
477 (print-coding-system-briefly coding-system 'doc-string)
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
478 (print-coding-system coding-system))
18559
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
479 (setq bases (cdr bases))))))
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
480
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
481 ;;;###automatic
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
482 (defun list-coding-categories ()
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
483 "Display a list of all coding categories."
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
484 (with-output-to-temp-buffer "*Help*"
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
485 (princ "\
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
486 ############################
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
487 ## LIST OF CODING CATEGORIES (ordered by priority)
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
488 ## CATEGORY:CODING-SYSTEM
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
489 ##
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
490 ")
18559
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
491 (let ((l coding-category-list))
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
492 (while l
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
493 (princ (format "%s:%s\n" (car l) (symbol-value (car l))))
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
494 (setq l (cdr l))))))
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
495
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
496 ;;; FONT
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
497
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
498 ;; Print information of a font in FONTINFO.
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
499 (defun describe-font-internal (font-info &optional verbose)
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
500 (print-list "name (opened by):" (aref font-info 0))
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
501 (print-list " full name:" (aref font-info 1))
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
502 (let ((charset (aref font-info 2)))
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
503 (print-list " charset:"
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
504 (format "%s (%s)" charset (charset-description charset))))
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
505 (print-list " size:" (format "%d" (aref font-info 3)))
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
506 (print-list " height:" (format "%d" (aref font-info 4)))
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
507 (print-list " baseline-offset:" (format "%d" (aref font-info 5)))
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
508 (print-list "relative-compose:" (format "%d" (aref font-info 6))))
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
509
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
510 ;;;###autoload
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
511 (defun describe-font (fontname)
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
512 "Display information about fonts which partially match FONTNAME."
18696
1caf720e4f55 (print-fontset): Output format improved.
Kenichi Handa <handa@m17n.org>
parents: 18643
diff changeset
513 (interactive "sFontname (default, current choise for ASCII chars): ")
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
514 (or window-system
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
515 (error "No window system being used"))
18696
1caf720e4f55 (print-fontset): Output format improved.
Kenichi Handa <handa@m17n.org>
parents: 18643
diff changeset
516 (when (or (not fontname) (= (length fontname) 0))
1caf720e4f55 (print-fontset): Output format improved.
Kenichi Handa <handa@m17n.org>
parents: 18643
diff changeset
517 (setq fontname (cdr (assq 'font (frame-parameters))))
1caf720e4f55 (print-fontset): Output format improved.
Kenichi Handa <handa@m17n.org>
parents: 18643
diff changeset
518 (if (query-fontset fontname)
1caf720e4f55 (print-fontset): Output format improved.
Kenichi Handa <handa@m17n.org>
parents: 18643
diff changeset
519 (setq fontname
1caf720e4f55 (print-fontset): Output format improved.
Kenichi Handa <handa@m17n.org>
parents: 18643
diff changeset
520 (nth 2 (assq 'ascii (aref (fontset-info fontname) 2))))))
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
521 (let ((font-info (font-info fontname)))
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
522 (if (null font-info)
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
523 (message "No matching font")
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
524 (with-output-to-temp-buffer "*Help*"
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
525 (describe-font-internal font-info 'verbose)))))
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
526
18559
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
527 ;; Print information of FONTSET. If optional arg PRINT-FONTS is
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
528 ;; non-nil, print also names of all fonts in FONTSET. This function
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
529 ;; actually INSERT such information in the current buffer.
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
530 (defun print-fontset (fontset &optional print-fonts)
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
531 (let* ((fontset-info (fontset-info fontset))
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
532 (size (aref fontset-info 0))
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
533 (height (aref fontset-info 1))
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
534 (fonts (and print-fonts (aref fontset-info 2)))
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
535 (xlfd-fields (x-decompose-font-name fontset))
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
536 style)
19265
6b31dac7f72b (print-fontset): Don't hang even if a
Kenichi Handa <handa@m17n.org>
parents: 19081
diff changeset
537 (if xlfd-fields
6b31dac7f72b (print-fontset): Don't hang even if a
Kenichi Handa <handa@m17n.org>
parents: 19081
diff changeset
538 (let ((weight (aref xlfd-fields xlfd-regexp-weight-subnum))
6b31dac7f72b (print-fontset): Don't hang even if a
Kenichi Handa <handa@m17n.org>
parents: 19081
diff changeset
539 (slant (aref xlfd-fields xlfd-regexp-slant-subnum)))
6b31dac7f72b (print-fontset): Don't hang even if a
Kenichi Handa <handa@m17n.org>
parents: 19081
diff changeset
540 (if (string-match "^bold$\\|^demibold$" weight)
6b31dac7f72b (print-fontset): Don't hang even if a
Kenichi Handa <handa@m17n.org>
parents: 19081
diff changeset
541 (setq style (concat weight " "))
6b31dac7f72b (print-fontset): Don't hang even if a
Kenichi Handa <handa@m17n.org>
parents: 19081
diff changeset
542 (setq style "medium "))
6b31dac7f72b (print-fontset): Don't hang even if a
Kenichi Handa <handa@m17n.org>
parents: 19081
diff changeset
543 (cond ((string-match "^i$" slant)
6b31dac7f72b (print-fontset): Don't hang even if a
Kenichi Handa <handa@m17n.org>
parents: 19081
diff changeset
544 (setq style (concat style "italic")))
6b31dac7f72b (print-fontset): Don't hang even if a
Kenichi Handa <handa@m17n.org>
parents: 19081
diff changeset
545 ((string-match "^o$" slant)
6b31dac7f72b (print-fontset): Don't hang even if a
Kenichi Handa <handa@m17n.org>
parents: 19081
diff changeset
546 (setq style (concat style "slant")))
6b31dac7f72b (print-fontset): Don't hang even if a
Kenichi Handa <handa@m17n.org>
parents: 19081
diff changeset
547 ((string-match "^ri$" slant)
6b31dac7f72b (print-fontset): Don't hang even if a
Kenichi Handa <handa@m17n.org>
parents: 19081
diff changeset
548 (setq style (concat style "reverse italic")))
6b31dac7f72b (print-fontset): Don't hang even if a
Kenichi Handa <handa@m17n.org>
parents: 19081
diff changeset
549 ((string-match "^ro$" slant)
6b31dac7f72b (print-fontset): Don't hang even if a
Kenichi Handa <handa@m17n.org>
parents: 19081
diff changeset
550 (setq style (concat style "reverse slant")))))
6b31dac7f72b (print-fontset): Don't hang even if a
Kenichi Handa <handa@m17n.org>
parents: 19081
diff changeset
551 (setq style " ? "))
18559
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
552 (beginning-of-line)
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
553 (insert fontset)
18643
c9b94c6ab8f1 (print-fontset): Output format tuned.
Kenichi Handa <handa@m17n.org>
parents: 18559
diff changeset
554 (indent-to 58)
18696
1caf720e4f55 (print-fontset): Output format improved.
Kenichi Handa <handa@m17n.org>
parents: 18643
diff changeset
555 (insert (if (> size 0) (format "%2dx%d" size height) " -"))
18643
c9b94c6ab8f1 (print-fontset): Output format tuned.
Kenichi Handa <handa@m17n.org>
parents: 18559
diff changeset
556 (indent-to 64)
18559
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
557 (insert style "\n")
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
558 (when print-fonts
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
559 (insert " O Charset / Fontname\n"
18696
1caf720e4f55 (print-fontset): Output format improved.
Kenichi Handa <handa@m17n.org>
parents: 18643
diff changeset
560 " - ------------------\n")
18559
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
561 (sort-charset-list)
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
562 (let ((l charset-list)
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
563 charset font-info opened fontname)
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
564 (while l
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
565 (setq charset (car l) l (cdr l))
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
566 (setq font-info (assq charset fonts))
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
567 (if (null font-info)
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
568 (setq opened ?? fontname "not specified")
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
569 (if (nth 2 font-info)
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
570 (if (stringp (nth 2 font-info))
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
571 (setq opened ?o fontname (nth 2 font-info))
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
572 (setq opened ?- fontname (nth 1 font-info)))
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
573 (setq opened ?x fontname (nth 1 font-info))))
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
574 (insert (format " %c %s\n %s\n"
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
575 opened charset fontname)))))))
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
576
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
577 ;;;###autoload
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
578 (defun describe-fontset (fontset)
18559
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
579 "Display information of FONTSET.
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
580
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
581 It prints name, size, and style of FONTSET, and lists up fonts
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
582 contained in FONTSET.
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
583
18696
1caf720e4f55 (print-fontset): Output format improved.
Kenichi Handa <handa@m17n.org>
parents: 18643
diff changeset
584 The column WDxHT contains width and height (pixels) of each fontset
1caf720e4f55 (print-fontset): Output format improved.
Kenichi Handa <handa@m17n.org>
parents: 18643
diff changeset
585 \(i.e. those of ASCII font in the fontset). The letter `-' in this
1caf720e4f55 (print-fontset): Output format improved.
Kenichi Handa <handa@m17n.org>
parents: 18643
diff changeset
586 column means that the corresponding fontset is not yet used in any
1caf720e4f55 (print-fontset): Output format improved.
Kenichi Handa <handa@m17n.org>
parents: 18643
diff changeset
587 frame.
18559
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
588
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
589 The O column of each font contains one of the following letters.
18643
c9b94c6ab8f1 (print-fontset): Output format tuned.
Kenichi Handa <handa@m17n.org>
parents: 18559
diff changeset
590 o -- font already opened
c9b94c6ab8f1 (print-fontset): Output format tuned.
Kenichi Handa <handa@m17n.org>
parents: 18559
diff changeset
591 - -- font not yet opened
c9b94c6ab8f1 (print-fontset): Output format tuned.
Kenichi Handa <handa@m17n.org>
parents: 18559
diff changeset
592 x -- font can't be opened
c9b94c6ab8f1 (print-fontset): Output format tuned.
Kenichi Handa <handa@m17n.org>
parents: 18559
diff changeset
593 ? -- no font specified
18559
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
594
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
595 The Charset column of each font contains a name of character set
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
596 displayed by the font."
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
597 (interactive
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
598 (if (not window-system)
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
599 (error "No window system being used")
18559
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
600 (let ((fontset-list (mapcar '(lambda (x) (list x)) (fontset-list)))
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
601 (completion-ignore-case t))
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
602 (list (completing-read
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
603 "Fontset (default, used by the current frame): "
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
604 fontset-list nil t)))))
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
605 (if (= (length fontset) 0)
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
606 (setq fontset (cdr (assq 'font (frame-parameters)))))
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
607 (if (not (query-fontset fontset))
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
608 (error "Current frame is using font, not fontset"))
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
609 (let ((fontset-info (fontset-info fontset)))
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
610 (with-output-to-temp-buffer "*Help*"
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
611 (save-excursion
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
612 (set-buffer standard-output)
18696
1caf720e4f55 (print-fontset): Output format improved.
Kenichi Handa <handa@m17n.org>
parents: 18643
diff changeset
613 (insert "Fontset-Name\t\t\t\t\t\t WDxHT Style\n")
1caf720e4f55 (print-fontset): Output format improved.
Kenichi Handa <handa@m17n.org>
parents: 18643
diff changeset
614 (insert "------------\t\t\t\t\t\t ----- -----\n")
18559
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
615 (print-fontset fontset t)))))
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
616
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
617 ;;;###autoload
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
618 (defun list-fontsets (arg)
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
619 "Display a list of all fontsets.
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
620
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
621 It prints name, size, and style of each fontset.
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
622 With prefix arg, it also lists up fonts contained in each fontset.
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
623 See the function `describe-fontset' for the format of the list."
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
624 (interactive "P")
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
625 (with-output-to-temp-buffer "*Help*"
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
626 (save-excursion
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
627 (set-buffer standard-output)
18696
1caf720e4f55 (print-fontset): Output format improved.
Kenichi Handa <handa@m17n.org>
parents: 18643
diff changeset
628 (insert "Fontset-Name\t\t\t\t\t\t WDxHT Style\n")
1caf720e4f55 (print-fontset): Output format improved.
Kenichi Handa <handa@m17n.org>
parents: 18643
diff changeset
629 (insert "------------\t\t\t\t\t\t ----- -----\n")
18559
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
630 (let ((fontsets (fontset-list)))
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
631 (while fontsets
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
632 (print-fontset (car fontsets) arg)
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
633 (setq fontsets (cdr fontsets)))))))
18300
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
634
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
635 ;;;###autoload
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
636 (defun list-input-methods ()
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
637 "Print information of all input methods."
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
638 (interactive)
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
639 (with-output-to-temp-buffer "*Help*"
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
640 (princ "LANGUAGE\n NAME (`TITLE' in mode line)\n")
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
641 (princ " SHORT-DESCRIPTION\n------------------------------\n")
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
642 (setq input-method-alist
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
643 (sort input-method-alist
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
644 (function (lambda (x y) (string< (nth 1 x) (nth 1 y))))))
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
645 (let ((l input-method-alist)
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
646 language elt)
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
647 (while l
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
648 (setq elt (car l) l (cdr l))
18559
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
649 (when (not (equal language (nth 1 elt)))
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
650 (setq language (nth 1 elt))
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
651 (princ language)
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
652 (terpri))
18300
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
653 (princ (format " %s (`%s' in mode line)\n %s\n"
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
654 (car elt) (nth 3 elt)
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
655 (let ((title (nth 4 elt)))
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
656 (string-match ".*" title)
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
657 (match-string 0 title))))))))
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
658
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
659 ;;; DIAGNOSIS
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
660
18559
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
661 ;; Insert a header of a section with SECTION-NUMBER and TITLE.
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
662 (defun insert-section (section-number title)
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
663 (insert "########################################\n"
18559
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
664 "# Section " (format "%d" section-number) ". " title "\n"
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
665 "########################################\n\n"))
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
666
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
667 ;;;###autoload
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
668 (defun mule-diag ()
18559
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
669 "Display diagnosis of the multilingual environment (MULE).
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
670
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
671 It prints various information related to the current multilingual
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
672 environment, including lists of input methods, coding systems,
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
673 character sets, and fontsets (if Emacs running under some window
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
674 system)."
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
675 (interactive)
18559
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
676 (with-output-to-temp-buffer "*Mule-Diagnosis*"
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
677 (save-excursion
18559
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
678 (set-buffer standard-output)
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
679 (insert "\t###############################\n"
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
680 "\t### Diagnosis of your Emacs ###\n"
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
681 "\t###############################\n\n"
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
682 "CONTENTS: Section 1. General Information\n"
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
683 " Section 2. Display\n"
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
684 " Section 3. Input methods\n"
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
685 " Section 4. Coding systems\n"
18559
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
686 " Section 5. Character sets\n")
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
687 (if window-system
18559
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
688 (insert " Section 6. Fontsets\n"))
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
689 (insert "\n")
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
690
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
691 (insert-section 1 "General Information")
19425
572165bfff3e (mule-diag): Don't print primary-language.
Richard M. Stallman <rms@gnu.org>
parents: 19265
diff changeset
692 (insert "Version of this emacs:\n " (emacs-version) "\n\n")
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
693
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
694 (insert-section 2 "Display")
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
695 (if window-system
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
696 (insert "Window-system: "
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
697 (symbol-name window-system)
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
698 (format "%s" window-system-version))
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
699 (insert "Terminal: " (getenv "TERM")))
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
700 (insert "\n\n")
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
701
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
702 (if (eq window-system 'x)
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
703 (let ((font (cdr (assq 'font (frame-parameters)))))
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
704 (insert "The selected frame is using the "
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
705 (if (query-fontset font) "fontset" "font")
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
706 ":\n\t" font))
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
707 (insert "Coding system of the terminal: "
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
708 (symbol-name (terminal-coding-system))))
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
709 (insert "\n\n")
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
710
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
711 (insert-section 3 "Input methods")
18300
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
712 (save-excursion (list-input-methods))
18559
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
713 (insert-buffer-substring "*Help*")
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
714 (insert "\n")
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
715 (if default-input-method
19557
f0f3ffd3b852 (mule-diag): Add save-excursion calls.
Richard M. Stallman <rms@gnu.org>
parents: 19425
diff changeset
716 (insert "Default input method: " default-input-method "\n")
19657
940d50684d68 (describe-current-coding-system): Add missing newline in output.
Richard M. Stallman <rms@gnu.org>
parents: 19557
diff changeset
717 (insert "No default input method is specified\n"))
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
718
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
719 (insert-section 4 "Coding systems")
18559
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
720 (save-excursion (list-coding-systems t))
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
721 (insert-buffer-substring "*Help*")
19557
f0f3ffd3b852 (mule-diag): Add save-excursion calls.
Richard M. Stallman <rms@gnu.org>
parents: 19425
diff changeset
722 (save-excursion (list-coding-categories))
18559
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
723 (insert-buffer-substring "*Help*")
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
724 (insert "\n")
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
725
18559
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
726 (insert-section 5 "Character sets")
19557
f0f3ffd3b852 (mule-diag): Add save-excursion calls.
Richard M. Stallman <rms@gnu.org>
parents: 19425
diff changeset
727 (save-excursion (list-character-sets t))
18559
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
728 (insert-buffer-substring "*Help*")
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
729 (insert "\n")
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
730
18559
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
731 (when window-system
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
732 (insert-section 6 "Fontsets")
19557
f0f3ffd3b852 (mule-diag): Add save-excursion calls.
Richard M. Stallman <rms@gnu.org>
parents: 19425
diff changeset
733 (save-excursion (list-fontsets t))
18559
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
734 (insert-buffer-substring "*Help*"))
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
735 (help-mode))))
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
736
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
737
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
738 ;;; DUMP DATA FILE
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
739
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
740 ;;;###autoload
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
741 (defun dump-charsets ()
18559
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
742 "Dump information of all charsets into the file \"CHARSETS\".
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
743 The file is saved in the directory `data-directory'."
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
744 (let ((file (expand-file-name "CHARSETS" data-directory))
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
745 buf)
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
746 (or (file-writable-p file)
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
747 (error "Can't write to file %s" file))
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
748 (setq buf (find-file-noselect file))
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
749 (save-window-excursion
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
750 (save-excursion
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
751 (set-buffer buf)
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
752 (setq buffer-read-only nil)
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
753 (erase-buffer)
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
754 (list-character-sets t)
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
755 (insert-buffer-substring "*Help*")
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
756 (let (make-backup-files
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
757 coding-system-for-write)
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
758 (save-buffer))))
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
759 (kill-buffer buf))
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
760 (if noninteractive
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
761 (kill-emacs)))
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
762
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
763 ;;;###autoload
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
764 (defun dump-codings ()
18559
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
765 "Dump information of all coding systems into the file \"CODINGS\".
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
766 The file is saved in the directory `data-directory'."
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
767 (let ((file (expand-file-name "CODINGS" data-directory))
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
768 buf)
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
769 (or (file-writable-p file)
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
770 (error "Can't write to file %s" file))
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
771 (setq buf (find-file-noselect file))
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
772 (save-window-excursion
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
773 (save-excursion
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
774 (set-buffer buf)
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
775 (setq buffer-read-only nil)
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
776 (erase-buffer)
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
777 (list-coding-systems t)
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
778 (insert-buffer-substring "*Help*")
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
779 (list-coding-categories)
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
780 (insert-buffer-substring "*Help*")
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
781 (let (make-backup-files
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
782 coding-system-for-write)
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
783 (save-buffer))))
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
784 (kill-buffer buf))
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
785 (if noninteractive
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
786 (kill-emacs)))
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
787
18199
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
788 ;;; mule-diag.el ends here