Mercurial > emacs
annotate lisp/international/mule-diag.el @ 48189:f53a6c75be8a
(maybe_bootstrap): Fix shell variable usage. Handle separate-build-dir case.
author | Miles Bader <miles@gnu.org> |
---|---|
date | Thu, 07 Nov 2002 01:02:35 +0000 |
parents | 7f760c845427 |
children | 6953cce6f3c8 |
rev | line source |
---|---|
38414
67b464da13ec
Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents:
36989
diff
changeset
|
1 ;;; mule-diag.el --- show diagnosis of multilingual environment (Mule) |
17052 | 2 |
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. |
43231
06e0fbd07e17
Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents:
42362
diff
changeset
|
5 ;; Copyright (C) 2001, 2002 Free Software Foundation, Inc. |
17052 | 6 |
27953 | 7 ;; Keywords: multilingual, charset, coding system, fontset, diagnosis, i18n |
17052 | 8 |
9 ;; This file is part of GNU Emacs. | |
10 | |
11 ;; GNU Emacs is free software; you can redistribute it and/or modify | |
12 ;; it under the terms of the GNU General Public License as published by | |
13 ;; the Free Software Foundation; either version 2, or (at your option) | |
14 ;; any later version. | |
15 | |
16 ;; GNU Emacs is distributed in the hope that it will be useful, | |
17 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
19 ;; GNU General Public License for more details. | |
20 | |
21 ;; You should have received a copy of the GNU General Public License | |
17071 | 22 ;; along with GNU Emacs; see the file COPYING. If not, write to the |
23 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, | |
24 ;; Boston, MA 02111-1307, USA. | |
17052 | 25 |
38414
67b464da13ec
Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents:
36989
diff
changeset
|
26 ;;; Commentary: |
67b464da13ec
Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents:
36989
diff
changeset
|
27 |
67b464da13ec
Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents:
36989
diff
changeset
|
28 ;;; Code: |
67b464da13ec
Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents:
36989
diff
changeset
|
29 |
40722
1b9616706fd5
(help-funs): Require help-funs.
Richard M. Stallman <rms@gnu.org>
parents:
40664
diff
changeset
|
30 ;; Make sure the help-xref button type is defined. |
41586
f41a14872734
Require help-fns instead of help-funs.
Eli Zaretskii <eliz@gnu.org>
parents:
40722
diff
changeset
|
31 (require 'help-fns) |
40722
1b9616706fd5
(help-funs): Require help-funs.
Richard M. Stallman <rms@gnu.org>
parents:
40664
diff
changeset
|
32 |
17052 | 33 ;;; General utility function |
34 | |
35 ;; Print all arguments with single space separator in one line. | |
36 (defun print-list (&rest args) | |
37 (while (cdr args) | |
18559
20369fbd0f91
(print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents:
18377
diff
changeset
|
38 (when (car args) |
20369fbd0f91
(print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents:
18377
diff
changeset
|
39 (princ (car args)) |
20369fbd0f91
(print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents:
18377
diff
changeset
|
40 (princ " ")) |
17052 | 41 (setq args (cdr args))) |
42 (princ (car args)) | |
43 (princ "\n")) | |
44 | |
18559
20369fbd0f91
(print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents:
18377
diff
changeset
|
45 ;; Re-order the elements of charset-list. |
20369fbd0f91
(print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents:
18377
diff
changeset
|
46 (defun sort-charset-list () |
20369fbd0f91
(print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents:
18377
diff
changeset
|
47 (setq charset-list |
20369fbd0f91
(print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents:
18377
diff
changeset
|
48 (sort charset-list |
47548
698b4a4bb562
(describe-coding-system): Remove unused `coding-spec' variable.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
46490
diff
changeset
|
49 (lambda (x y) (< (charset-id x) (charset-id y)))))) |
18559
20369fbd0f91
(print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents:
18377
diff
changeset
|
50 |
17052 | 51 ;;; CHARSET |
52 | |
40639 | 53 (define-button-type 'sort-listed-character-sets |
54 'help-echo (purecopy "mouse-2, RET: sort on this column") | |
55 'face 'bold | |
56 'action #'(lambda (button) | |
57 (sort-listed-character-sets (button-get button 'sort-key)))) | |
58 | |
59 (define-button-type 'list-charset-chars | |
60 :supertype 'help-xref | |
61 'help-function #'list-charset-chars | |
62 'help-echo "mouse-2, RET: show table of characters for this character set") | |
63 | |
48050 | 64 (defvar non-iso-charset-alist |
65 `((mac-roman | |
66 (ascii latin-iso8859-1 mule-unicode-2500-33ff | |
67 mule-unicode-0100-24ff mule-unicode-e000-ffff) | |
68 mac-roman-decoder | |
69 ((0 255))) | |
70 (viscii | |
71 (ascii vietnamese-viscii-lower vietnamese-viscii-upper) | |
72 viet-viscii-nonascii-translation-table | |
73 ((0 255))) | |
74 (koi8-r | |
75 (ascii cyrillic-iso8859-5) | |
76 cyrillic-koi8-r-nonascii-translation-table | |
77 ((32 255))) | |
78 (alternativnyj | |
79 (ascii cyrillic-iso8859-5) | |
80 cyrillic-alternativnyj-nonascii-translation-table | |
81 ((32 255))) | |
82 (koi8-u | |
83 (ascii cyrillic-iso8859-5 mule-unicode-0100-24ff) | |
84 cyrillic-koi8-u-nonascii-translation-table | |
85 ((32 255))) | |
86 (big5 | |
87 (ascii chinese-big5-1 chinese-big5-2) | |
88 decode-big5-char | |
89 ((32 127) | |
90 ((?\xA1 ?\xFE) . (?\x40 ?\x7E ?\xA1 ?\xFE)))) | |
91 (sjis | |
92 (ascii katakana-jisx0201 japanese-jisx0208) | |
93 decode-sjis-char | |
94 ((32 127 ?\xA1 ?\xDF) | |
95 ((?\x81 ?\x9F ?\xE0 ?\xEF) . (?\x40 ?\x7E ?\x80 ?\xFC))))) | |
96 "Alist of charset names vs the corresponding information. | |
97 This is mis-named for historical reasons. The charsets are actually | |
98 non-built-in ones. They correspond to Emacs coding systems, not Emacs | |
99 charsets, i.e. what Emacs can read (or write) by mapping to (or | |
100 from) Emacs internal charsets that typically correspond to a limited | |
101 set of ISO charsets. | |
102 | |
103 Each element has the following format: | |
104 (CHARSET CHARSET-LIST TRANSLATION-METHOD [ CODE-RANGE ]) | |
105 | |
106 CHARSET is the name (symbol) of the charset. | |
107 | |
108 CHARSET-LIST is a list of Emacs charsets into which characters of | |
109 CHARSET are mapped. | |
110 | |
111 TRANSLATION-METHOD is a translation table (symbol) to translate a | |
112 character code of CHARSET to the corresponding Emacs character | |
113 code. It can also be a function to call with one argument, a | |
114 character code in CHARSET. | |
115 | |
116 CODE-RANGE specifies the valid code ranges of CHARSET. | |
117 It is a list of RANGEs, where each RANGE is of the form: | |
118 (FROM1 TO1 FROM2 TO2 ...) | |
119 or | |
120 ((FROM1-1 TO1-1 FROM1-2 TO1-2 ...) . (FROM2-1 TO2-1 FROM2-2 TO2-2 ...)) | |
121 In the first form, valid codes are between FROM1 and TO1, or FROM2 and | |
122 TO2, or... | |
123 The second form is used for 2-byte codes. The car part is the ranges | |
124 of the first byte, and the cdr part is the ranges of the second byte.") | |
40639 | 125 |
17052 | 126 ;;;###autoload |
27912
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
127 (defun list-character-sets (arg) |
18559
20369fbd0f91
(print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents:
18377
diff
changeset
|
128 "Display a list of all character sets. |
20369fbd0f91
(print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents:
18377
diff
changeset
|
129 |
43231
06e0fbd07e17
Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents:
42362
diff
changeset
|
130 The ID-NUM column contains a charset identification number for |
06e0fbd07e17
Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents:
42362
diff
changeset
|
131 internal Emacs use. |
27912
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
132 |
43231
06e0fbd07e17
Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents:
42362
diff
changeset
|
133 The MULTIBYTE-FORM column contains the format of the buffer and string |
06e0fbd07e17
Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents:
42362
diff
changeset
|
134 multibyte sequence of characters in the charset using one to four |
06e0fbd07e17
Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents:
42362
diff
changeset
|
135 hexadecimal digits. |
27912
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
136 `xx' stands for any byte in the range 0..127. |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
137 `XX' stands for any byte in the range 160..255. |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
138 |
43231
06e0fbd07e17
Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents:
42362
diff
changeset
|
139 The D column contains the dimension of this character set. The CH |
06e0fbd07e17
Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents:
42362
diff
changeset
|
140 column contains the number of characters in a block of this character |
06e0fbd07e17
Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents:
42362
diff
changeset
|
141 set. The FINAL-CHAR column contains an ISO-2022 <final-char> to use |
06e0fbd07e17
Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents:
42362
diff
changeset
|
142 for designating this character set in ISO-2022-based coding systems. |
18559
20369fbd0f91
(print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents:
18377
diff
changeset
|
143 |
22306 | 144 With prefix arg, the output format gets more cryptic, |
145 but still shows the full information." | |
18559
20369fbd0f91
(print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents:
18377
diff
changeset
|
146 (interactive "P") |
40664
4e5f8e42b8d1
(list-character-sets, sort-listed-character-sets, describe-character-set)
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
40639
diff
changeset
|
147 (help-setup-xref (list #'list-character-sets arg) (interactive-p)) |
47603
28c9630ee23e
(list-character-sets): Use the buffer
Kenichi Handa <handa@m17n.org>
parents:
47548
diff
changeset
|
148 (with-output-to-temp-buffer "*Character Set List*" |
27912
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
149 (with-current-buffer standard-output |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
150 (if arg |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
151 (list-character-sets-2) |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
152 ;; Insert header. |
47605
22df356e38df
(list-character-sets): List also indirectly supported character sets.
Kenichi Handa <handa@m17n.org>
parents:
47603
diff
changeset
|
153 (insert "Indirectly supported character sets are shown below.\n") |
27912
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
154 (insert |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
155 (substitute-command-keys |
27973
cf535f97695d
(list-character-sets): Make help-echo
Kenichi Handa <handa@m17n.org>
parents:
27953
diff
changeset
|
156 (concat "Use " |
cf535f97695d
(list-character-sets): Make help-echo
Kenichi Handa <handa@m17n.org>
parents:
27953
diff
changeset
|
157 (if (display-mouse-p) "\\[help-follow-mouse] or ") |
cf535f97695d
(list-character-sets): Make help-echo
Kenichi Handa <handa@m17n.org>
parents:
27953
diff
changeset
|
158 "\\[help-follow]:\n"))) |
cf535f97695d
(list-character-sets): Make help-echo
Kenichi Handa <handa@m17n.org>
parents:
27953
diff
changeset
|
159 (insert " on a column title to sort by that title,") |
27912
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
160 (indent-to 56) |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
161 (insert "+----DIMENSION\n") |
27973
cf535f97695d
(list-character-sets): Make help-echo
Kenichi Handa <handa@m17n.org>
parents:
27953
diff
changeset
|
162 (insert " on a charset name to list characters.") |
27912
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
163 (indent-to 56) |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
164 (insert "| +--CHARS\n") |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
165 (let ((columns '(("ID-NUM" . id) "\t" |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
166 ("CHARSET-NAME" . name) "\t\t\t" |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
167 ("MULTIBYTE-FORM" . id) "\t" |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
168 ("D CH FINAL-CHAR" . iso-spec))) |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
169 pos) |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
170 (while columns |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
171 (if (stringp (car columns)) |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
172 (insert (car columns)) |
40639 | 173 (insert-text-button (car (car columns)) |
174 :type 'sort-listed-character-sets | |
175 'sort-key (cdr (car columns))) | |
27912
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
176 (goto-char (point-max))) |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
177 (setq columns (cdr columns))) |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
178 (insert "\n")) |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
179 (insert "------\t------------\t\t\t--------------\t- -- ----------\n") |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
180 |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
181 ;; Insert body sorted by charset IDs. |
47605
22df356e38df
(list-character-sets): List also indirectly supported character sets.
Kenichi Handa <handa@m17n.org>
parents:
47603
diff
changeset
|
182 (list-character-sets-1 'id) |
22df356e38df
(list-character-sets): List also indirectly supported character sets.
Kenichi Handa <handa@m17n.org>
parents:
47603
diff
changeset
|
183 |
22df356e38df
(list-character-sets): List also indirectly supported character sets.
Kenichi Handa <handa@m17n.org>
parents:
47603
diff
changeset
|
184 ;; Insert non-directly-supported charsets. |
22df356e38df
(list-character-sets): List also indirectly supported character sets.
Kenichi Handa <handa@m17n.org>
parents:
47603
diff
changeset
|
185 (insert-char ?- 72) |
22df356e38df
(list-character-sets): List also indirectly supported character sets.
Kenichi Handa <handa@m17n.org>
parents:
47603
diff
changeset
|
186 (insert "\n\nINDIRECTLY SUPPORTED CHARSETS SETS:\n\n" |
22df356e38df
(list-character-sets): List also indirectly supported character sets.
Kenichi Handa <handa@m17n.org>
parents:
47603
diff
changeset
|
187 (propertize "CHARSET NAME\tMAPPED TO" 'face 'bold) |
22df356e38df
(list-character-sets): List also indirectly supported character sets.
Kenichi Handa <handa@m17n.org>
parents:
47603
diff
changeset
|
188 "\n------------\t---------\n") |
22df356e38df
(list-character-sets): List also indirectly supported character sets.
Kenichi Handa <handa@m17n.org>
parents:
47603
diff
changeset
|
189 (dolist (elt non-iso-charset-alist) |
22df356e38df
(list-character-sets): List also indirectly supported character sets.
Kenichi Handa <handa@m17n.org>
parents:
47603
diff
changeset
|
190 (insert-text-button (symbol-name (car elt)) |
22df356e38df
(list-character-sets): List also indirectly supported character sets.
Kenichi Handa <handa@m17n.org>
parents:
47603
diff
changeset
|
191 :type 'list-charset-chars |
22df356e38df
(list-character-sets): List also indirectly supported character sets.
Kenichi Handa <handa@m17n.org>
parents:
47603
diff
changeset
|
192 'help-args (list (car elt))) |
22df356e38df
(list-character-sets): List also indirectly supported character sets.
Kenichi Handa <handa@m17n.org>
parents:
47603
diff
changeset
|
193 (indent-to 16) |
22df356e38df
(list-character-sets): List also indirectly supported character sets.
Kenichi Handa <handa@m17n.org>
parents:
47603
diff
changeset
|
194 (dolist (e (nth 1 elt)) |
22df356e38df
(list-character-sets): List also indirectly supported character sets.
Kenichi Handa <handa@m17n.org>
parents:
47603
diff
changeset
|
195 (when (>= (+ (current-column) 1 (string-width (symbol-name e))) |
22df356e38df
(list-character-sets): List also indirectly supported character sets.
Kenichi Handa <handa@m17n.org>
parents:
47603
diff
changeset
|
196 ;; This is an approximate value. We don't know |
22df356e38df
(list-character-sets): List also indirectly supported character sets.
Kenichi Handa <handa@m17n.org>
parents:
47603
diff
changeset
|
197 ;; the correct window width of this buffer yet. |
22df356e38df
(list-character-sets): List also indirectly supported character sets.
Kenichi Handa <handa@m17n.org>
parents:
47603
diff
changeset
|
198 78) |
22df356e38df
(list-character-sets): List also indirectly supported character sets.
Kenichi Handa <handa@m17n.org>
parents:
47603
diff
changeset
|
199 (insert "\n") |
22df356e38df
(list-character-sets): List also indirectly supported character sets.
Kenichi Handa <handa@m17n.org>
parents:
47603
diff
changeset
|
200 (indent-to 16)) |
22df356e38df
(list-character-sets): List also indirectly supported character sets.
Kenichi Handa <handa@m17n.org>
parents:
47603
diff
changeset
|
201 |
22df356e38df
(list-character-sets): List also indirectly supported character sets.
Kenichi Handa <handa@m17n.org>
parents:
47603
diff
changeset
|
202 (insert (format "%s " e))) |
22df356e38df
(list-character-sets): List also indirectly supported character sets.
Kenichi Handa <handa@m17n.org>
parents:
47603
diff
changeset
|
203 (insert "\n")))))) |
27912
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
204 |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
205 (defun sort-listed-character-sets (sort-key) |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
206 (if sort-key |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
207 (save-excursion |
40664
4e5f8e42b8d1
(list-character-sets, sort-listed-character-sets, describe-character-set)
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
40639
diff
changeset
|
208 (help-setup-xref (list #'list-character-sets nil) t) |
27912
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
209 (let ((buffer-read-only nil)) |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
210 (goto-char (point-min)) |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
211 (re-search-forward "[0-9][0-9][0-9]") |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
212 (beginning-of-line) |
47605
22df356e38df
(list-character-sets): List also indirectly supported character sets.
Kenichi Handa <handa@m17n.org>
parents:
47603
diff
changeset
|
213 (let ((pos (point))) |
22df356e38df
(list-character-sets): List also indirectly supported character sets.
Kenichi Handa <handa@m17n.org>
parents:
47603
diff
changeset
|
214 (search-forward "----------") |
22df356e38df
(list-character-sets): List also indirectly supported character sets.
Kenichi Handa <handa@m17n.org>
parents:
47603
diff
changeset
|
215 (beginning-of-line) |
22df356e38df
(list-character-sets): List also indirectly supported character sets.
Kenichi Handa <handa@m17n.org>
parents:
47603
diff
changeset
|
216 (save-restriction |
22df356e38df
(list-character-sets): List also indirectly supported character sets.
Kenichi Handa <handa@m17n.org>
parents:
47603
diff
changeset
|
217 (narrow-to-region pos (point)) |
22df356e38df
(list-character-sets): List also indirectly supported character sets.
Kenichi Handa <handa@m17n.org>
parents:
47603
diff
changeset
|
218 (delete-region (point-min) (point-max)) |
22df356e38df
(list-character-sets): List also indirectly supported character sets.
Kenichi Handa <handa@m17n.org>
parents:
47603
diff
changeset
|
219 (list-character-sets-1 sort-key))))))) |
27912
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
220 |
31246
d8ce7bce2aab
(charset-multibyte-form-string): New function.
Kenichi Handa <handa@m17n.org>
parents:
30765
diff
changeset
|
221 (defun charset-multibyte-form-string (charset) |
d8ce7bce2aab
(charset-multibyte-form-string): New function.
Kenichi Handa <handa@m17n.org>
parents:
30765
diff
changeset
|
222 (let ((info (charset-info charset))) |
d8ce7bce2aab
(charset-multibyte-form-string): New function.
Kenichi Handa <handa@m17n.org>
parents:
30765
diff
changeset
|
223 (cond ((eq charset 'ascii) |
d8ce7bce2aab
(charset-multibyte-form-string): New function.
Kenichi Handa <handa@m17n.org>
parents:
30765
diff
changeset
|
224 "xx") |
d8ce7bce2aab
(charset-multibyte-form-string): New function.
Kenichi Handa <handa@m17n.org>
parents:
30765
diff
changeset
|
225 ((eq charset 'eight-bit-control) |
d8ce7bce2aab
(charset-multibyte-form-string): New function.
Kenichi Handa <handa@m17n.org>
parents:
30765
diff
changeset
|
226 (format "%2X Xx" (aref info 6))) |
d8ce7bce2aab
(charset-multibyte-form-string): New function.
Kenichi Handa <handa@m17n.org>
parents:
30765
diff
changeset
|
227 ((eq charset 'eight-bit-graphic) |
d8ce7bce2aab
(charset-multibyte-form-string): New function.
Kenichi Handa <handa@m17n.org>
parents:
30765
diff
changeset
|
228 "XX") |
d8ce7bce2aab
(charset-multibyte-form-string): New function.
Kenichi Handa <handa@m17n.org>
parents:
30765
diff
changeset
|
229 (t |
d8ce7bce2aab
(charset-multibyte-form-string): New function.
Kenichi Handa <handa@m17n.org>
parents:
30765
diff
changeset
|
230 (let ((str (format "%2X" (aref info 6)))) |
d8ce7bce2aab
(charset-multibyte-form-string): New function.
Kenichi Handa <handa@m17n.org>
parents:
30765
diff
changeset
|
231 (if (> (aref info 7) 0) |
d8ce7bce2aab
(charset-multibyte-form-string): New function.
Kenichi Handa <handa@m17n.org>
parents:
30765
diff
changeset
|
232 (setq str (format "%s %2X" |
d8ce7bce2aab
(charset-multibyte-form-string): New function.
Kenichi Handa <handa@m17n.org>
parents:
30765
diff
changeset
|
233 str (aref info 7)))) |
d8ce7bce2aab
(charset-multibyte-form-string): New function.
Kenichi Handa <handa@m17n.org>
parents:
30765
diff
changeset
|
234 (setq str (concat str " XX")) |
d8ce7bce2aab
(charset-multibyte-form-string): New function.
Kenichi Handa <handa@m17n.org>
parents:
30765
diff
changeset
|
235 (if (> (aref info 2) 1) |
d8ce7bce2aab
(charset-multibyte-form-string): New function.
Kenichi Handa <handa@m17n.org>
parents:
30765
diff
changeset
|
236 (setq str (concat str " XX"))) |
d8ce7bce2aab
(charset-multibyte-form-string): New function.
Kenichi Handa <handa@m17n.org>
parents:
30765
diff
changeset
|
237 str))))) |
d8ce7bce2aab
(charset-multibyte-form-string): New function.
Kenichi Handa <handa@m17n.org>
parents:
30765
diff
changeset
|
238 |
27912
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
239 ;; Insert a list of character sets sorted by SORT-KEY. SORT-KEY |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
240 ;; should be one of `id', `name', and `iso-spec'. If SORT-KEY is nil, |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
241 ;; it defaults to `id'. |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
242 |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
243 (defun list-character-sets-1 (sort-key) |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
244 (or sort-key |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
245 (setq sort-key 'id)) |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
246 (let ((tail (charset-list)) |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
247 charset-info-list elt charset info sort-func) |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
248 (while tail |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
249 (setq charset (car tail) tail (cdr tail) |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
250 info (charset-info charset)) |
22339
69de59462e22
(list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents:
22306
diff
changeset
|
251 |
27912
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
252 ;; Generate a list that contains all information to display. |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
253 (setq charset-info-list |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
254 (cons (list (charset-id charset) ; ID-NUM |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
255 charset ; CHARSET-NAME |
31246
d8ce7bce2aab
(charset-multibyte-form-string): New function.
Kenichi Handa <handa@m17n.org>
parents:
30765
diff
changeset
|
256 (charset-multibyte-form-string charset); MULTIBYTE-FORM |
27912
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
257 (aref info 2) ; DIMENSION |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
258 (aref info 3) ; CHARS |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
259 (aref info 8) ; FINAL-CHAR |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
260 ) |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
261 charset-info-list))) |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
262 |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
263 ;; Determine a predicate for `sort' by SORT-KEY. |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
264 (setq sort-func |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
265 (cond ((eq sort-key 'id) |
47548
698b4a4bb562
(describe-coding-system): Remove unused `coding-spec' variable.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
46490
diff
changeset
|
266 (lambda (x y) (< (car x) (car y)))) |
27912
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
267 |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
268 ((eq sort-key 'name) |
47548
698b4a4bb562
(describe-coding-system): Remove unused `coding-spec' variable.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
46490
diff
changeset
|
269 (lambda (x y) (string< (nth 1 x) (nth 1 y)))) |
27912
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
270 |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
271 ((eq sort-key 'iso-spec) |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
272 ;; Sort by DIMENSION CHARS FINAL-CHAR |
47548
698b4a4bb562
(describe-coding-system): Remove unused `coding-spec' variable.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
46490
diff
changeset
|
273 (lambda (x y) |
698b4a4bb562
(describe-coding-system): Remove unused `coding-spec' variable.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
46490
diff
changeset
|
274 (or (< (nth 3 x) (nth 3 y)) |
698b4a4bb562
(describe-coding-system): Remove unused `coding-spec' variable.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
46490
diff
changeset
|
275 (and (= (nth 3 x) (nth 3 y)) |
698b4a4bb562
(describe-coding-system): Remove unused `coding-spec' variable.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
46490
diff
changeset
|
276 (or (< (nth 4 x) (nth 4 y)) |
698b4a4bb562
(describe-coding-system): Remove unused `coding-spec' variable.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
46490
diff
changeset
|
277 (and (= (nth 4 x) (nth 4 y)) |
698b4a4bb562
(describe-coding-system): Remove unused `coding-spec' variable.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
46490
diff
changeset
|
278 (< (nth 5 x) (nth 5 y)))))))) |
27912
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
279 (t |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
280 (error "Invalid charset sort key: %s" sort-key)))) |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
281 |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
282 (setq charset-info-list (sort charset-info-list sort-func)) |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
283 |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
284 ;; Insert information of character sets. |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
285 (while charset-info-list |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
286 (setq elt (car charset-info-list) |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
287 charset-info-list (cdr charset-info-list)) |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
288 (insert (format "%03d(%02X)" (car elt) (car elt))) ; ID-NUM |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
289 (indent-to 8) |
40639 | 290 (insert-text-button (symbol-name (nth 1 elt)) |
291 :type 'list-charset-chars | |
292 'help-args (list (nth 1 elt))) | |
27912
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
293 (goto-char (point-max)) |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
294 (insert "\t") |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
295 (indent-to 40) |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
296 (insert (nth 2 elt)) ; MULTIBYTE-FORM |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
297 (indent-to 56) |
29026
3666bafb45c7
(list-character-sets-1): Handle
Kenichi Handa <handa@m17n.org>
parents:
28964
diff
changeset
|
298 (insert (format "%d %2d " (nth 3 elt) (nth 4 elt)) ; DIMENSION and CHARS |
3666bafb45c7
(list-character-sets-1): Handle
Kenichi Handa <handa@m17n.org>
parents:
28964
diff
changeset
|
299 (if (< (nth 5 elt) 0) "none" (nth 5 elt))) ; FINAL-CHAR |
27912
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
300 (insert "\n")))) |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
301 |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
302 |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
303 ;; List all character sets in a form that a program can easily parse. |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
304 |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
305 (defun list-character-sets-2 () |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
306 (insert "######################### |
17052 | 307 ## LIST OF CHARSETS |
308 ## Each line corresponds to one charset. | |
309 ## The following attributes are listed in this order | |
310 ## separated by a colon `:' in one line. | |
18559
20369fbd0f91
(print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents:
18377
diff
changeset
|
311 ## CHARSET-ID, |
17052 | 312 ## CHARSET-SYMBOL-NAME, |
313 ## DIMENSION (1 or 2) | |
314 ## CHARS (94 or 96) | |
315 ## BYTES (of multibyte form: 1, 2, 3, or 4), | |
316 ## WIDTH (occupied column numbers: 1 or 2), | |
317 ## DIRECTION (0:left-to-right, 1:right-to-left), | |
318 ## ISO-FINAL-CHAR (character code of ISO-2022's final character) | |
319 ## ISO-GRAPHIC-PLANE (ISO-2022's graphic plane, 0:GL, 1:GR) | |
320 ## DESCRIPTION (describing string of the charset) | |
321 ") | |
27912
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
322 (let ((l charset-list) |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
323 charset) |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
324 (while l |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
325 (setq charset (car l) l (cdr l)) |
30765
1e5a486b8b25
punctuation fixes in doc strings
Sam Steingold <sds@gnu.org>
parents:
30126
diff
changeset
|
326 (princ (format "%03d:%s:%d:%d:%d:%d:%d:%d:%d:%s\n" |
27912
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
327 (charset-id charset) |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
328 charset |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
329 (charset-dimension charset) |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
330 (charset-chars charset) |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
331 (charset-bytes charset) |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
332 (charset-width charset) |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
333 (charset-direction charset) |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
334 (charset-iso-final-char charset) |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
335 (charset-iso-graphic-plane charset) |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
336 (charset-description charset)))))) |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
337 |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
338 (defun decode-codepage-char (codepage code) |
43231
06e0fbd07e17
Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents:
42362
diff
changeset
|
339 "Decode a character that has code CODE in CODEPAGE. |
06e0fbd07e17
Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents:
42362
diff
changeset
|
340 Return a decoded character string. Each CODEPAGE corresponds to a |
06e0fbd07e17
Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents:
42362
diff
changeset
|
341 coding system cpCODEPAGE." |
27912
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
342 (let ((coding-system (intern (format "cp%d" codepage)))) |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
343 (or (coding-system-p coding-system) |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
344 (codepage-setup codepage)) |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
345 (string-to-char |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
346 (decode-coding-string (char-to-string code) coding-system)))) |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
347 |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
348 |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
349 ;; Add DOS codepages to `non-iso-charset-alist'. |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
350 |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
351 (let ((tail (cp-supported-codepages)) |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
352 elt) |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
353 (while tail |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
354 (setq elt (car tail) tail (cdr tail)) |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
355 ;; Now ELT is (CODEPAGE . CHARSET), where CODEPAGE is a string |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
356 ;; (e.g. "850"), CHARSET is a charset that characters in CODEPAGE |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
357 ;; are mapped to. |
43231
06e0fbd07e17
Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents:
42362
diff
changeset
|
358 (unless (assq (intern (concat "cp" (car elt))) non-iso-charset-alist) |
06e0fbd07e17
Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents:
42362
diff
changeset
|
359 (setq non-iso-charset-alist |
06e0fbd07e17
Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents:
42362
diff
changeset
|
360 (cons (list (intern (concat "cp" (car elt))) |
06e0fbd07e17
Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents:
42362
diff
changeset
|
361 (list 'ascii (cdr elt)) |
06e0fbd07e17
Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents:
42362
diff
changeset
|
362 `(lambda (code) |
06e0fbd07e17
Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents:
42362
diff
changeset
|
363 (decode-codepage-char ,(string-to-int (car elt)) |
06e0fbd07e17
Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents:
42362
diff
changeset
|
364 code)) |
06e0fbd07e17
Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents:
42362
diff
changeset
|
365 (list (list 0 255))) |
06e0fbd07e17
Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents:
42362
diff
changeset
|
366 non-iso-charset-alist))))) |
27912
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
367 |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
368 |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
369 ;; A variable to hold charset input history. |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
370 (defvar charset-history nil) |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
371 |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
372 |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
373 ;;;###autoload |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
374 (defun read-charset (prompt &optional default-value initial-input) |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
375 "Read a character set from the minibuffer, prompting with string PROMPT. |
43231
06e0fbd07e17
Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents:
42362
diff
changeset
|
376 It must be an Emacs character set listed in the variable `charset-list' |
27912
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
377 or a non-ISO character set listed in the variable |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
378 `non-iso-charset-alist'. |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
379 |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
380 Optional arguments are DEFAULT-VALUE and INITIAL-INPUT. |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
381 DEFAULT-VALUE, if non-nil, is the default value. |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
382 INITIAL-INPUT, if non-nil, is a string inserted in the minibuffer initially. |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
383 See the documentation of the function `completing-read' for the |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
384 detailed meanings of these arguments." |
47548
698b4a4bb562
(describe-coding-system): Remove unused `coding-spec' variable.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
46490
diff
changeset
|
385 (let* ((table (append (mapcar (lambda (x) (list (symbol-name x))) |
27912
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
386 charset-list) |
47548
698b4a4bb562
(describe-coding-system): Remove unused `coding-spec' variable.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
46490
diff
changeset
|
387 (mapcar (lambda (x) (list (symbol-name (car x)))) |
27912
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
388 non-iso-charset-alist))) |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
389 (charset (completing-read prompt table |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
390 nil t initial-input 'charset-history |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
391 default-value))) |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
392 (if (> (length charset) 0) |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
393 (intern charset)))) |
30765
1e5a486b8b25
punctuation fixes in doc strings
Sam Steingold <sds@gnu.org>
parents:
30126
diff
changeset
|
394 |
27912
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
395 |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
396 ;; List characters of the range MIN and MAX of CHARSET. If dimension |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
397 ;; of CHARSET is two (i.e. 2-byte charset), ROW is the first byte |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
398 ;; (block index) of the characters, and MIN and MAX are the second |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
399 ;; bytes of the characters. If the dimension is one, ROW should be 0. |
29454
f0dee30140f0
(non-iso-charset-alist): Specify
Kenichi Handa <handa@m17n.org>
parents:
29228
diff
changeset
|
400 ;; For a non-ISO charset, CHARSET is a translation table (symbol) or a |
f0dee30140f0
(non-iso-charset-alist): Specify
Kenichi Handa <handa@m17n.org>
parents:
29228
diff
changeset
|
401 ;; function to get Emacs' character codes that corresponds to the |
f0dee30140f0
(non-iso-charset-alist): Specify
Kenichi Handa <handa@m17n.org>
parents:
29228
diff
changeset
|
402 ;; characters to list. |
27912
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
403 |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
404 (defun list-block-of-chars (charset row min max) |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
405 (let (i ch) |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
406 (insert-char ?- (+ 4 (* 3 16))) |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
407 (insert "\n ") |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
408 (setq i 0) |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
409 (while (< i 16) |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
410 (insert (format "%3X" i)) |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
411 (setq i (1+ i))) |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
412 (setq i (* (/ min 16) 16)) |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
413 (while (<= i max) |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
414 (if (= (% i 16) 0) |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
415 (insert (format "\n%3Xx" (/ (+ (* row 256) i) 16)))) |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
416 (setq ch (cond ((< i min) |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
417 32) |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
418 ((charsetp charset) |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
419 (if (= row 0) |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
420 (make-char charset i) |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
421 (make-char charset row i))) |
29454
f0dee30140f0
(non-iso-charset-alist): Specify
Kenichi Handa <handa@m17n.org>
parents:
29228
diff
changeset
|
422 ((and (symbolp charset) (get charset 'translation-table)) |
f0dee30140f0
(non-iso-charset-alist): Specify
Kenichi Handa <handa@m17n.org>
parents:
29228
diff
changeset
|
423 (aref (get charset 'translation-table) i)) |
27912
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
424 (t (funcall charset (+ (* row 256) i))))) |
29026
3666bafb45c7
(list-character-sets-1): Handle
Kenichi Handa <handa@m17n.org>
parents:
28964
diff
changeset
|
425 (if (and (char-table-p charset) |
3666bafb45c7
(list-character-sets-1): Handle
Kenichi Handa <handa@m17n.org>
parents:
28964
diff
changeset
|
426 (or (< ch 32) (and (>= ch 127) (<= ch 255)))) |
27912
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
427 ;; Don't insert a control code. |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
428 (setq ch 32)) |
43231
06e0fbd07e17
Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents:
42362
diff
changeset
|
429 (unless ch (setq ch 32)) |
06e0fbd07e17
Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents:
42362
diff
changeset
|
430 (if (eq ch ?\t) |
06e0fbd07e17
Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents:
42362
diff
changeset
|
431 ;; Make it visible. |
06e0fbd07e17
Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents:
42362
diff
changeset
|
432 (setq ch (propertize "\t" 'display "^I"))) |
06e0fbd07e17
Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents:
42362
diff
changeset
|
433 ;; This doesn't DTRT. Maybe it's better to insert "^J" and not |
06e0fbd07e17
Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents:
42362
diff
changeset
|
434 ;; worry about the buffer contents not being correct. |
06e0fbd07e17
Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents:
42362
diff
changeset
|
435 ;;; (if (eq ch ?\n) |
06e0fbd07e17
Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents:
42362
diff
changeset
|
436 ;;; (setq ch (propertize "\n" 'display "^J"))) |
29026
3666bafb45c7
(list-character-sets-1): Handle
Kenichi Handa <handa@m17n.org>
parents:
28964
diff
changeset
|
437 (indent-to (+ (* (% i 16) 3) 6)) |
3666bafb45c7
(list-character-sets-1): Handle
Kenichi Handa <handa@m17n.org>
parents:
28964
diff
changeset
|
438 (insert ch) |
27912
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
439 (setq i (1+ i)))) |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
440 (insert "\n")) |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
441 |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
442 (defun list-iso-charset-chars (charset) |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
443 (let ((dim (charset-dimension charset)) |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
444 (chars (charset-chars charset)) |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
445 (plane (charset-iso-graphic-plane charset)) |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
446 min max) |
43231
06e0fbd07e17
Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents:
42362
diff
changeset
|
447 (insert (format "Characters in the coded character set %s.\n" charset)) |
27912
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
448 |
29026
3666bafb45c7
(list-character-sets-1): Handle
Kenichi Handa <handa@m17n.org>
parents:
28964
diff
changeset
|
449 (cond ((eq charset 'eight-bit-control) |
3666bafb45c7
(list-character-sets-1): Handle
Kenichi Handa <handa@m17n.org>
parents:
28964
diff
changeset
|
450 (setq min 128 max 159)) |
3666bafb45c7
(list-character-sets-1): Handle
Kenichi Handa <handa@m17n.org>
parents:
28964
diff
changeset
|
451 ((eq charset 'eight-bit-graphic) |
3666bafb45c7
(list-character-sets-1): Handle
Kenichi Handa <handa@m17n.org>
parents:
28964
diff
changeset
|
452 (setq min 160 max 255)) |
3666bafb45c7
(list-character-sets-1): Handle
Kenichi Handa <handa@m17n.org>
parents:
28964
diff
changeset
|
453 (t |
3666bafb45c7
(list-character-sets-1): Handle
Kenichi Handa <handa@m17n.org>
parents:
28964
diff
changeset
|
454 (if (= chars 94) |
3666bafb45c7
(list-character-sets-1): Handle
Kenichi Handa <handa@m17n.org>
parents:
28964
diff
changeset
|
455 (setq min 33 max 126) |
3666bafb45c7
(list-character-sets-1): Handle
Kenichi Handa <handa@m17n.org>
parents:
28964
diff
changeset
|
456 (setq min 32 max 127)) |
3666bafb45c7
(list-character-sets-1): Handle
Kenichi Handa <handa@m17n.org>
parents:
28964
diff
changeset
|
457 (or (= plane 0) |
3666bafb45c7
(list-character-sets-1): Handle
Kenichi Handa <handa@m17n.org>
parents:
28964
diff
changeset
|
458 (setq min (+ min 128) max (+ max 128))))) |
27912
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
459 |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
460 (if (= dim 1) |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
461 (list-block-of-chars charset 0 min max) |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
462 (let ((i min)) |
33837
ee31f4f9b014
(list-iso-charset-chars): For two-byte charset, fix the `while' condition.
Kenichi Handa <handa@m17n.org>
parents:
31246
diff
changeset
|
463 (while (<= i max) |
27912
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
464 (list-block-of-chars charset i min max) |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
465 (setq i (1+ i))))))) |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
466 |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
467 (defun list-non-iso-charset-chars (charset) |
43231
06e0fbd07e17
Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents:
42362
diff
changeset
|
468 "List all characters in non-built-in coded character set CHARSET." |
27912
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
469 (let* ((slot (assq charset non-iso-charset-alist)) |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
470 (charsets (nth 1 slot)) |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
471 (translate-method (nth 2 slot)) |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
472 (ranges (nth 3 slot)) |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
473 range) |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
474 (or slot |
43231
06e0fbd07e17
Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents:
42362
diff
changeset
|
475 (error "Unknown character set: %s" charset)) |
06e0fbd07e17
Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents:
42362
diff
changeset
|
476 (insert (format "Characters in the coded character set %s.\n" charset)) |
06e0fbd07e17
Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents:
42362
diff
changeset
|
477 (if charsets |
06e0fbd07e17
Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents:
42362
diff
changeset
|
478 (insert "They are mapped to: " |
06e0fbd07e17
Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents:
42362
diff
changeset
|
479 (mapconcat #'symbol-name charsets ", ") |
06e0fbd07e17
Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents:
42362
diff
changeset
|
480 "\n")) |
27912
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
481 (while ranges |
43231
06e0fbd07e17
Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents:
42362
diff
changeset
|
482 (setq range (pop ranges)) |
27912
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
483 (if (integerp (car range)) |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
484 ;; The form of RANGES is (FROM1 TO1 FROM2 TO2 ...). |
43231
06e0fbd07e17
Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents:
42362
diff
changeset
|
485 (if (and (not (functionp translate-method)) |
06e0fbd07e17
Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents:
42362
diff
changeset
|
486 (< (car (last range)) 256)) |
06e0fbd07e17
Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents:
42362
diff
changeset
|
487 ;; Do it all in one block to avoid the listing being |
06e0fbd07e17
Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents:
42362
diff
changeset
|
488 ;; broken up at gaps in the range. Don't do that for |
06e0fbd07e17
Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents:
42362
diff
changeset
|
489 ;; function translate-method, since not all codes in |
06e0fbd07e17
Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents:
42362
diff
changeset
|
490 ;; that range may be valid. |
06e0fbd07e17
Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents:
42362
diff
changeset
|
491 (list-block-of-chars translate-method |
06e0fbd07e17
Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents:
42362
diff
changeset
|
492 0 (car range) (car (last range))) |
06e0fbd07e17
Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents:
42362
diff
changeset
|
493 (while range |
06e0fbd07e17
Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents:
42362
diff
changeset
|
494 (list-block-of-chars translate-method |
06e0fbd07e17
Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents:
42362
diff
changeset
|
495 0 (car range) (nth 1 range)) |
06e0fbd07e17
Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents:
42362
diff
changeset
|
496 (setq range (nthcdr 2 range)))) |
27912
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
497 ;; The form of RANGES is ((FROM1-1 TO1-1 ...) . (FROM2-1 TO2-1 ...)). |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
498 (let ((row-range (car range)) |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
499 row row-max |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
500 col-range col col-max) |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
501 (while row-range |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
502 (setq row (car row-range) row-max (nth 1 row-range) |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
503 row-range (nthcdr 2 row-range)) |
33837
ee31f4f9b014
(list-iso-charset-chars): For two-byte charset, fix the `while' condition.
Kenichi Handa <handa@m17n.org>
parents:
31246
diff
changeset
|
504 (while (<= row row-max) |
27912
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
505 (setq col-range (cdr range)) |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
506 (while col-range |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
507 (setq col (car col-range) col-max (nth 1 col-range) |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
508 col-range (nthcdr 2 col-range)) |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
509 (list-block-of-chars translate-method row col col-max)) |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
510 (setq row (1+ row))))))))) |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
511 |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
512 |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
513 ;;;###autoload |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
514 (defun list-charset-chars (charset) |
43231
06e0fbd07e17
Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents:
42362
diff
changeset
|
515 "Display a list of characters in the specified character set. |
06e0fbd07e17
Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents:
42362
diff
changeset
|
516 This can list both Emacs `official' (ISO standard) charsets and the |
06e0fbd07e17
Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents:
42362
diff
changeset
|
517 characters encoded by various Emacs coding systems which correspond to |
06e0fbd07e17
Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents:
42362
diff
changeset
|
518 PC `codepages' and other coded character sets. See `non-iso-charset-alist'." |
27912
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
519 (interactive (list (read-charset "Character set: "))) |
47603
28c9630ee23e
(list-character-sets): Use the buffer
Kenichi Handa <handa@m17n.org>
parents:
47548
diff
changeset
|
520 (with-output-to-temp-buffer "*Character List*" |
27912
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
521 (with-current-buffer standard-output |
47603
28c9630ee23e
(list-character-sets): Use the buffer
Kenichi Handa <handa@m17n.org>
parents:
47548
diff
changeset
|
522 (setq mode-line-format (copy-sequence mode-line-format)) |
28c9630ee23e
(list-character-sets): Use the buffer
Kenichi Handa <handa@m17n.org>
parents:
47548
diff
changeset
|
523 (let ((slot (memq 'mode-line-buffer-identification mode-line-format))) |
28c9630ee23e
(list-character-sets): Use the buffer
Kenichi Handa <handa@m17n.org>
parents:
47548
diff
changeset
|
524 (if slot |
28c9630ee23e
(list-character-sets): Use the buffer
Kenichi Handa <handa@m17n.org>
parents:
47548
diff
changeset
|
525 (setcdr slot |
28c9630ee23e
(list-character-sets): Use the buffer
Kenichi Handa <handa@m17n.org>
parents:
47548
diff
changeset
|
526 (cons (format " (%s)" charset) |
28c9630ee23e
(list-character-sets): Use the buffer
Kenichi Handa <handa@m17n.org>
parents:
47548
diff
changeset
|
527 (cdr slot))))) |
43231
06e0fbd07e17
Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents:
42362
diff
changeset
|
528 (setq indent-tabs-mode nil) |
27912
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
529 (set-buffer-multibyte t) |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
530 (cond ((charsetp charset) |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
531 (list-iso-charset-chars charset)) |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
532 ((assq charset non-iso-charset-alist) |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
533 (list-non-iso-charset-chars charset)) |
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
534 (t |
43231
06e0fbd07e17
Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents:
42362
diff
changeset
|
535 (error "Invalid character set %s" charset)))))) |
27912
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
536 |
28899
133a92b8094d
(syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents:
28216
diff
changeset
|
537 |
133a92b8094d
(syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents:
28216
diff
changeset
|
538 ;;;###autoload |
31246
d8ce7bce2aab
(charset-multibyte-form-string): New function.
Kenichi Handa <handa@m17n.org>
parents:
30765
diff
changeset
|
539 (defun describe-character-set (charset) |
43231
06e0fbd07e17
Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents:
42362
diff
changeset
|
540 "Display information about built-in character set CHARSET." |
31246
d8ce7bce2aab
(charset-multibyte-form-string): New function.
Kenichi Handa <handa@m17n.org>
parents:
30765
diff
changeset
|
541 (interactive (list (let ((non-iso-charset-alist nil)) |
d8ce7bce2aab
(charset-multibyte-form-string): New function.
Kenichi Handa <handa@m17n.org>
parents:
30765
diff
changeset
|
542 (read-charset "Charset: ")))) |
d8ce7bce2aab
(charset-multibyte-form-string): New function.
Kenichi Handa <handa@m17n.org>
parents:
30765
diff
changeset
|
543 (or (charsetp charset) |
d8ce7bce2aab
(charset-multibyte-form-string): New function.
Kenichi Handa <handa@m17n.org>
parents:
30765
diff
changeset
|
544 (error "Invalid charset: %S" charset)) |
d8ce7bce2aab
(charset-multibyte-form-string): New function.
Kenichi Handa <handa@m17n.org>
parents:
30765
diff
changeset
|
545 (let ((info (charset-info charset))) |
40664
4e5f8e42b8d1
(list-character-sets, sort-listed-character-sets, describe-character-set)
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
40639
diff
changeset
|
546 (help-setup-xref (list #'describe-character-set charset) (interactive-p)) |
4e5f8e42b8d1
(list-character-sets, sort-listed-character-sets, describe-character-set)
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
40639
diff
changeset
|
547 (with-output-to-temp-buffer (help-buffer) |
4e5f8e42b8d1
(list-character-sets, sort-listed-character-sets, describe-character-set)
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
40639
diff
changeset
|
548 (with-current-buffer standard-output |
31246
d8ce7bce2aab
(charset-multibyte-form-string): New function.
Kenichi Handa <handa@m17n.org>
parents:
30765
diff
changeset
|
549 (insert "Character set: " (symbol-name charset) |
d8ce7bce2aab
(charset-multibyte-form-string): New function.
Kenichi Handa <handa@m17n.org>
parents:
30765
diff
changeset
|
550 (format " (ID:%d)\n\n" (aref info 0))) |
d8ce7bce2aab
(charset-multibyte-form-string): New function.
Kenichi Handa <handa@m17n.org>
parents:
30765
diff
changeset
|
551 (insert (aref info 13) "\n\n") ; description |
43231
06e0fbd07e17
Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents:
42362
diff
changeset
|
552 (insert "Number of contained characters: " |
31246
d8ce7bce2aab
(charset-multibyte-form-string): New function.
Kenichi Handa <handa@m17n.org>
parents:
30765
diff
changeset
|
553 (if (= (aref info 2) 1) |
d8ce7bce2aab
(charset-multibyte-form-string): New function.
Kenichi Handa <handa@m17n.org>
parents:
30765
diff
changeset
|
554 (format "%d\n" (aref info 3)) |
d8ce7bce2aab
(charset-multibyte-form-string): New function.
Kenichi Handa <handa@m17n.org>
parents:
30765
diff
changeset
|
555 (format "%dx%d\n" (aref info 3) (aref info 3)))) |
43231
06e0fbd07e17
Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents:
42362
diff
changeset
|
556 (insert "Final char of ISO2022 designation sequence: ") |
35747
e154e666c9ed
(describe-character-set): Pay attention to charsets that don't have
Kenichi Handa <handa@m17n.org>
parents:
35585
diff
changeset
|
557 (if (>= (aref info 8) 0) |
31246
d8ce7bce2aab
(charset-multibyte-form-string): New function.
Kenichi Handa <handa@m17n.org>
parents:
30765
diff
changeset
|
558 (insert (format "`%c'\n" (aref info 8))) |
d8ce7bce2aab
(charset-multibyte-form-string): New function.
Kenichi Handa <handa@m17n.org>
parents:
30765
diff
changeset
|
559 (insert "not assigned\n")) |
43231
06e0fbd07e17
Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents:
42362
diff
changeset
|
560 (insert (format "Width (how many columns on screen): %d\n" |
31246
d8ce7bce2aab
(charset-multibyte-form-string): New function.
Kenichi Handa <handa@m17n.org>
parents:
30765
diff
changeset
|
561 (aref info 4))) |
43231
06e0fbd07e17
Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents:
42362
diff
changeset
|
562 (insert (format "Internal multibyte sequence: %s\n" |
31246
d8ce7bce2aab
(charset-multibyte-form-string): New function.
Kenichi Handa <handa@m17n.org>
parents:
30765
diff
changeset
|
563 (charset-multibyte-form-string charset))) |
d8ce7bce2aab
(charset-multibyte-form-string): New function.
Kenichi Handa <handa@m17n.org>
parents:
30765
diff
changeset
|
564 (let ((coding (plist-get (aref info 14) 'preferred-coding-system))) |
d8ce7bce2aab
(charset-multibyte-form-string): New function.
Kenichi Handa <handa@m17n.org>
parents:
30765
diff
changeset
|
565 (when coding |
43231
06e0fbd07e17
Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents:
42362
diff
changeset
|
566 (insert (format "Preferred coding system: %s\n" coding)) |
31246
d8ce7bce2aab
(charset-multibyte-form-string): New function.
Kenichi Handa <handa@m17n.org>
parents:
30765
diff
changeset
|
567 (search-backward (symbol-name coding)) |
42163
126eaf6fdbcf
(describe-character-set): Fix the arg to help-xref-button.
Richard M. Stallman <rms@gnu.org>
parents:
41586
diff
changeset
|
568 (help-xref-button 0 'help-coding-system coding))))))) |
17052 | 569 |
570 ;;; CODING-SYSTEM | |
571 | |
572 ;; Print information of designation of each graphic register in FLAGS | |
573 ;; in human readable format. See the documentation of | |
574 ;; `make-coding-system' for the meaning of FLAGS. | |
575 (defun print-designation (flags) | |
576 (let ((graphic-register 0) | |
577 charset) | |
578 (while (< graphic-register 4) | |
579 (setq charset (aref flags graphic-register)) | |
580 (princ (format | |
581 " G%d -- %s\n" | |
582 graphic-register | |
583 (cond ((null charset) | |
584 "never used") | |
585 ((eq charset t) | |
586 "no initial designation, and used by any charsets") | |
587 ((symbolp charset) | |
588 (format "%s:%s" | |
589 charset (charset-description charset))) | |
590 ((listp charset) | |
591 (if (charsetp (car charset)) | |
592 (format "%s:%s, and also used by the followings:" | |
593 (car charset) | |
594 (charset-description (car charset))) | |
595 "no initial designation, and used by the followings:")) | |
596 (t | |
597 "invalid designation information")))) | |
18559
20369fbd0f91
(print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents:
18377
diff
changeset
|
598 (when (listp charset) |
20369fbd0f91
(print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents:
18377
diff
changeset
|
599 (setq charset (cdr charset)) |
20369fbd0f91
(print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents:
18377
diff
changeset
|
600 (while charset |
20369fbd0f91
(print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents:
18377
diff
changeset
|
601 (cond ((eq (car charset) t) |
20369fbd0f91
(print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents:
18377
diff
changeset
|
602 (princ "\tany other charsets\n")) |
20369fbd0f91
(print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents:
18377
diff
changeset
|
603 ((charsetp (car charset)) |
20369fbd0f91
(print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents:
18377
diff
changeset
|
604 (princ (format "\t%s:%s\n" |
20369fbd0f91
(print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents:
18377
diff
changeset
|
605 (car charset) |
20369fbd0f91
(print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents:
18377
diff
changeset
|
606 (charset-description (car charset))))) |
20369fbd0f91
(print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents:
18377
diff
changeset
|
607 (t |
30765
1e5a486b8b25
punctuation fixes in doc strings
Sam Steingold <sds@gnu.org>
parents:
30126
diff
changeset
|
608 "invalid designation information")) |
18559
20369fbd0f91
(print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents:
18377
diff
changeset
|
609 (setq charset (cdr charset)))) |
17052 | 610 (setq graphic-register (1+ graphic-register))))) |
611 | |
612 ;;;###autoload | |
613 (defun describe-coding-system (coding-system) | |
22306 | 614 "Display information about CODING-SYSTEM." |
18300
0436624abece
(list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents:
18199
diff
changeset
|
615 (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
|
616 (if (null coding-system) |
0436624abece
(list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents:
18199
diff
changeset
|
617 (describe-current-coding-system) |
40664
4e5f8e42b8d1
(list-character-sets, sort-listed-character-sets, describe-character-set)
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
40639
diff
changeset
|
618 (help-setup-xref (list #'describe-coding-system coding-system) |
4e5f8e42b8d1
(list-character-sets, sort-listed-character-sets, describe-character-set)
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
40639
diff
changeset
|
619 (interactive-p)) |
4e5f8e42b8d1
(list-character-sets, sort-listed-character-sets, describe-character-set)
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
40639
diff
changeset
|
620 (with-output-to-temp-buffer (help-buffer) |
18300
0436624abece
(list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents:
18199
diff
changeset
|
621 (print-coding-system-briefly coding-system 'doc-string) |
42209
2c4fb0cccd48
(describe-coding-system, print-coding-system-briefly): Make printed output have a similar
Werner LEMBERG <wl@gnu.org>
parents:
42163
diff
changeset
|
622 (princ "\n") |
47709
1fcba19c7ae3
(describe-coding-system): Describe `dependency' property..
Kenichi Handa <handa@m17n.org>
parents:
47605
diff
changeset
|
623 (let ((vars (coding-system-get coding-system 'dependency))) |
1fcba19c7ae3
(describe-coding-system): Describe `dependency' property..
Kenichi Handa <handa@m17n.org>
parents:
47605
diff
changeset
|
624 (when vars |
1fcba19c7ae3
(describe-coding-system): Describe `dependency' property..
Kenichi Handa <handa@m17n.org>
parents:
47605
diff
changeset
|
625 (princ "See also the documentation of these customizable variables |
1fcba19c7ae3
(describe-coding-system): Describe `dependency' property..
Kenichi Handa <handa@m17n.org>
parents:
47605
diff
changeset
|
626 which alter the behaviour of this coding system.\n") |
1fcba19c7ae3
(describe-coding-system): Describe `dependency' property..
Kenichi Handa <handa@m17n.org>
parents:
47605
diff
changeset
|
627 (dolist (v vars) |
1fcba19c7ae3
(describe-coding-system): Describe `dependency' property..
Kenichi Handa <handa@m17n.org>
parents:
47605
diff
changeset
|
628 (princ " `") |
1fcba19c7ae3
(describe-coding-system): Describe `dependency' property..
Kenichi Handa <handa@m17n.org>
parents:
47605
diff
changeset
|
629 (princ v) |
1fcba19c7ae3
(describe-coding-system): Describe `dependency' property..
Kenichi Handa <handa@m17n.org>
parents:
47605
diff
changeset
|
630 (princ "'\n")) |
1fcba19c7ae3
(describe-coding-system): Describe `dependency' property..
Kenichi Handa <handa@m17n.org>
parents:
47605
diff
changeset
|
631 (princ "\n"))) |
1fcba19c7ae3
(describe-coding-system): Describe `dependency' property..
Kenichi Handa <handa@m17n.org>
parents:
47605
diff
changeset
|
632 |
47548
698b4a4bb562
(describe-coding-system): Remove unused `coding-spec' variable.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
46490
diff
changeset
|
633 (princ "Type: ") |
698b4a4bb562
(describe-coding-system): Remove unused `coding-spec' variable.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
46490
diff
changeset
|
634 (let ((type (coding-system-type coding-system)) |
698b4a4bb562
(describe-coding-system): Remove unused `coding-spec' variable.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
46490
diff
changeset
|
635 (flags (coding-system-flags coding-system))) |
698b4a4bb562
(describe-coding-system): Remove unused `coding-spec' variable.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
46490
diff
changeset
|
636 (princ type) |
698b4a4bb562
(describe-coding-system): Remove unused `coding-spec' variable.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
46490
diff
changeset
|
637 (cond ((eq type nil) |
698b4a4bb562
(describe-coding-system): Remove unused `coding-spec' variable.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
46490
diff
changeset
|
638 (princ " (do no conversion)")) |
698b4a4bb562
(describe-coding-system): Remove unused `coding-spec' variable.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
46490
diff
changeset
|
639 ((eq type t) |
698b4a4bb562
(describe-coding-system): Remove unused `coding-spec' variable.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
46490
diff
changeset
|
640 (princ " (do automatic conversion)")) |
698b4a4bb562
(describe-coding-system): Remove unused `coding-spec' variable.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
46490
diff
changeset
|
641 ((eq type 0) |
698b4a4bb562
(describe-coding-system): Remove unused `coding-spec' variable.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
46490
diff
changeset
|
642 (princ " (Emacs internal multibyte form)")) |
698b4a4bb562
(describe-coding-system): Remove unused `coding-spec' variable.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
46490
diff
changeset
|
643 ((eq type 1) |
698b4a4bb562
(describe-coding-system): Remove unused `coding-spec' variable.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
46490
diff
changeset
|
644 (princ " (Shift-JIS, MS-KANJI)")) |
698b4a4bb562
(describe-coding-system): Remove unused `coding-spec' variable.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
46490
diff
changeset
|
645 ((eq type 2) |
698b4a4bb562
(describe-coding-system): Remove unused `coding-spec' variable.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
46490
diff
changeset
|
646 (princ " (variant of ISO-2022)\n") |
698b4a4bb562
(describe-coding-system): Remove unused `coding-spec' variable.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
46490
diff
changeset
|
647 (princ "Initial designations:\n") |
698b4a4bb562
(describe-coding-system): Remove unused `coding-spec' variable.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
46490
diff
changeset
|
648 (print-designation flags) |
698b4a4bb562
(describe-coding-system): Remove unused `coding-spec' variable.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
46490
diff
changeset
|
649 (princ "Other Form: \n ") |
698b4a4bb562
(describe-coding-system): Remove unused `coding-spec' variable.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
46490
diff
changeset
|
650 (princ (if (aref flags 4) "short-form" "long-form")) |
698b4a4bb562
(describe-coding-system): Remove unused `coding-spec' variable.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
46490
diff
changeset
|
651 (if (aref flags 5) (princ ", ASCII@EOL")) |
698b4a4bb562
(describe-coding-system): Remove unused `coding-spec' variable.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
46490
diff
changeset
|
652 (if (aref flags 6) (princ ", ASCII@CNTL")) |
698b4a4bb562
(describe-coding-system): Remove unused `coding-spec' variable.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
46490
diff
changeset
|
653 (princ (if (aref flags 7) ", 7-bit" ", 8-bit")) |
698b4a4bb562
(describe-coding-system): Remove unused `coding-spec' variable.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
46490
diff
changeset
|
654 (if (aref flags 8) (princ ", use-locking-shift")) |
698b4a4bb562
(describe-coding-system): Remove unused `coding-spec' variable.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
46490
diff
changeset
|
655 (if (aref flags 9) (princ ", use-single-shift")) |
698b4a4bb562
(describe-coding-system): Remove unused `coding-spec' variable.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
46490
diff
changeset
|
656 (if (aref flags 10) (princ ", use-roman")) |
698b4a4bb562
(describe-coding-system): Remove unused `coding-spec' variable.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
46490
diff
changeset
|
657 (if (aref flags 11) (princ ", use-old-jis")) |
698b4a4bb562
(describe-coding-system): Remove unused `coding-spec' variable.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
46490
diff
changeset
|
658 (if (aref flags 12) (princ ", no-ISO6429")) |
698b4a4bb562
(describe-coding-system): Remove unused `coding-spec' variable.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
46490
diff
changeset
|
659 (if (aref flags 13) (princ ", init-bol")) |
698b4a4bb562
(describe-coding-system): Remove unused `coding-spec' variable.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
46490
diff
changeset
|
660 (if (aref flags 14) (princ ", designation-bol")) |
698b4a4bb562
(describe-coding-system): Remove unused `coding-spec' variable.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
46490
diff
changeset
|
661 (if (aref flags 15) (princ ", convert-unsafe")) |
698b4a4bb562
(describe-coding-system): Remove unused `coding-spec' variable.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
46490
diff
changeset
|
662 (if (aref flags 16) (princ ", accept-latin-extra-code")) |
698b4a4bb562
(describe-coding-system): Remove unused `coding-spec' variable.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
46490
diff
changeset
|
663 (princ ".")) |
698b4a4bb562
(describe-coding-system): Remove unused `coding-spec' variable.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
46490
diff
changeset
|
664 ((eq type 3) |
698b4a4bb562
(describe-coding-system): Remove unused `coding-spec' variable.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
46490
diff
changeset
|
665 (princ " (Big5)")) |
698b4a4bb562
(describe-coding-system): Remove unused `coding-spec' variable.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
46490
diff
changeset
|
666 ((eq type 4) |
698b4a4bb562
(describe-coding-system): Remove unused `coding-spec' variable.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
46490
diff
changeset
|
667 (princ " (do conversion by CCL program)")) |
698b4a4bb562
(describe-coding-system): Remove unused `coding-spec' variable.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
46490
diff
changeset
|
668 ((eq type 5) |
698b4a4bb562
(describe-coding-system): Remove unused `coding-spec' variable.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
46490
diff
changeset
|
669 (princ " (text with random binary characters)")) |
698b4a4bb562
(describe-coding-system): Remove unused `coding-spec' variable.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
46490
diff
changeset
|
670 (t (princ ": invalid coding-system.")))) |
698b4a4bb562
(describe-coding-system): Remove unused `coding-spec' variable.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
46490
diff
changeset
|
671 (princ "\nEOL type: ") |
698b4a4bb562
(describe-coding-system): Remove unused `coding-spec' variable.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
46490
diff
changeset
|
672 (let ((eol-type (coding-system-eol-type coding-system))) |
698b4a4bb562
(describe-coding-system): Remove unused `coding-spec' variable.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
46490
diff
changeset
|
673 (cond ((vectorp eol-type) |
698b4a4bb562
(describe-coding-system): Remove unused `coding-spec' variable.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
46490
diff
changeset
|
674 (princ "Automatic selection from:\n\t") |
698b4a4bb562
(describe-coding-system): Remove unused `coding-spec' variable.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
46490
diff
changeset
|
675 (princ eol-type) |
698b4a4bb562
(describe-coding-system): Remove unused `coding-spec' variable.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
46490
diff
changeset
|
676 (princ "\n")) |
698b4a4bb562
(describe-coding-system): Remove unused `coding-spec' variable.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
46490
diff
changeset
|
677 ((or (null eol-type) (eq eol-type 0)) (princ "LF\n")) |
698b4a4bb562
(describe-coding-system): Remove unused `coding-spec' variable.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
46490
diff
changeset
|
678 ((eq eol-type 1) (princ "CRLF\n")) |
698b4a4bb562
(describe-coding-system): Remove unused `coding-spec' variable.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
46490
diff
changeset
|
679 ((eq eol-type 2) (princ "CR\n")) |
698b4a4bb562
(describe-coding-system): Remove unused `coding-spec' variable.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
46490
diff
changeset
|
680 (t (princ "invalid\n")))) |
20114
cbf191888430
(describe-coding-system): Print
Kenichi Handa <handa@m17n.org>
parents:
20092
diff
changeset
|
681 (let ((postread (coding-system-get coding-system 'post-read-conversion))) |
cbf191888430
(describe-coding-system): Print
Kenichi Handa <handa@m17n.org>
parents:
20092
diff
changeset
|
682 (when postread |
35585 | 683 (princ "After decoding text normally,") |
684 (princ " perform post-conversion using the function: ") | |
20114
cbf191888430
(describe-coding-system): Print
Kenichi Handa <handa@m17n.org>
parents:
20092
diff
changeset
|
685 (princ "\n ") |
cbf191888430
(describe-coding-system): Print
Kenichi Handa <handa@m17n.org>
parents:
20092
diff
changeset
|
686 (princ postread) |
cbf191888430
(describe-coding-system): Print
Kenichi Handa <handa@m17n.org>
parents:
20092
diff
changeset
|
687 (princ "\n"))) |
cbf191888430
(describe-coding-system): Print
Kenichi Handa <handa@m17n.org>
parents:
20092
diff
changeset
|
688 (let ((prewrite (coding-system-get coding-system 'pre-write-conversion))) |
cbf191888430
(describe-coding-system): Print
Kenichi Handa <handa@m17n.org>
parents:
20092
diff
changeset
|
689 (when prewrite |
35585 | 690 (princ "Before encoding text normally,") |
691 (princ " perform pre-conversion using the function: ") | |
20114
cbf191888430
(describe-coding-system): Print
Kenichi Handa <handa@m17n.org>
parents:
20092
diff
changeset
|
692 (princ "\n ") |
cbf191888430
(describe-coding-system): Print
Kenichi Handa <handa@m17n.org>
parents:
20092
diff
changeset
|
693 (princ prewrite) |
cbf191888430
(describe-coding-system): Print
Kenichi Handa <handa@m17n.org>
parents:
20092
diff
changeset
|
694 (princ "\n"))) |
40664
4e5f8e42b8d1
(list-character-sets, sort-listed-character-sets, describe-character-set)
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
40639
diff
changeset
|
695 (with-current-buffer standard-output |
31246
d8ce7bce2aab
(charset-multibyte-form-string): New function.
Kenichi Handa <handa@m17n.org>
parents:
30765
diff
changeset
|
696 (let ((charsets (coding-system-get coding-system 'safe-charsets))) |
36989
ce090eb0edda
(describe-coding-system): For raw-text and emacs-mule, don't add
Kenichi Handa <handa@m17n.org>
parents:
35747
diff
changeset
|
697 (when (and (not (memq (coding-system-base coding-system) |
ce090eb0edda
(describe-coding-system): For raw-text and emacs-mule, don't add
Kenichi Handa <handa@m17n.org>
parents:
35747
diff
changeset
|
698 '(raw-text emacs-mule))) |
ce090eb0edda
(describe-coding-system): For raw-text and emacs-mule, don't add
Kenichi Handa <handa@m17n.org>
parents:
35747
diff
changeset
|
699 charsets) |
31246
d8ce7bce2aab
(charset-multibyte-form-string): New function.
Kenichi Handa <handa@m17n.org>
parents:
30765
diff
changeset
|
700 (if (eq charsets t) |
36989
ce090eb0edda
(describe-coding-system): For raw-text and emacs-mule, don't add
Kenichi Handa <handa@m17n.org>
parents:
35747
diff
changeset
|
701 (insert "This coding system can encode all charsets except for |
ce090eb0edda
(describe-coding-system): For raw-text and emacs-mule, don't add
Kenichi Handa <handa@m17n.org>
parents:
35747
diff
changeset
|
702 eight-bit-control and eight-bit-graphic.\n") |
35585 | 703 (insert "This coding system encodes the following charsets:\n ") |
31246
d8ce7bce2aab
(charset-multibyte-form-string): New function.
Kenichi Handa <handa@m17n.org>
parents:
30765
diff
changeset
|
704 (while charsets |
d8ce7bce2aab
(charset-multibyte-form-string): New function.
Kenichi Handa <handa@m17n.org>
parents:
30765
diff
changeset
|
705 (insert " " (symbol-name (car charsets))) |
d8ce7bce2aab
(charset-multibyte-form-string): New function.
Kenichi Handa <handa@m17n.org>
parents:
30765
diff
changeset
|
706 (search-backward (symbol-name (car charsets))) |
40639 | 707 (help-xref-button 0 'help-character-set (car charsets)) |
31246
d8ce7bce2aab
(charset-multibyte-form-string): New function.
Kenichi Handa <handa@m17n.org>
parents:
30765
diff
changeset
|
708 (goto-char (point-max)) |
40664
4e5f8e42b8d1
(list-character-sets, sort-listed-character-sets, describe-character-set)
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
40639
diff
changeset
|
709 (setq charsets (cdr charsets)))))))))) |
31246
d8ce7bce2aab
(charset-multibyte-form-string): New function.
Kenichi Handa <handa@m17n.org>
parents:
30765
diff
changeset
|
710 |
17052 | 711 |
712 ;;;###autoload | |
713 (defun describe-current-coding-system-briefly () | |
18199
15177bdb2fcf
(describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents:
17315
diff
changeset
|
714 "Display coding systems currently used in a brief format in echo area. |
17052 | 715 |
18199
15177bdb2fcf
(describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents:
17315
diff
changeset
|
716 The format is \"F[..],K[..],T[..],P>[..],P<[..], default F[..],P<[..],P<[..]\", |
17052 | 717 where mnemonics of the following coding systems come in this order |
43231
06e0fbd07e17
Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents:
42362
diff
changeset
|
718 in place of `..': |
30765
1e5a486b8b25
punctuation fixes in doc strings
Sam Steingold <sds@gnu.org>
parents:
30126
diff
changeset
|
719 `buffer-file-coding-system' (of the current buffer) |
1e5a486b8b25
punctuation fixes in doc strings
Sam Steingold <sds@gnu.org>
parents:
30126
diff
changeset
|
720 eol-type of `buffer-file-coding-system' (of the current buffer) |
22306 | 721 Value returned by `keyboard-coding-system' |
30765
1e5a486b8b25
punctuation fixes in doc strings
Sam Steingold <sds@gnu.org>
parents:
30126
diff
changeset
|
722 eol-type of `keyboard-coding-system' |
1e5a486b8b25
punctuation fixes in doc strings
Sam Steingold <sds@gnu.org>
parents:
30126
diff
changeset
|
723 Value returned by `terminal-coding-system'. |
1e5a486b8b25
punctuation fixes in doc strings
Sam Steingold <sds@gnu.org>
parents:
30126
diff
changeset
|
724 eol-type of `terminal-coding-system' |
22306 | 725 `process-coding-system' for read (of the current buffer, if any) |
30765
1e5a486b8b25
punctuation fixes in doc strings
Sam Steingold <sds@gnu.org>
parents:
30126
diff
changeset
|
726 eol-type of `process-coding-system' for read (of the current buffer, if any) |
22306 | 727 `process-coding-system' for write (of the current buffer, if any) |
30765
1e5a486b8b25
punctuation fixes in doc strings
Sam Steingold <sds@gnu.org>
parents:
30126
diff
changeset
|
728 eol-type of `process-coding-system' for write (of the current buffer, if any) |
22306 | 729 `default-buffer-file-coding-system' |
30765
1e5a486b8b25
punctuation fixes in doc strings
Sam Steingold <sds@gnu.org>
parents:
30126
diff
changeset
|
730 eol-type of `default-buffer-file-coding-system' |
22306 | 731 `default-process-coding-system' for read |
30765
1e5a486b8b25
punctuation fixes in doc strings
Sam Steingold <sds@gnu.org>
parents:
30126
diff
changeset
|
732 eol-type of `default-process-coding-system' for read |
22306 | 733 `default-process-coding-system' for write |
30765
1e5a486b8b25
punctuation fixes in doc strings
Sam Steingold <sds@gnu.org>
parents:
30126
diff
changeset
|
734 eol-type of `default-process-coding-system'" |
17052 | 735 (interactive) |
736 (let* ((proc (get-buffer-process (current-buffer))) | |
737 (process-coding-systems (if proc (process-coding-system proc)))) | |
738 (message | |
24865
a4b8bb7bed21
(describe-current-coding-system-briefly): Fix format string.
Kenichi Handa <handa@m17n.org>
parents:
24724
diff
changeset
|
739 "F[%c%s],K[%c%s],T[%c%s],P>[%c%s],P<[%c%s], default F[%c%s],P>[%c%s],P<[%c%s]" |
17052 | 740 (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
|
741 (coding-system-eol-type-mnemonic buffer-file-coding-system) |
17052 | 742 (coding-system-mnemonic (keyboard-coding-system)) |
18199
15177bdb2fcf
(describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents:
17315
diff
changeset
|
743 (coding-system-eol-type-mnemonic (keyboard-coding-system)) |
17052 | 744 (coding-system-mnemonic (terminal-coding-system)) |
18199
15177bdb2fcf
(describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents:
17315
diff
changeset
|
745 (coding-system-eol-type-mnemonic (terminal-coding-system)) |
17052 | 746 (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
|
747 (coding-system-eol-type-mnemonic (car process-coding-systems)) |
17052 | 748 (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
|
749 (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
|
750 (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
|
751 (coding-system-eol-type-mnemonic default-buffer-file-coding-system) |
17052 | 752 (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
|
753 (coding-system-eol-type-mnemonic (car default-process-coding-system)) |
17052 | 754 (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
|
755 (coding-system-eol-type-mnemonic (cdr default-process-coding-system)) |
17052 | 756 ))) |
757 | |
22306 | 758 ;; Print symbol name and mnemonic letter of CODING-SYSTEM with `princ'. |
18300
0436624abece
(list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents:
18199
diff
changeset
|
759 (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
|
760 (if (not coding-system) |
15177bdb2fcf
(describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents:
17315
diff
changeset
|
761 (princ "nil\n") |
15177bdb2fcf
(describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents:
17315
diff
changeset
|
762 (princ (format "%c -- %s" |
15177bdb2fcf
(describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents:
17315
diff
changeset
|
763 (coding-system-mnemonic coding-system) |
15177bdb2fcf
(describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents:
17315
diff
changeset
|
764 coding-system)) |
20114
cbf191888430
(describe-coding-system): Print
Kenichi Handa <handa@m17n.org>
parents:
20092
diff
changeset
|
765 (let ((aliases (coding-system-get coding-system 'alias-coding-systems))) |
46490
e541dfaa4964
(print-coding-system-briefly): Fix the handling of an alias of which
Kenichi Handa <handa@m17n.org>
parents:
45909
diff
changeset
|
766 (cond ((eq coding-system (car aliases)) |
e541dfaa4964
(print-coding-system-briefly): Fix the handling of an alias of which
Kenichi Handa <handa@m17n.org>
parents:
45909
diff
changeset
|
767 (if (cdr aliases) |
e541dfaa4964
(print-coding-system-briefly): Fix the handling of an alias of which
Kenichi Handa <handa@m17n.org>
parents:
45909
diff
changeset
|
768 (princ (format " %S" (cons 'alias: (cdr aliases)))))) |
e541dfaa4964
(print-coding-system-briefly): Fix the handling of an alias of which
Kenichi Handa <handa@m17n.org>
parents:
45909
diff
changeset
|
769 ((memq coding-system aliases) |
e541dfaa4964
(print-coding-system-briefly): Fix the handling of an alias of which
Kenichi Handa <handa@m17n.org>
parents:
45909
diff
changeset
|
770 (princ (format " (alias of %s)" (car aliases)))) |
e541dfaa4964
(print-coding-system-briefly): Fix the handling of an alias of which
Kenichi Handa <handa@m17n.org>
parents:
45909
diff
changeset
|
771 (t |
e541dfaa4964
(print-coding-system-briefly): Fix the handling of an alias of which
Kenichi Handa <handa@m17n.org>
parents:
45909
diff
changeset
|
772 (let ((eol-type (coding-system-eol-type coding-system)) |
e541dfaa4964
(print-coding-system-briefly): Fix the handling of an alias of which
Kenichi Handa <handa@m17n.org>
parents:
45909
diff
changeset
|
773 (base-eol-type (coding-system-eol-type (car aliases)))) |
e541dfaa4964
(print-coding-system-briefly): Fix the handling of an alias of which
Kenichi Handa <handa@m17n.org>
parents:
45909
diff
changeset
|
774 (if (and (integerp eol-type) |
e541dfaa4964
(print-coding-system-briefly): Fix the handling of an alias of which
Kenichi Handa <handa@m17n.org>
parents:
45909
diff
changeset
|
775 (vectorp base-eol-type) |
e541dfaa4964
(print-coding-system-briefly): Fix the handling of an alias of which
Kenichi Handa <handa@m17n.org>
parents:
45909
diff
changeset
|
776 (not (eq coding-system (aref base-eol-type eol-type)))) |
e541dfaa4964
(print-coding-system-briefly): Fix the handling of an alias of which
Kenichi Handa <handa@m17n.org>
parents:
45909
diff
changeset
|
777 (princ (format " (alias of %s)" |
e541dfaa4964
(print-coding-system-briefly): Fix the handling of an alias of which
Kenichi Handa <handa@m17n.org>
parents:
45909
diff
changeset
|
778 (aref base-eol-type eol-type)))))))) |
42209
2c4fb0cccd48
(describe-coding-system, print-coding-system-briefly): Make printed output have a similar
Werner LEMBERG <wl@gnu.org>
parents:
42163
diff
changeset
|
779 (princ "\n\n") |
18199
15177bdb2fcf
(describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents:
17315
diff
changeset
|
780 (if (and doc-string |
15177bdb2fcf
(describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents:
17315
diff
changeset
|
781 (setq doc-string (coding-system-doc-string coding-system))) |
42209
2c4fb0cccd48
(describe-coding-system, print-coding-system-briefly): Make printed output have a similar
Werner LEMBERG <wl@gnu.org>
parents:
42163
diff
changeset
|
782 (princ (format "%s\n" doc-string))))) |
17052 | 783 |
784 ;;;###autoload | |
785 (defun describe-current-coding-system () | |
22306 | 786 "Display coding systems currently used, in detail." |
17052 | 787 (interactive) |
788 (with-output-to-temp-buffer "*Help*" | |
789 (let* ((proc (get-buffer-process (current-buffer))) | |
790 (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
|
791 (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
|
792 (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
|
793 (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
|
794 (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
|
795 (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
|
796 (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
|
797 (princ "Coding system for keyboard input:\n ") |
17052 | 798 (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
|
799 (princ "Coding system for terminal output:\n ") |
17052 | 800 (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
|
801 (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
|
802 (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
|
803 (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
|
804 (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
|
805 (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
|
806 (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
|
807 (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
|
808 (princ " decoding: ") |
17052 | 809 (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
|
810 (princ " encoding: ") |
15177bdb2fcf
(describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents:
17315
diff
changeset
|
811 (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
|
812 |
40664
4e5f8e42b8d1
(list-character-sets, sort-listed-character-sets, describe-character-set)
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
40639
diff
changeset
|
813 (with-current-buffer standard-output |
18300
0436624abece
(list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents:
18199
diff
changeset
|
814 |
43231
06e0fbd07e17
Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents:
42362
diff
changeset
|
815 (princ " |
06e0fbd07e17
Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents:
42362
diff
changeset
|
816 Priority 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
|
817 (let ((l coding-category-list) |
0436624abece
(list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents:
18199
diff
changeset
|
818 (i 1) |
19265
6b31dac7f72b
(print-fontset): Don't hang even if a
Kenichi Handa <handa@m17n.org>
parents:
19081
diff
changeset
|
819 (coding-list nil) |
18300
0436624abece
(list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents:
18199
diff
changeset
|
820 coding aliases) |
0436624abece
(list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents:
18199
diff
changeset
|
821 (while l |
0436624abece
(list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents:
18199
diff
changeset
|
822 (setq coding (symbol-value (car l))) |
20114
cbf191888430
(describe-coding-system): Print
Kenichi Handa <handa@m17n.org>
parents:
20092
diff
changeset
|
823 ;; Do not list up the same coding system twice. |
22885
5effd15f2a18
(describe-current-coding-system):
Kenichi Handa <handa@m17n.org>
parents:
22339
diff
changeset
|
824 (when (and coding (not (memq coding coding-list))) |
19265
6b31dac7f72b
(print-fontset): Don't hang even if a
Kenichi Handa <handa@m17n.org>
parents:
19081
diff
changeset
|
825 (setq coding-list (cons coding coding-list)) |
20114
cbf191888430
(describe-coding-system): Print
Kenichi Handa <handa@m17n.org>
parents:
20092
diff
changeset
|
826 (princ (format " %d. %s " i coding)) |
cbf191888430
(describe-coding-system): Print
Kenichi Handa <handa@m17n.org>
parents:
20092
diff
changeset
|
827 (setq aliases (coding-system-get coding 'alias-coding-systems)) |
cbf191888430
(describe-coding-system): Print
Kenichi Handa <handa@m17n.org>
parents:
20092
diff
changeset
|
828 (if (eq coding (car aliases)) |
cbf191888430
(describe-coding-system): Print
Kenichi Handa <handa@m17n.org>
parents:
20092
diff
changeset
|
829 (if (cdr aliases) |
cbf191888430
(describe-coding-system): Print
Kenichi Handa <handa@m17n.org>
parents:
20092
diff
changeset
|
830 (princ (cons 'alias: (cdr aliases)))) |
cbf191888430
(describe-coding-system): Print
Kenichi Handa <handa@m17n.org>
parents:
20092
diff
changeset
|
831 (if (memq coding aliases) |
cbf191888430
(describe-coding-system): Print
Kenichi Handa <handa@m17n.org>
parents:
20092
diff
changeset
|
832 (princ (list 'alias 'of (car aliases))))) |
19265
6b31dac7f72b
(print-fontset): Don't hang even if a
Kenichi Handa <handa@m17n.org>
parents:
19081
diff
changeset
|
833 (terpri) |
6b31dac7f72b
(print-fontset): Don't hang even if a
Kenichi Handa <handa@m17n.org>
parents:
19081
diff
changeset
|
834 (setq i (1+ i))) |
6b31dac7f72b
(print-fontset): Don't hang even if a
Kenichi Handa <handa@m17n.org>
parents:
19081
diff
changeset
|
835 (setq l (cdr l)))) |
20114
cbf191888430
(describe-coding-system): Print
Kenichi Handa <handa@m17n.org>
parents:
20092
diff
changeset
|
836 |
18300
0436624abece
(list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents:
18199
diff
changeset
|
837 (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
|
838 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
|
839 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
|
840 |
18799
6c0d648d2cf8
(describe-current-coding-system): Use coding-category-iso-7-else
Kenichi Handa <handa@m17n.org>
parents:
18696
diff
changeset
|
841 (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
|
842 coding-system codings) |
0436624abece
(list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents:
18199
diff
changeset
|
843 (while categories |
0436624abece
(list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents:
18199
diff
changeset
|
844 (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
|
845 (mapcar |
47548
698b4a4bb562
(describe-coding-system): Remove unused `coding-spec' variable.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
46490
diff
changeset
|
846 (lambda (x) |
698b4a4bb562
(describe-coding-system): Remove unused `coding-spec' variable.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
46490
diff
changeset
|
847 (if (and (not (eq x coding-system)) |
698b4a4bb562
(describe-coding-system): Remove unused `coding-spec' variable.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
46490
diff
changeset
|
848 (coding-system-get x 'no-initial-designation) |
698b4a4bb562
(describe-coding-system): Remove unused `coding-spec' variable.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
46490
diff
changeset
|
849 (let ((flags (coding-system-flags x))) |
698b4a4bb562
(describe-coding-system): Remove unused `coding-spec' variable.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
46490
diff
changeset
|
850 (not (or (aref flags 10) (aref flags 11))))) |
698b4a4bb562
(describe-coding-system): Remove unused `coding-spec' variable.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
46490
diff
changeset
|
851 (setq codings (cons x codings)))) |
18300
0436624abece
(list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents:
18199
diff
changeset
|
852 (get (car categories) 'coding-systems)) |
0436624abece
(list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents:
18199
diff
changeset
|
853 (if codings |
0436624abece
(list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents:
18199
diff
changeset
|
854 (let ((max-col (frame-width)) |
0436624abece
(list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents:
18199
diff
changeset
|
855 pos) |
43231
06e0fbd07e17
Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents:
42362
diff
changeset
|
856 (princ (format "\ |
06e0fbd07e17
Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents:
42362
diff
changeset
|
857 The following are decoded correctly but recognized as %s:\n " |
06e0fbd07e17
Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents:
42362
diff
changeset
|
858 coding-system)) |
18300
0436624abece
(list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents:
18199
diff
changeset
|
859 (while codings |
0436624abece
(list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents:
18199
diff
changeset
|
860 (setq pos (point)) |
0436624abece
(list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents:
18199
diff
changeset
|
861 (insert (format " %s" (car codings))) |
18559
20369fbd0f91
(print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents:
18377
diff
changeset
|
862 (when (> (current-column) max-col) |
20369fbd0f91
(print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents:
18377
diff
changeset
|
863 (goto-char pos) |
20369fbd0f91
(print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents:
18377
diff
changeset
|
864 (insert "\n ") |
20369fbd0f91
(print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents:
18377
diff
changeset
|
865 (goto-char (point-max))) |
18300
0436624abece
(list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents:
18199
diff
changeset
|
866 (setq codings (cdr codings))) |
0436624abece
(list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents:
18199
diff
changeset
|
867 (insert "\n\n"))) |
0436624abece
(list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents:
18199
diff
changeset
|
868 (setq categories (cdr categories)))) |
0436624abece
(list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents:
18199
diff
changeset
|
869 |
19081
f33df9d64fe8
(describe-current-coding-system): Clean up output format.
Richard M. Stallman <rms@gnu.org>
parents:
18799
diff
changeset
|
870 (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
|
871 (terpri) |
0436624abece
(list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents:
18199
diff
changeset
|
872 (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
|
873 (princ " ---------\t--------------\t\t----------------\n") |
0436624abece
(list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents:
18199
diff
changeset
|
874 (let ((func (lambda (operation alist) |
0436624abece
(list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents:
18199
diff
changeset
|
875 (princ " ") |
0436624abece
(list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents:
18199
diff
changeset
|
876 (princ operation) |
0436624abece
(list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents:
18199
diff
changeset
|
877 (if (not alist) |
0436624abece
(list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents:
18199
diff
changeset
|
878 (princ "\tnothing specified\n") |
0436624abece
(list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents:
18199
diff
changeset
|
879 (while alist |
0436624abece
(list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents:
18199
diff
changeset
|
880 (indent-to 16) |
0436624abece
(list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents:
18199
diff
changeset
|
881 (prin1 (car (car alist))) |
20114
cbf191888430
(describe-coding-system): Print
Kenichi Handa <handa@m17n.org>
parents:
20092
diff
changeset
|
882 (if (>= (current-column) 40) |
cbf191888430
(describe-coding-system): Print
Kenichi Handa <handa@m17n.org>
parents:
20092
diff
changeset
|
883 (newline)) |
18300
0436624abece
(list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents:
18199
diff
changeset
|
884 (indent-to 40) |
0436624abece
(list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents:
18199
diff
changeset
|
885 (princ (cdr (car alist))) |
0436624abece
(list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents:
18199
diff
changeset
|
886 (princ "\n") |
0436624abece
(list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents:
18199
diff
changeset
|
887 (setq alist (cdr alist))))))) |
0436624abece
(list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents:
18199
diff
changeset
|
888 (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
|
889 (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
|
890 (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
|
891 (help-mode)))) |
17052 | 892 |
893 ;; Print detailed information on CODING-SYSTEM. | |
20114
cbf191888430
(describe-coding-system): Print
Kenichi Handa <handa@m17n.org>
parents:
20092
diff
changeset
|
894 (defun print-coding-system (coding-system) |
17052 | 895 (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
|
896 (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
|
897 (flags (coding-system-flags coding-system)) |
20114
cbf191888430
(describe-coding-system): Print
Kenichi Handa <handa@m17n.org>
parents:
20092
diff
changeset
|
898 (aliases (coding-system-get coding-system 'alias-coding-systems))) |
cbf191888430
(describe-coding-system): Print
Kenichi Handa <handa@m17n.org>
parents:
20092
diff
changeset
|
899 (if (not (eq (car aliases) coding-system)) |
cbf191888430
(describe-coding-system): Print
Kenichi Handa <handa@m17n.org>
parents:
20092
diff
changeset
|
900 (princ (format "%s (alias of %s)\n" coding-system (car aliases))) |
18199
15177bdb2fcf
(describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents:
17315
diff
changeset
|
901 (princ coding-system) |
20114
cbf191888430
(describe-coding-system): Print
Kenichi Handa <handa@m17n.org>
parents:
20092
diff
changeset
|
902 (setq aliases (cdr aliases)) |
18199
15177bdb2fcf
(describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents:
17315
diff
changeset
|
903 (while aliases |
18559
20369fbd0f91
(print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents:
18377
diff
changeset
|
904 (princ ",") |
20369fbd0f91
(print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents:
18377
diff
changeset
|
905 (princ (car aliases)) |
20369fbd0f91
(print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents:
18377
diff
changeset
|
906 (setq aliases (cdr aliases))) |
18199
15177bdb2fcf
(describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents:
17315
diff
changeset
|
907 (princ (format ":%s:%c:%d:" |
15177bdb2fcf
(describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents:
17315
diff
changeset
|
908 type |
15177bdb2fcf
(describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents:
17315
diff
changeset
|
909 (coding-system-mnemonic coding-system) |
15177bdb2fcf
(describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents:
17315
diff
changeset
|
910 (if (integerp eol-type) eol-type 3))) |
15177bdb2fcf
(describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents:
17315
diff
changeset
|
911 (cond ((eq type 2) ; ISO-2022 |
15177bdb2fcf
(describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents:
17315
diff
changeset
|
912 (let ((idx 0) |
15177bdb2fcf
(describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents:
17315
diff
changeset
|
913 charset) |
15177bdb2fcf
(describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents:
17315
diff
changeset
|
914 (while (< idx 4) |
15177bdb2fcf
(describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents:
17315
diff
changeset
|
915 (setq charset (aref flags idx)) |
15177bdb2fcf
(describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents:
17315
diff
changeset
|
916 (cond ((null charset) |
15177bdb2fcf
(describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents:
17315
diff
changeset
|
917 (princ -1)) |
15177bdb2fcf
(describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents:
17315
diff
changeset
|
918 ((eq charset t) |
15177bdb2fcf
(describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents:
17315
diff
changeset
|
919 (princ -2)) |
15177bdb2fcf
(describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents:
17315
diff
changeset
|
920 ((charsetp charset) |
15177bdb2fcf
(describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents:
17315
diff
changeset
|
921 (princ charset)) |
15177bdb2fcf
(describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents:
17315
diff
changeset
|
922 ((listp charset) |
15177bdb2fcf
(describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents:
17315
diff
changeset
|
923 (princ "(") |
17052 | 924 (princ (car charset)) |
18199
15177bdb2fcf
(describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents:
17315
diff
changeset
|
925 (setq charset (cdr charset)) |
15177bdb2fcf
(describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents:
17315
diff
changeset
|
926 (while charset |
15177bdb2fcf
(describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents:
17315
diff
changeset
|
927 (princ ",") |
15177bdb2fcf
(describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents:
17315
diff
changeset
|
928 (princ (car charset)) |
15177bdb2fcf
(describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents:
17315
diff
changeset
|
929 (setq charset (cdr charset))) |
15177bdb2fcf
(describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents:
17315
diff
changeset
|
930 (princ ")"))) |
15177bdb2fcf
(describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents:
17315
diff
changeset
|
931 (princ ",") |
15177bdb2fcf
(describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents:
17315
diff
changeset
|
932 (setq idx (1+ idx))) |
15177bdb2fcf
(describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents:
17315
diff
changeset
|
933 (while (< idx 12) |
15177bdb2fcf
(describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents:
17315
diff
changeset
|
934 (princ (if (aref flags idx) 1 0)) |
15177bdb2fcf
(describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents:
17315
diff
changeset
|
935 (princ ",") |
15177bdb2fcf
(describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents:
17315
diff
changeset
|
936 (setq idx (1+ idx))) |
15177bdb2fcf
(describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents:
17315
diff
changeset
|
937 (princ (if (aref flags idx) 1 0)))) |
15177bdb2fcf
(describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents:
17315
diff
changeset
|
938 ((eq type 4) ; CCL |
15177bdb2fcf
(describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents:
17315
diff
changeset
|
939 (let (i len) |
21967 | 940 (if (symbolp (car flags)) |
941 (princ (format " %s" (car flags))) | |
942 (setq i 0 len (length (car flags))) | |
943 (while (< i len) | |
944 (princ (format " %x" (aref (car flags) i))) | |
945 (setq i (1+ i)))) | |
17052 | 946 (princ ",") |
21967 | 947 (if (symbolp (cdr flags)) |
948 (princ (format "%s" (cdr flags))) | |
949 (setq i 0 len (length (cdr flags))) | |
950 (while (< i len) | |
951 (princ (format " %x" (aref (cdr flags) i))) | |
952 (setq i (1+ i)))))) | |
18199
15177bdb2fcf
(describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents:
17315
diff
changeset
|
953 (t (princ 0))) |
15177bdb2fcf
(describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents:
17315
diff
changeset
|
954 (princ ":") |
15177bdb2fcf
(describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents:
17315
diff
changeset
|
955 (princ (coding-system-doc-string coding-system)) |
15177bdb2fcf
(describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents:
17315
diff
changeset
|
956 (princ "\n")))) |
17052 | 957 |
18199
15177bdb2fcf
(describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents:
17315
diff
changeset
|
958 ;;;###autoload |
18559
20369fbd0f91
(print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents:
18377
diff
changeset
|
959 (defun list-coding-systems (&optional arg) |
20369fbd0f91
(print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents:
18377
diff
changeset
|
960 "Display a list of all coding systems. |
22306 | 961 This shows the mnemonic letter, name, and description of each coding system. |
18559
20369fbd0f91
(print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents:
18377
diff
changeset
|
962 |
20369fbd0f91
(print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents:
18377
diff
changeset
|
963 With prefix arg, the output format gets more cryptic, |
22306 | 964 but still contains full information about each coding system." |
18559
20369fbd0f91
(print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents:
18377
diff
changeset
|
965 (interactive "P") |
17052 | 966 (with-output-to-temp-buffer "*Help*" |
22339
69de59462e22
(list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents:
22306
diff
changeset
|
967 (list-coding-systems-1 arg))) |
69de59462e22
(list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents:
22306
diff
changeset
|
968 |
69de59462e22
(list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents:
22306
diff
changeset
|
969 (defun list-coding-systems-1 (arg) |
69de59462e22
(list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents:
22306
diff
changeset
|
970 (if (null arg) |
69de59462e22
(list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents:
22306
diff
changeset
|
971 (princ "\ |
18199
15177bdb2fcf
(describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents:
17315
diff
changeset
|
972 ############################################### |
15177bdb2fcf
(describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents:
17315
diff
changeset
|
973 # 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
|
974 # MNEMONIC-LETTER -- CODING-SYSTEM-NAME |
15177bdb2fcf
(describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents:
17315
diff
changeset
|
975 # DOC-STRING |
15177bdb2fcf
(describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents:
17315
diff
changeset
|
976 ") |
22339
69de59462e22
(list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents:
22306
diff
changeset
|
977 (princ "\ |
17052 | 978 ######################### |
979 ## LIST OF CODING SYSTEMS | |
980 ## Each line corresponds to one coding system | |
981 ## Format of a line is: | |
18199
15177bdb2fcf
(describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents:
17315
diff
changeset
|
982 ## 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
|
983 ## :PRE-WRITE-CONVERSION:DOC-STRING, |
17052 | 984 ## where |
18199
15177bdb2fcf
(describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents:
17315
diff
changeset
|
985 ## NAME = coding system name |
15177bdb2fcf
(describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents:
17315
diff
changeset
|
986 ## ALIAS = alias of the coding system |
15177bdb2fcf
(describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents:
17315
diff
changeset
|
987 ## 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
|
988 ## 0 (EMACS-MULE), 1 (SJIS), 2 (ISO2022), 3 (BIG5), or 4 (CCL) |
17052 | 989 ## EOL = 0 (LF), 1 (CRLF), 2 (CR), or 3 (Automatic detection) |
990 ## FLAGS = | |
991 ## if TYPE = 2 then | |
992 ## comma (`,') separated data of the followings: | |
993 ## G0, G1, G2, G3, SHORT-FORM, ASCII-EOL, ASCII-CNTL, SEVEN, | |
994 ## LOCKING-SHIFT, SINGLE-SHIFT, USE-ROMAN, USE-OLDJIS, NO-ISO6429 | |
995 ## else if TYPE = 4 then | |
996 ## comma (`,') separated CCL programs for read and write | |
997 ## else | |
998 ## 0 | |
18199
15177bdb2fcf
(describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents:
17315
diff
changeset
|
999 ## POST-READ-CONVERSION, PRE-WRITE-CONVERSION = function name to be called |
17052 | 1000 ## |
18199
15177bdb2fcf
(describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents:
17315
diff
changeset
|
1001 ")) |
22339
69de59462e22
(list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents:
22306
diff
changeset
|
1002 (let ((bases (coding-system-list 'base-only)) |
69de59462e22
(list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents:
22306
diff
changeset
|
1003 coding-system) |
69de59462e22
(list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents:
22306
diff
changeset
|
1004 (while bases |
69de59462e22
(list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents:
22306
diff
changeset
|
1005 (setq coding-system (car bases)) |
69de59462e22
(list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents:
22306
diff
changeset
|
1006 (if (null arg) |
69de59462e22
(list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents:
22306
diff
changeset
|
1007 (print-coding-system-briefly coding-system 'doc-string) |
69de59462e22
(list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents:
22306
diff
changeset
|
1008 (print-coding-system coding-system)) |
69de59462e22
(list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents:
22306
diff
changeset
|
1009 (setq bases (cdr bases))))) |
18559
20369fbd0f91
(print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents:
18377
diff
changeset
|
1010 |
26688
1830bc1903fb
(list-coding-categories): Fix typo;
Gerd Moellmann <gerd@gnu.org>
parents:
26189
diff
changeset
|
1011 ;;;###autoload |
18559
20369fbd0f91
(print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents:
18377
diff
changeset
|
1012 (defun list-coding-categories () |
20369fbd0f91
(print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents:
18377
diff
changeset
|
1013 "Display a list of all coding categories." |
20369fbd0f91
(print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents:
18377
diff
changeset
|
1014 (with-output-to-temp-buffer "*Help*" |
20369fbd0f91
(print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents:
18377
diff
changeset
|
1015 (princ "\ |
17052 | 1016 ############################ |
1017 ## LIST OF CODING CATEGORIES (ordered by priority) | |
1018 ## CATEGORY:CODING-SYSTEM | |
1019 ## | |
1020 ") | |
18559
20369fbd0f91
(print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents:
18377
diff
changeset
|
1021 (let ((l coding-category-list)) |
20369fbd0f91
(print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents:
18377
diff
changeset
|
1022 (while l |
20369fbd0f91
(print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents:
18377
diff
changeset
|
1023 (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
|
1024 (setq l (cdr l)))))) |
17052 | 1025 |
1026 ;;; FONT | |
1027 | |
1028 ;; Print information of a font in FONTINFO. | |
1029 (defun describe-font-internal (font-info &optional verbose) | |
1030 (print-list "name (opened by):" (aref font-info 0)) | |
1031 (print-list " full name:" (aref font-info 1)) | |
28899
133a92b8094d
(syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents:
28216
diff
changeset
|
1032 (print-list " size:" (format "%2d" (aref font-info 2))) |
133a92b8094d
(syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents:
28216
diff
changeset
|
1033 (print-list " height:" (format "%2d" (aref font-info 3))) |
133a92b8094d
(syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents:
28216
diff
changeset
|
1034 (print-list " baseline-offset:" (format "%2d" (aref font-info 4))) |
133a92b8094d
(syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents:
28216
diff
changeset
|
1035 (print-list "relative-compose:" (format "%2d" (aref font-info 5)))) |
17052 | 1036 |
1037 ;;;###autoload | |
1038 (defun describe-font (fontname) | |
1039 "Display information about fonts which partially match FONTNAME." | |
20092 | 1040 (interactive "sFontname (default, current choice for ASCII chars): ") |
28216
cad26a9da36b
(describe-font): Don't refer to
Kenichi Handa <handa@m17n.org>
parents:
27973
diff
changeset
|
1041 (or (and window-system (fboundp 'fontset-list)) |
21469
ea652c41eec6
(list-input-methods): Fix doc string.
Karl Heuer <kwzh@gnu.org>
parents:
20731
diff
changeset
|
1042 (error "No fontsets being used")) |
18696
1caf720e4f55
(print-fontset): Output format improved.
Kenichi Handa <handa@m17n.org>
parents:
18643
diff
changeset
|
1043 (when (or (not fontname) (= (length fontname) 0)) |
1caf720e4f55
(print-fontset): Output format improved.
Kenichi Handa <handa@m17n.org>
parents:
18643
diff
changeset
|
1044 (setq fontname (cdr (assq 'font (frame-parameters)))) |
1caf720e4f55
(print-fontset): Output format improved.
Kenichi Handa <handa@m17n.org>
parents:
18643
diff
changeset
|
1045 (if (query-fontset fontname) |
1caf720e4f55
(print-fontset): Output format improved.
Kenichi Handa <handa@m17n.org>
parents:
18643
diff
changeset
|
1046 (setq fontname |
30126
f5fd9fcdaeb2
(describe-font): Adjusted for the chnage of fontset-info.
Kenichi Handa <handa@m17n.org>
parents:
29454
diff
changeset
|
1047 (nth 1 (assq 'ascii (aref (fontset-info fontname) 2)))))) |
17052 | 1048 (let ((font-info (font-info fontname))) |
1049 (if (null font-info) | |
1050 (message "No matching font") | |
1051 (with-output-to-temp-buffer "*Help*" | |
1052 (describe-font-internal font-info 'verbose))))) | |
1053 | |
18559
20369fbd0f91
(print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents:
18377
diff
changeset
|
1054 (defun print-fontset (fontset &optional print-fonts) |
43231
06e0fbd07e17
Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents:
42362
diff
changeset
|
1055 "Print information about FONTSET. |
06e0fbd07e17
Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents:
42362
diff
changeset
|
1056 If optional arg PRINT-FONTS is non-nil, also print names of all opened |
06e0fbd07e17
Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents:
42362
diff
changeset
|
1057 fonts for FONTSET. This function actually inserts the information in |
06e0fbd07e17
Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents:
42362
diff
changeset
|
1058 the current buffer." |
30126
f5fd9fcdaeb2
(describe-font): Adjusted for the chnage of fontset-info.
Kenichi Handa <handa@m17n.org>
parents:
29454
diff
changeset
|
1059 (let ((tail (aref (fontset-info fontset) 2)) |
28899
133a92b8094d
(syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents:
28216
diff
changeset
|
1060 elt chars font-spec opened prev-charset charset from to) |
18559
20369fbd0f91
(print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents:
18377
diff
changeset
|
1061 (beginning-of-line) |
28899
133a92b8094d
(syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents:
28216
diff
changeset
|
1062 (insert "Fontset: " fontset "\n") |
133a92b8094d
(syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents:
28216
diff
changeset
|
1063 (insert "CHARSET or CHAR RANGE") |
34931
debb78d4e934
(print-fontset): Indent font name by 24 columns, not 25.
Kenichi Handa <handa@m17n.org>
parents:
34764
diff
changeset
|
1064 (indent-to 24) |
28899
133a92b8094d
(syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents:
28216
diff
changeset
|
1065 (insert "FONT NAME\n") |
133a92b8094d
(syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents:
28216
diff
changeset
|
1066 (insert "---------------------") |
34931
debb78d4e934
(print-fontset): Indent font name by 24 columns, not 25.
Kenichi Handa <handa@m17n.org>
parents:
34764
diff
changeset
|
1067 (indent-to 24) |
28899
133a92b8094d
(syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents:
28216
diff
changeset
|
1068 (insert "---------") |
133a92b8094d
(syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents:
28216
diff
changeset
|
1069 (insert "\n") |
133a92b8094d
(syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents:
28216
diff
changeset
|
1070 (while tail |
133a92b8094d
(syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents:
28216
diff
changeset
|
1071 (setq elt (car tail) tail (cdr tail)) |
133a92b8094d
(syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents:
28216
diff
changeset
|
1072 (setq chars (car elt) font-spec (car (cdr elt)) opened (cdr (cdr elt))) |
133a92b8094d
(syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents:
28216
diff
changeset
|
1073 (if (symbolp chars) |
133a92b8094d
(syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents:
28216
diff
changeset
|
1074 (setq charset chars from nil to nil) |
133a92b8094d
(syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents:
28216
diff
changeset
|
1075 (if (integerp chars) |
133a92b8094d
(syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents:
28216
diff
changeset
|
1076 (setq charset (char-charset chars) from chars to chars) |
133a92b8094d
(syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents:
28216
diff
changeset
|
1077 (setq charset (char-charset (car chars)) |
133a92b8094d
(syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents:
28216
diff
changeset
|
1078 from (car chars) to (cdr chars)))) |
133a92b8094d
(syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents:
28216
diff
changeset
|
1079 (unless (eq charset prev-charset) |
133a92b8094d
(syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents:
28216
diff
changeset
|
1080 (insert (symbol-name charset)) |
133a92b8094d
(syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents:
28216
diff
changeset
|
1081 (if from |
133a92b8094d
(syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents:
28216
diff
changeset
|
1082 (insert "\n"))) |
133a92b8094d
(syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents:
28216
diff
changeset
|
1083 (when from |
133a92b8094d
(syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents:
28216
diff
changeset
|
1084 (let ((split (split-char from))) |
133a92b8094d
(syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents:
28216
diff
changeset
|
1085 (if (and (= (charset-dimension charset) 2) |
133a92b8094d
(syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents:
28216
diff
changeset
|
1086 (= (nth 2 split) 0)) |
133a92b8094d
(syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents:
28216
diff
changeset
|
1087 (setq from |
133a92b8094d
(syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents:
28216
diff
changeset
|
1088 (make-char charset (nth 1 split) |
133a92b8094d
(syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents:
28216
diff
changeset
|
1089 (if (= (charset-chars charset) 94) 33 32)))) |
133a92b8094d
(syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents:
28216
diff
changeset
|
1090 (insert " " from)) |
133a92b8094d
(syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents:
28216
diff
changeset
|
1091 (when (/= from to) |
133a92b8094d
(syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents:
28216
diff
changeset
|
1092 (insert "-") |
133a92b8094d
(syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents:
28216
diff
changeset
|
1093 (let ((split (split-char to))) |
133a92b8094d
(syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents:
28216
diff
changeset
|
1094 (if (and (= (charset-dimension charset) 2) |
133a92b8094d
(syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents:
28216
diff
changeset
|
1095 (= (nth 2 split) 0)) |
133a92b8094d
(syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents:
28216
diff
changeset
|
1096 (setq to |
133a92b8094d
(syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents:
28216
diff
changeset
|
1097 (make-char charset (nth 1 split) |
133a92b8094d
(syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents:
28216
diff
changeset
|
1098 (if (= (charset-chars charset) 94) 126 127)))) |
133a92b8094d
(syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents:
28216
diff
changeset
|
1099 (insert to)))) |
34931
debb78d4e934
(print-fontset): Indent font name by 24 columns, not 25.
Kenichi Handa <handa@m17n.org>
parents:
34764
diff
changeset
|
1100 (indent-to 24) |
28899
133a92b8094d
(syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents:
28216
diff
changeset
|
1101 (if (stringp font-spec) |
133a92b8094d
(syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents:
28216
diff
changeset
|
1102 (insert font-spec) |
133a92b8094d
(syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents:
28216
diff
changeset
|
1103 (if (car font-spec) |
133a92b8094d
(syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents:
28216
diff
changeset
|
1104 (if (string-match "-" (car font-spec)) |
29228
0b31a133aa22
(print-fontset): Combine family part
Kenichi Handa <handa@m17n.org>
parents:
29187
diff
changeset
|
1105 (insert "-" (car font-spec) "-*-") |
0b31a133aa22
(print-fontset): Combine family part
Kenichi Handa <handa@m17n.org>
parents:
29187
diff
changeset
|
1106 (insert "-*-" (car font-spec) "-*-")) |
28899
133a92b8094d
(syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents:
28216
diff
changeset
|
1107 (insert "-*-")) |
133a92b8094d
(syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents:
28216
diff
changeset
|
1108 (if (cdr font-spec) |
133a92b8094d
(syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents:
28216
diff
changeset
|
1109 (if (string-match "-" (cdr font-spec)) |
133a92b8094d
(syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents:
28216
diff
changeset
|
1110 (insert (cdr font-spec)) |
133a92b8094d
(syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents:
28216
diff
changeset
|
1111 (insert (cdr font-spec) "-*")) |
133a92b8094d
(syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents:
28216
diff
changeset
|
1112 (insert "*"))) |
133a92b8094d
(syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents:
28216
diff
changeset
|
1113 (insert "\n") |
133a92b8094d
(syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents:
28216
diff
changeset
|
1114 (when print-fonts |
133a92b8094d
(syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents:
28216
diff
changeset
|
1115 (while opened |
133a92b8094d
(syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents:
28216
diff
changeset
|
1116 (indent-to 5) |
133a92b8094d
(syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents:
28216
diff
changeset
|
1117 (insert "[" (car opened) "]\n") |
133a92b8094d
(syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents:
28216
diff
changeset
|
1118 (setq opened (cdr opened)))) |
133a92b8094d
(syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents:
28216
diff
changeset
|
1119 (setq prev-charset charset) |
133a92b8094d
(syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents:
28216
diff
changeset
|
1120 ))) |
17052 | 1121 |
1122 ;;;###autoload | |
1123 (defun describe-fontset (fontset) | |
43231
06e0fbd07e17
Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents:
42362
diff
changeset
|
1124 "Display information about FONTSET. |
28899
133a92b8094d
(syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents:
28216
diff
changeset
|
1125 This shows which font is used for which character(s)." |
17052 | 1126 (interactive |
28216
cad26a9da36b
(describe-font): Don't refer to
Kenichi Handa <handa@m17n.org>
parents:
27973
diff
changeset
|
1127 (if (not (and window-system (fboundp 'fontset-list))) |
21469
ea652c41eec6
(list-input-methods): Fix doc string.
Karl Heuer <kwzh@gnu.org>
parents:
20731
diff
changeset
|
1128 (error "No fontsets being used") |
35585 | 1129 (let ((fontset-list (nconc |
45909
9f98a97f5469
(describe-fontset): Don't cons uselessly.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
45871
diff
changeset
|
1130 (fontset-list) |
9f98a97f5469
(describe-fontset): Don't cons uselessly.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
45871
diff
changeset
|
1131 (mapcar 'cdr fontset-alias-alist))) |
18559
20369fbd0f91
(print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents:
18377
diff
changeset
|
1132 (completion-ignore-case t)) |
20369fbd0f91
(print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents:
18377
diff
changeset
|
1133 (list (completing-read |
20369fbd0f91
(print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents:
18377
diff
changeset
|
1134 "Fontset (default, used by the current frame): " |
20369fbd0f91
(print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents:
18377
diff
changeset
|
1135 fontset-list nil t))))) |
20369fbd0f91
(print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents:
18377
diff
changeset
|
1136 (if (= (length fontset) 0) |
20369fbd0f91
(print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents:
18377
diff
changeset
|
1137 (setq fontset (cdr (assq 'font (frame-parameters))))) |
28899
133a92b8094d
(syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents:
28216
diff
changeset
|
1138 (if (not (setq fontset (query-fontset fontset))) |
18559
20369fbd0f91
(print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents:
18377
diff
changeset
|
1139 (error "Current frame is using font, not fontset")) |
40664
4e5f8e42b8d1
(list-character-sets, sort-listed-character-sets, describe-character-set)
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
40639
diff
changeset
|
1140 (help-setup-xref (list #'describe-fontset fontset) (interactive-p)) |
4e5f8e42b8d1
(list-character-sets, sort-listed-character-sets, describe-character-set)
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
40639
diff
changeset
|
1141 (with-output-to-temp-buffer (help-buffer) |
4e5f8e42b8d1
(list-character-sets, sort-listed-character-sets, describe-character-set)
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
40639
diff
changeset
|
1142 (with-current-buffer standard-output |
28899
133a92b8094d
(syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents:
28216
diff
changeset
|
1143 (print-fontset fontset t)))) |
18559
20369fbd0f91
(print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents:
18377
diff
changeset
|
1144 |
20369fbd0f91
(print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents:
18377
diff
changeset
|
1145 ;;;###autoload |
20369fbd0f91
(print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents:
18377
diff
changeset
|
1146 (defun list-fontsets (arg) |
20369fbd0f91
(print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents:
18377
diff
changeset
|
1147 "Display a list of all fontsets. |
22306 | 1148 This shows the name, size, and style of each fontset. |
43231
06e0fbd07e17
Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents:
42362
diff
changeset
|
1149 With prefix arg, also list the fonts contained in each fontset; |
22306 | 1150 see the function `describe-fontset' for the format of the list." |
18559
20369fbd0f91
(print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents:
18377
diff
changeset
|
1151 (interactive "P") |
28216
cad26a9da36b
(describe-font): Don't refer to
Kenichi Handa <handa@m17n.org>
parents:
27973
diff
changeset
|
1152 (if (not (and window-system (fboundp 'fontset-list))) |
21469
ea652c41eec6
(list-input-methods): Fix doc string.
Karl Heuer <kwzh@gnu.org>
parents:
20731
diff
changeset
|
1153 (error "No fontsets being used") |
40664
4e5f8e42b8d1
(list-character-sets, sort-listed-character-sets, describe-character-set)
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
40639
diff
changeset
|
1154 (help-setup-xref (list #'list-fontsets arg) (interactive-p)) |
4e5f8e42b8d1
(list-character-sets, sort-listed-character-sets, describe-character-set)
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
40639
diff
changeset
|
1155 (with-output-to-temp-buffer (help-buffer) |
4e5f8e42b8d1
(list-character-sets, sort-listed-character-sets, describe-character-set)
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
40639
diff
changeset
|
1156 (with-current-buffer standard-output |
22339
69de59462e22
(list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents:
22306
diff
changeset
|
1157 ;; This code is duplicated near the end of mule-diag. |
24161
782215de9b98
(list-fontsets): Sort fontsets by plain names.
Kenichi Handa <handa@m17n.org>
parents:
23582
diff
changeset
|
1158 (let ((fontsets |
782215de9b98
(list-fontsets): Sort fontsets by plain names.
Kenichi Handa <handa@m17n.org>
parents:
23582
diff
changeset
|
1159 (sort (fontset-list) |
47548
698b4a4bb562
(describe-coding-system): Remove unused `coding-spec' variable.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
46490
diff
changeset
|
1160 (lambda (x y) |
698b4a4bb562
(describe-coding-system): Remove unused `coding-spec' variable.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
46490
diff
changeset
|
1161 (string< (fontset-plain-name x) |
698b4a4bb562
(describe-coding-system): Remove unused `coding-spec' variable.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
46490
diff
changeset
|
1162 (fontset-plain-name y)))))) |
21469
ea652c41eec6
(list-input-methods): Fix doc string.
Karl Heuer <kwzh@gnu.org>
parents:
20731
diff
changeset
|
1163 (while fontsets |
28899
133a92b8094d
(syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents:
28216
diff
changeset
|
1164 (if arg |
133a92b8094d
(syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents:
28216
diff
changeset
|
1165 (print-fontset (car fontsets) nil) |
133a92b8094d
(syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents:
28216
diff
changeset
|
1166 (insert "Fontset: " (car fontsets) "\n")) |
21469
ea652c41eec6
(list-input-methods): Fix doc string.
Karl Heuer <kwzh@gnu.org>
parents:
20731
diff
changeset
|
1167 (setq fontsets (cdr fontsets)))))))) |
18300
0436624abece
(list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents:
18199
diff
changeset
|
1168 |
0436624abece
(list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents:
18199
diff
changeset
|
1169 ;;;###autoload |
0436624abece
(list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents:
18199
diff
changeset
|
1170 (defun list-input-methods () |
22306 | 1171 "Display information about all input methods." |
18300
0436624abece
(list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents:
18199
diff
changeset
|
1172 (interactive) |
47548
698b4a4bb562
(describe-coding-system): Remove unused `coding-spec' variable.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
46490
diff
changeset
|
1173 (help-setup-xref '(list-input-methods) (interactive-p)) |
698b4a4bb562
(describe-coding-system): Remove unused `coding-spec' variable.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
46490
diff
changeset
|
1174 (with-output-to-temp-buffer (help-buffer) |
43231
06e0fbd07e17
Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents:
42362
diff
changeset
|
1175 (list-input-methods-1) |
06e0fbd07e17
Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents:
42362
diff
changeset
|
1176 (with-current-buffer standard-output |
06e0fbd07e17
Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents:
42362
diff
changeset
|
1177 (save-excursion |
06e0fbd07e17
Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents:
42362
diff
changeset
|
1178 (goto-char (point-min)) |
06e0fbd07e17
Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents:
42362
diff
changeset
|
1179 (while (re-search-forward |
06e0fbd07e17
Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents:
42362
diff
changeset
|
1180 "^ \\([^ ]+\\) (`.*' in mode line)$" nil t) |
43292 | 1181 (help-xref-button 1 #'help-input-method |
43231
06e0fbd07e17
Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents:
42362
diff
changeset
|
1182 (match-string 1) |
47548
698b4a4bb562
(describe-coding-system): Remove unused `coding-spec' variable.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
46490
diff
changeset
|
1183 "mouse-2: describe this method")))))) |
22339
69de59462e22
(list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents:
22306
diff
changeset
|
1184 |
69de59462e22
(list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents:
22306
diff
changeset
|
1185 (defun list-input-methods-1 () |
69de59462e22
(list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents:
22306
diff
changeset
|
1186 (if (not input-method-alist) |
69de59462e22
(list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents:
22306
diff
changeset
|
1187 (progn |
69de59462e22
(list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents:
22306
diff
changeset
|
1188 (princ " |
44746
8f2bf8b392fe
(list-input-methods-1): Doc fix
Pavel Janík <Pavel@Janik.cz>
parents:
43977
diff
changeset
|
1189 No input method is available, perhaps because you have not |
8f2bf8b392fe
(list-input-methods-1): Doc fix
Pavel Janík <Pavel@Janik.cz>
parents:
43977
diff
changeset
|
1190 installed LEIM (Libraries of Emacs Input Methods).")) |
22339
69de59462e22
(list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents:
22306
diff
changeset
|
1191 (princ "LANGUAGE\n NAME (`TITLE' in mode line)\n") |
69de59462e22
(list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents:
22306
diff
changeset
|
1192 (princ " SHORT-DESCRIPTION\n------------------------------\n") |
69de59462e22
(list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents:
22306
diff
changeset
|
1193 (setq input-method-alist |
69de59462e22
(list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents:
22306
diff
changeset
|
1194 (sort input-method-alist |
47548
698b4a4bb562
(describe-coding-system): Remove unused `coding-spec' variable.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
46490
diff
changeset
|
1195 (lambda (x y) (string< (nth 1 x) (nth 1 y))))) |
22339
69de59462e22
(list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents:
22306
diff
changeset
|
1196 (let ((l input-method-alist) |
69de59462e22
(list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents:
22306
diff
changeset
|
1197 language elt) |
69de59462e22
(list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents:
22306
diff
changeset
|
1198 (while l |
69de59462e22
(list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents:
22306
diff
changeset
|
1199 (setq elt (car l) l (cdr l)) |
69de59462e22
(list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents:
22306
diff
changeset
|
1200 (when (not (equal language (nth 1 elt))) |
69de59462e22
(list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents:
22306
diff
changeset
|
1201 (setq language (nth 1 elt)) |
69de59462e22
(list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents:
22306
diff
changeset
|
1202 (princ language) |
69de59462e22
(list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents:
22306
diff
changeset
|
1203 (terpri)) |
69de59462e22
(list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents:
22306
diff
changeset
|
1204 (princ (format " %s (`%s' in mode line)\n %s\n" |
69de59462e22
(list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents:
22306
diff
changeset
|
1205 (car elt) |
69de59462e22
(list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents:
22306
diff
changeset
|
1206 (let ((title (nth 3 elt))) |
69de59462e22
(list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents:
22306
diff
changeset
|
1207 (if (and (consp title) (stringp (car title))) |
69de59462e22
(list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents:
22306
diff
changeset
|
1208 (car title) |
69de59462e22
(list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents:
22306
diff
changeset
|
1209 title)) |
69de59462e22
(list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents:
22306
diff
changeset
|
1210 (let ((description (nth 4 elt))) |
69de59462e22
(list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents:
22306
diff
changeset
|
1211 (string-match ".*" description) |
69de59462e22
(list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents:
22306
diff
changeset
|
1212 (match-string 0 description)))))))) |
17052 | 1213 |
1214 ;;; DIAGNOSIS | |
1215 | |
18559
20369fbd0f91
(print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents:
18377
diff
changeset
|
1216 ;; 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
|
1217 (defun insert-section (section-number title) |
17052 | 1218 (insert "########################################\n" |
18559
20369fbd0f91
(print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents:
18377
diff
changeset
|
1219 "# Section " (format "%d" section-number) ". " title "\n" |
17052 | 1220 "########################################\n\n")) |
1221 | |
1222 ;;;###autoload | |
1223 (defun mule-diag () | |
24724
df2a95fa1429
(mule-diag): Change MULE to Mule in docstring.
Kenichi Handa <handa@m17n.org>
parents:
24691
diff
changeset
|
1224 "Display diagnosis of the multilingual environment (Mule). |
18559
20369fbd0f91
(print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents:
18377
diff
changeset
|
1225 |
22306 | 1226 This shows various information related to the current multilingual |
18559
20369fbd0f91
(print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents:
18377
diff
changeset
|
1227 environment, including lists of input methods, coding systems, |
22306 | 1228 character sets, and fontsets (if Emacs is running under a window |
21469
ea652c41eec6
(list-input-methods): Fix doc string.
Karl Heuer <kwzh@gnu.org>
parents:
20731
diff
changeset
|
1229 system which uses fontsets)." |
17052 | 1230 (interactive) |
18559
20369fbd0f91
(print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents:
18377
diff
changeset
|
1231 (with-output-to-temp-buffer "*Mule-Diagnosis*" |
40664
4e5f8e42b8d1
(list-character-sets, sort-listed-character-sets, describe-character-set)
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
40639
diff
changeset
|
1232 (with-current-buffer standard-output |
22339
69de59462e22
(list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents:
22306
diff
changeset
|
1233 (insert "###############################################\n" |
69de59462e22
(list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents:
22306
diff
changeset
|
1234 "### Current Status of Multilingual Features ###\n" |
69de59462e22
(list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents:
22306
diff
changeset
|
1235 "###############################################\n\n" |
17052 | 1236 "CONTENTS: Section 1. General Information\n" |
1237 " Section 2. Display\n" | |
1238 " Section 3. Input methods\n" | |
1239 " Section 4. Coding systems\n" | |
18559
20369fbd0f91
(print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents:
18377
diff
changeset
|
1240 " Section 5. Character sets\n") |
28216
cad26a9da36b
(describe-font): Don't refer to
Kenichi Handa <handa@m17n.org>
parents:
27973
diff
changeset
|
1241 (if (and window-system (fboundp 'fontset-list)) |
18559
20369fbd0f91
(print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents:
18377
diff
changeset
|
1242 (insert " Section 6. Fontsets\n")) |
17052 | 1243 (insert "\n") |
1244 | |
1245 (insert-section 1 "General Information") | |
19425
572165bfff3e
(mule-diag): Don't print primary-language.
Richard M. Stallman <rms@gnu.org>
parents:
19265
diff
changeset
|
1246 (insert "Version of this emacs:\n " (emacs-version) "\n\n") |
34631
aeb6db8df2b9
(mule-diag): Insert information about
Kenichi Handa <handa@m17n.org>
parents:
34078
diff
changeset
|
1247 (insert "Configuration options:\n " system-configuration-options "\n\n") |
aeb6db8df2b9
(mule-diag): Insert information about
Kenichi Handa <handa@m17n.org>
parents:
34078
diff
changeset
|
1248 (insert "Multibyte characters awareness:\n" |
aeb6db8df2b9
(mule-diag): Insert information about
Kenichi Handa <handa@m17n.org>
parents:
34078
diff
changeset
|
1249 (format " default: %S\n" default-enable-multibyte-characters) |
aeb6db8df2b9
(mule-diag): Insert information about
Kenichi Handa <handa@m17n.org>
parents:
34078
diff
changeset
|
1250 (format " current-buffer: %S\n\n" enable-multibyte-characters)) |
aeb6db8df2b9
(mule-diag): Insert information about
Kenichi Handa <handa@m17n.org>
parents:
34078
diff
changeset
|
1251 (insert "Current language environment: " current-language-environment |
aeb6db8df2b9
(mule-diag): Insert information about
Kenichi Handa <handa@m17n.org>
parents:
34078
diff
changeset
|
1252 "\n\n") |
17052 | 1253 |
1254 (insert-section 2 "Display") | |
1255 (if window-system | |
1256 (insert "Window-system: " | |
1257 (symbol-name window-system) | |
1258 (format "%s" window-system-version)) | |
1259 (insert "Terminal: " (getenv "TERM"))) | |
1260 (insert "\n\n") | |
1261 | |
1262 (if (eq window-system 'x) | |
1263 (let ((font (cdr (assq 'font (frame-parameters))))) | |
1264 (insert "The selected frame is using the " | |
1265 (if (query-fontset font) "fontset" "font") | |
1266 ":\n\t" font)) | |
1267 (insert "Coding system of the terminal: " | |
1268 (symbol-name (terminal-coding-system)))) | |
1269 (insert "\n\n") | |
1270 | |
1271 (insert-section 3 "Input methods") | |
22339
69de59462e22
(list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents:
22306
diff
changeset
|
1272 (list-input-methods-1) |
17052 | 1273 (insert "\n") |
1274 (if default-input-method | |
26189
88faf40281cd
(mule-diag): Handle the case that
Kenichi Handa <handa@m17n.org>
parents:
24865
diff
changeset
|
1275 (insert (format "Default input method: %s\n" default-input-method)) |
19657
940d50684d68
(describe-current-coding-system): Add missing newline in output.
Richard M. Stallman <rms@gnu.org>
parents:
19557
diff
changeset
|
1276 (insert "No default input method is specified\n")) |
17052 | 1277 |
1278 (insert-section 4 "Coding systems") | |
22339
69de59462e22
(list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents:
22306
diff
changeset
|
1279 (list-coding-systems-1 t) |
69de59462e22
(list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents:
22306
diff
changeset
|
1280 (princ "\ |
69de59462e22
(list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents:
22306
diff
changeset
|
1281 ############################ |
69de59462e22
(list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents:
22306
diff
changeset
|
1282 ## LIST OF CODING CATEGORIES (ordered by priority) |
69de59462e22
(list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents:
22306
diff
changeset
|
1283 ## CATEGORY:CODING-SYSTEM |
69de59462e22
(list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents:
22306
diff
changeset
|
1284 ## |
69de59462e22
(list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents:
22306
diff
changeset
|
1285 ") |
69de59462e22
(list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents:
22306
diff
changeset
|
1286 (let ((l coding-category-list)) |
69de59462e22
(list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents:
22306
diff
changeset
|
1287 (while l |
69de59462e22
(list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents:
22306
diff
changeset
|
1288 (princ (format "%s:%s\n" (car l) (symbol-value (car l)))) |
69de59462e22
(list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents:
22306
diff
changeset
|
1289 (setq l (cdr l)))) |
17052 | 1290 (insert "\n") |
1291 | |
18559
20369fbd0f91
(print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents:
18377
diff
changeset
|
1292 (insert-section 5 "Character sets") |
27912
ed26ed5b0afc
(list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents:
26688
diff
changeset
|
1293 (list-character-sets-2) |
18559
20369fbd0f91
(print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents:
18377
diff
changeset
|
1294 (insert "\n") |
17052 | 1295 |
28216
cad26a9da36b
(describe-font): Don't refer to
Kenichi Handa <handa@m17n.org>
parents:
27973
diff
changeset
|
1296 (when (and window-system (fboundp 'fontset-list)) |
22339
69de59462e22
(list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents:
22306
diff
changeset
|
1297 ;; This code duplicates most of list-fontsets. |
18559
20369fbd0f91
(print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents:
18377
diff
changeset
|
1298 (insert-section 6 "Fontsets") |
22339
69de59462e22
(list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents:
22306
diff
changeset
|
1299 (insert "Fontset-Name\t\t\t\t\t\t WDxHT Style\n") |
69de59462e22
(list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents:
22306
diff
changeset
|
1300 (insert "------------\t\t\t\t\t\t ----- -----\n") |
69de59462e22
(list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents:
22306
diff
changeset
|
1301 (let ((fontsets (fontset-list))) |
69de59462e22
(list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents:
22306
diff
changeset
|
1302 (while fontsets |
69de59462e22
(list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents:
22306
diff
changeset
|
1303 (print-fontset (car fontsets) t) |
69de59462e22
(list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents:
22306
diff
changeset
|
1304 (setq fontsets (cdr fontsets))))) |
22290
31291d62195e
(mule-diag): Don't call help-mode.
Karl Heuer <kwzh@gnu.org>
parents:
21979
diff
changeset
|
1305 (print-help-return-message)))) |
17052 | 1306 |
48050 | 1307 (provide 'mule-diag) |
1308 | |
18199
15177bdb2fcf
(describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents:
17315
diff
changeset
|
1309 ;;; mule-diag.el ends here |