annotate lisp/international/mule-diag.el @ 111534:e9570ce66184

* src/xmenu.c: Make it clear that ../lwlib/lwlib.h is only needed for Motif.
author Dan Nicolaescu <dann@ics.uci.edu>
date Sat, 13 Nov 2010 14:20:01 -0800
parents 7019133063c8
children 376148b31b5e
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2
95622
b4f1005a6470 Remove unnecessary eval-when-compiles.
Glenn Morris <rgm@gnu.org>
parents: 95405
diff changeset
3 ;; Copyright (C) 1997, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
106815
1d1d5d9bd884 Add 2010 to copyright years.
Glenn Morris <rgm@gnu.org>
parents: 106496
diff changeset
4 ;; 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
74605
6ee41fdd69ff Update AIST copyright years.
Kenichi Handa <handa@m17n.org>
parents: 74544
diff changeset
5 ;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
106815
1d1d5d9bd884 Add 2010 to copyright years.
Glenn Morris <rgm@gnu.org>
parents: 106496
diff changeset
6 ;; 2005, 2006, 2007, 2008, 2009, 2010
62274
c36561fe0657 Fix copyrights.
Kenichi Handa <handa@m17n.org>
parents: 54970
diff changeset
7 ;; National Institute of Advanced Industrial Science and Technology (AIST)
c36561fe0657 Fix copyrights.
Kenichi Handa <handa@m17n.org>
parents: 54970
diff changeset
8 ;; Registration Number H14PRO021
89483
2f877ed80fa6 *** empty log message ***
Kenichi Handa <handa@m17n.org>
parents: 88123 89412
diff changeset
9 ;; Copyright (C) 2003
88412
524f9b5b2ac5 (print-designation): Arguments changed.
Kenichi Handa <handa@m17n.org>
parents: 43292
diff changeset
10 ;; National Institute of Advanced Industrial Science and Technology (AIST)
524f9b5b2ac5 (print-designation): Arguments changed.
Kenichi Handa <handa@m17n.org>
parents: 43292
diff changeset
11 ;; Registration Number H13PRO009
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
12
27953
8b485e43ac51 (list-character-sets): Call
Dave Love <fx@gnu.org>
parents: 27912
diff changeset
13 ;; Keywords: multilingual, charset, coding system, fontset, diagnosis, i18n
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
14
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
15 ;; This file is part of GNU Emacs.
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
16
94664
889bc336b89b Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 94154
diff changeset
17 ;; GNU Emacs is free software: you can redistribute it and/or modify
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
18 ;; it under the terms of the GNU General Public License as published by
94664
889bc336b89b Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 94154
diff changeset
19 ;; the Free Software Foundation, either version 3 of the License, or
889bc336b89b Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 94154
diff changeset
20 ;; (at your option) any later version.
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
21
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
22 ;; GNU Emacs is distributed in the hope that it will be useful,
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
23 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
24 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
25 ;; GNU General Public License for more details.
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
26
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
27 ;; You should have received a copy of the GNU General Public License
94664
889bc336b89b Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 94154
diff changeset
28 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
29
38414
67b464da13ec Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents: 36989
diff changeset
30 ;;; Commentary:
67b464da13ec Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents: 36989
diff changeset
31
67b464da13ec Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents: 36989
diff changeset
32 ;;; Code:
67b464da13ec Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents: 36989
diff changeset
33
40722
1b9616706fd5 (help-funs): Require help-funs.
Richard M. Stallman <rms@gnu.org>
parents: 40664
diff changeset
34 ;; Make sure the help-xref button type is defined.
106496
6e0007ff5e13 Require help-mode instead of help-fns.
Kenichi Handa <handa@m17n.org>
parents: 105818
diff changeset
35 (require 'help-mode)
40722
1b9616706fd5 (help-funs): Require help-funs.
Richard M. Stallman <rms@gnu.org>
parents: 40664
diff changeset
36
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
37 ;;; General utility function
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
38
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
39 (defun print-list (&rest args)
88534
27fb0f57ffe3 Doc fixes.
Dave Love <fx@gnu.org>
parents: 88412
diff changeset
40 "Print all arguments with single space separator in one line."
101170
6df4439cd595 * international/mule-diag.el (print-list): Fix 2008-12-03 change.
Juanma Barranquero <lekktu@gmail.com>
parents: 100908
diff changeset
41 (princ (mapconcat (lambda (arg) (prin1-to-string arg t)) args " "))
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
42 (princ "\n"))
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
43
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
44 ;;; CHARSET
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
45
40639
d3a680cb99fd (describe-character-set)
Miles Bader <miles@gnu.org>
parents: 39475
diff changeset
46 (define-button-type 'sort-listed-character-sets
d3a680cb99fd (describe-character-set)
Miles Bader <miles@gnu.org>
parents: 39475
diff changeset
47 'help-echo (purecopy "mouse-2, RET: sort on this column")
d3a680cb99fd (describe-character-set)
Miles Bader <miles@gnu.org>
parents: 39475
diff changeset
48 'face 'bold
d3a680cb99fd (describe-character-set)
Miles Bader <miles@gnu.org>
parents: 39475
diff changeset
49 'action #'(lambda (button)
d3a680cb99fd (describe-character-set)
Miles Bader <miles@gnu.org>
parents: 39475
diff changeset
50 (sort-listed-character-sets (button-get button 'sort-key))))
d3a680cb99fd (describe-character-set)
Miles Bader <miles@gnu.org>
parents: 39475
diff changeset
51
d3a680cb99fd (describe-character-set)
Miles Bader <miles@gnu.org>
parents: 39475
diff changeset
52 (define-button-type 'list-charset-chars
d3a680cb99fd (describe-character-set)
Miles Bader <miles@gnu.org>
parents: 39475
diff changeset
53 :supertype 'help-xref
d3a680cb99fd (describe-character-set)
Miles Bader <miles@gnu.org>
parents: 39475
diff changeset
54 'help-function #'list-charset-chars
d3a680cb99fd (describe-character-set)
Miles Bader <miles@gnu.org>
parents: 39475
diff changeset
55 'help-echo "mouse-2, RET: show table of characters for this character set")
d3a680cb99fd (describe-character-set)
Miles Bader <miles@gnu.org>
parents: 39475
diff changeset
56
52126
69fcfc4c947a (non-iso-charset-alist): Add autoload cookie.
Kenichi Handa <handa@m17n.org>
parents: 50496
diff changeset
57 ;;;###autoload
27912
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
58 (defun list-character-sets (arg)
18559
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
59 "Display a list of all character sets.
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
60
43231
06e0fbd07e17 Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents: 42362
diff changeset
61 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
62 column contains the number of characters in a block of this character
103451
16c3fe546430 (list-character-sets): Change
Kenichi Handa <handa@m17n.org>
parents: 103178
diff changeset
63 set. The FINAL-BYTE column contains an ISO-2022 <final-byte> to use
16c3fe546430 (list-character-sets): Change
Kenichi Handa <handa@m17n.org>
parents: 103178
diff changeset
64 in the designation escape sequence for this character set in
16c3fe546430 (list-character-sets): Change
Kenichi Handa <handa@m17n.org>
parents: 103178
diff changeset
65 ISO-2022-based coding systems.
18559
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
66
100212
8770d8ed68e4 * international/mule-diag.el (list-character-sets): Doc fix.
Juanma Barranquero <lekktu@gmail.com>
parents: 100194
diff changeset
67 With prefix ARG, the output format gets more cryptic,
22306
6819832df39b Many doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 22290
diff changeset
68 but still shows the full information."
18559
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
69 (interactive "P")
105372
bd2966850aac Use `called-interactively-p' instead of `interactive-p'.
Juanma Barranquero <lekktu@gmail.com>
parents: 104823
diff changeset
70 (help-setup-xref (list #'list-character-sets arg)
bd2966850aac Use `called-interactively-p' instead of `interactive-p'.
Juanma Barranquero <lekktu@gmail.com>
parents: 104823
diff changeset
71 (called-interactively-p 'interactive))
47603
28c9630ee23e (list-character-sets): Use the buffer
Kenichi Handa <handa@m17n.org>
parents: 47548
diff changeset
72 (with-output-to-temp-buffer "*Character Set List*"
27912
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
73 (with-current-buffer standard-output
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
74 (if arg
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
75 (list-character-sets-2)
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
76 ;; Insert header.
89799
694e157b2143 (list-character-sets): Fix the first line message.
Kenichi Handa <handa@m17n.org>
parents: 89713
diff changeset
77 (insert "Supplementary character sets are shown below.\n")
27912
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
78 (insert
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
79 (substitute-command-keys
27973
cf535f97695d (list-character-sets): Make help-echo
Kenichi Handa <handa@m17n.org>
parents: 27953
diff changeset
80 (concat "Use "
cf535f97695d (list-character-sets): Make help-echo
Kenichi Handa <handa@m17n.org>
parents: 27953
diff changeset
81 (if (display-mouse-p) "\\[help-follow-mouse] or ")
cf535f97695d (list-character-sets): Make help-echo
Kenichi Handa <handa@m17n.org>
parents: 27953
diff changeset
82 "\\[help-follow]:\n")))
cf535f97695d (list-character-sets): Make help-echo
Kenichi Handa <handa@m17n.org>
parents: 27953
diff changeset
83 (insert " on a column title to sort by that title,")
88534
27fb0f57ffe3 Doc fixes.
Dave Love <fx@gnu.org>
parents: 88412
diff changeset
84 (indent-to 48)
27912
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
85 (insert "+----DIMENSION\n")
27973
cf535f97695d (list-character-sets): Make help-echo
Kenichi Handa <handa@m17n.org>
parents: 27953
diff changeset
86 (insert " on a charset name to list characters.")
88534
27fb0f57ffe3 Doc fixes.
Dave Love <fx@gnu.org>
parents: 88412
diff changeset
87 (indent-to 48)
27912
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
88 (insert "| +--CHARS\n")
88534
27fb0f57ffe3 Doc fixes.
Dave Love <fx@gnu.org>
parents: 88412
diff changeset
89 (let ((columns '(("CHARSET-NAME" . name) "\t\t\t\t\t"
103451
16c3fe546430 (list-character-sets): Change
Kenichi Handa <handa@m17n.org>
parents: 103178
diff changeset
90 ("D CH FINAL-BYTE" . iso-spec)))
27912
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
91 pos)
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
92 (while columns
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
93 (if (stringp (car columns))
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
94 (insert (car columns))
40639
d3a680cb99fd (describe-character-set)
Miles Bader <miles@gnu.org>
parents: 39475
diff changeset
95 (insert-text-button (car (car columns))
d3a680cb99fd (describe-character-set)
Miles Bader <miles@gnu.org>
parents: 39475
diff changeset
96 :type 'sort-listed-character-sets
d3a680cb99fd (describe-character-set)
Miles Bader <miles@gnu.org>
parents: 39475
diff changeset
97 'sort-key (cdr (car columns)))
27912
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
98 (goto-char (point-max)))
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
99 (setq columns (cdr columns)))
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
100 (insert "\n"))
88534
27fb0f57ffe3 Doc fixes.
Dave Love <fx@gnu.org>
parents: 88412
diff changeset
101 (insert "------------\t\t\t\t\t- --- ----------\n")
27912
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
102
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
103 ;; Insert body sorted by charset IDs.
88534
27fb0f57ffe3 Doc fixes.
Dave Love <fx@gnu.org>
parents: 88412
diff changeset
104 (list-character-sets-1 'name)))))
27912
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
105
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
106 (defun sort-listed-character-sets (sort-key)
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
107 (if sort-key
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
108 (save-excursion
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
109 (let ((buffer-read-only nil))
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
110 (goto-char (point-min))
89799
694e157b2143 (list-character-sets): Fix the first line message.
Kenichi Handa <handa@m17n.org>
parents: 89713
diff changeset
111 (search-forward "\n-")
694e157b2143 (list-character-sets): Fix the first line message.
Kenichi Handa <handa@m17n.org>
parents: 89713
diff changeset
112 (forward-line 1)
694e157b2143 (list-character-sets): Fix the first line message.
Kenichi Handa <handa@m17n.org>
parents: 89713
diff changeset
113 (delete-region (point) (point-max))
694e157b2143 (list-character-sets): Fix the first line message.
Kenichi Handa <handa@m17n.org>
parents: 89713
diff changeset
114 (list-character-sets-1 sort-key)))))
27912
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
115
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
116 (defun list-character-sets-1 (sort-key)
88534
27fb0f57ffe3 Doc fixes.
Dave Love <fx@gnu.org>
parents: 88412
diff changeset
117 "Insert a list of character sets sorted by SORT-KEY.
27fb0f57ffe3 Doc fixes.
Dave Love <fx@gnu.org>
parents: 88412
diff changeset
118 SORT-KEY should be `name' or `iso-spec' (default `name')."
27912
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
119 (or sort-key
88534
27fb0f57ffe3 Doc fixes.
Dave Love <fx@gnu.org>
parents: 88412
diff changeset
120 (setq sort-key 'name))
27fb0f57ffe3 Doc fixes.
Dave Love <fx@gnu.org>
parents: 88412
diff changeset
121 (let ((tail charset-list)
89799
694e157b2143 (list-character-sets): Fix the first line message.
Kenichi Handa <handa@m17n.org>
parents: 89713
diff changeset
122 charset-info-list supplementary-list charset sort-func)
88534
27fb0f57ffe3 Doc fixes.
Dave Love <fx@gnu.org>
parents: 88412
diff changeset
123 (dolist (charset charset-list)
27912
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
124 ;; Generate a list that contains all information to display.
89799
694e157b2143 (list-character-sets): Fix the first line message.
Kenichi Handa <handa@m17n.org>
parents: 89713
diff changeset
125 (let ((elt (list charset
694e157b2143 (list-character-sets): Fix the first line message.
Kenichi Handa <handa@m17n.org>
parents: 89713
diff changeset
126 (charset-dimension charset)
694e157b2143 (list-character-sets): Fix the first line message.
Kenichi Handa <handa@m17n.org>
parents: 89713
diff changeset
127 (charset-chars charset)
694e157b2143 (list-character-sets): Fix the first line message.
Kenichi Handa <handa@m17n.org>
parents: 89713
diff changeset
128 (charset-iso-final-char charset))))
694e157b2143 (list-character-sets): Fix the first line message.
Kenichi Handa <handa@m17n.org>
parents: 89713
diff changeset
129 (if (plist-get (charset-plist charset) :supplementary-p)
694e157b2143 (list-character-sets): Fix the first line message.
Kenichi Handa <handa@m17n.org>
parents: 89713
diff changeset
130 (push elt supplementary-list)
694e157b2143 (list-character-sets): Fix the first line message.
Kenichi Handa <handa@m17n.org>
parents: 89713
diff changeset
131 (push elt charset-info-list))))
27912
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
132
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
133 ;; Determine a predicate for `sort' by SORT-KEY.
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
134 (setq sort-func
88534
27fb0f57ffe3 Doc fixes.
Dave Love <fx@gnu.org>
parents: 88412
diff changeset
135 (cond ((eq sort-key 'name)
27fb0f57ffe3 Doc fixes.
Dave Love <fx@gnu.org>
parents: 88412
diff changeset
136 (lambda (x y) (string< (car x) (car y))))
27912
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
137
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
138 ((eq sort-key 'iso-spec)
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
139 ;; Sort by DIMENSION CHARS FINAL-CHAR
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
140 (function
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
141 (lambda (x y)
88534
27fb0f57ffe3 Doc fixes.
Dave Love <fx@gnu.org>
parents: 88412
diff changeset
142 (or (< (nth 1 x) (nth 1 y))
27fb0f57ffe3 Doc fixes.
Dave Love <fx@gnu.org>
parents: 88412
diff changeset
143 (and (= (nth 1 x) (nth 1 y))
27fb0f57ffe3 Doc fixes.
Dave Love <fx@gnu.org>
parents: 88412
diff changeset
144 (or (< (nth 2 x) (nth 2 y))
27fb0f57ffe3 Doc fixes.
Dave Love <fx@gnu.org>
parents: 88412
diff changeset
145 (and (= (nth 2 x) (nth 2 y))
27fb0f57ffe3 Doc fixes.
Dave Love <fx@gnu.org>
parents: 88412
diff changeset
146 (< (nth 3 x) (nth 3 y)))))))))
27912
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
147 (t
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
148 (error "Invalid charset sort key: %s" sort-key))))
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
149
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
150 (setq charset-info-list (sort charset-info-list sort-func))
89799
694e157b2143 (list-character-sets): Fix the first line message.
Kenichi Handa <handa@m17n.org>
parents: 89713
diff changeset
151 (setq supplementary-list (sort supplementary-list sort-func))
27912
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
152
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
153 ;; Insert information of character sets.
89799
694e157b2143 (list-character-sets): Fix the first line message.
Kenichi Handa <handa@m17n.org>
parents: 89713
diff changeset
154 (dolist (elt (append charset-info-list (list t) supplementary-list))
694e157b2143 (list-character-sets): Fix the first line message.
Kenichi Handa <handa@m17n.org>
parents: 89713
diff changeset
155 (if (eq elt t)
103451
16c3fe546430 (list-character-sets): Change
Kenichi Handa <handa@m17n.org>
parents: 103178
diff changeset
156 (progn
16c3fe546430 (list-character-sets): Change
Kenichi Handa <handa@m17n.org>
parents: 103178
diff changeset
157 (insert "\n-------------- ")
16c3fe546430 (list-character-sets): Change
Kenichi Handa <handa@m17n.org>
parents: 103178
diff changeset
158 (insert-text-button "Supplementary Character Sets"
16c3fe546430 (list-character-sets): Change
Kenichi Handa <handa@m17n.org>
parents: 103178
diff changeset
159 'type 'help-info
16c3fe546430 (list-character-sets): Change
Kenichi Handa <handa@m17n.org>
parents: 103178
diff changeset
160 'help-args '("(emacs)Charsets"))
16c3fe546430 (list-character-sets): Change
Kenichi Handa <handa@m17n.org>
parents: 103178
diff changeset
161 (insert " --------------
105818
6251a7f3c0a4 * international/mule-diag.el (list-character-sets-1): Minor
Chong Yidong <cyd@stupidchicken.com>
parents: 105372
diff changeset
162 Character sets for defining other charsets, or for backward compatibility
103451
16c3fe546430 (list-character-sets): Change
Kenichi Handa <handa@m17n.org>
parents: 103178
diff changeset
163 "))
89799
694e157b2143 (list-character-sets): Fix the first line message.
Kenichi Handa <handa@m17n.org>
parents: 89713
diff changeset
164 (insert-text-button (symbol-name (car elt)) ; NAME
694e157b2143 (list-character-sets): Fix the first line message.
Kenichi Handa <handa@m17n.org>
parents: 89713
diff changeset
165 :type 'list-charset-chars
694e157b2143 (list-character-sets): Fix the first line message.
Kenichi Handa <handa@m17n.org>
parents: 89713
diff changeset
166 'help-args (list (car elt)))
694e157b2143 (list-character-sets): Fix the first line message.
Kenichi Handa <handa@m17n.org>
parents: 89713
diff changeset
167 (goto-char (point-max))
694e157b2143 (list-character-sets): Fix the first line message.
Kenichi Handa <handa@m17n.org>
parents: 89713
diff changeset
168 (insert "\t")
694e157b2143 (list-character-sets): Fix the first line message.
Kenichi Handa <handa@m17n.org>
parents: 89713
diff changeset
169 (indent-to 48)
694e157b2143 (list-character-sets): Fix the first line message.
Kenichi Handa <handa@m17n.org>
parents: 89713
diff changeset
170 (insert (format "%d %3d "
694e157b2143 (list-character-sets): Fix the first line message.
Kenichi Handa <handa@m17n.org>
parents: 89713
diff changeset
171 (nth 1 elt) (nth 2 elt)) ; DIMENSION and CHARS
694e157b2143 (list-character-sets): Fix the first line message.
Kenichi Handa <handa@m17n.org>
parents: 89713
diff changeset
172 (if (< (nth 3 elt) 0)
694e157b2143 (list-character-sets): Fix the first line message.
Kenichi Handa <handa@m17n.org>
parents: 89713
diff changeset
173 "none"
694e157b2143 (list-character-sets): Fix the first line message.
Kenichi Handa <handa@m17n.org>
parents: 89713
diff changeset
174 (nth 3 elt)))) ; FINAL-CHAR
27912
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
175 (insert "\n"))))
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
176
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
177
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
178 ;; 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
179
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
180 (defun list-character-sets-2 ()
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
181 (insert "#########################
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
182 ## LIST OF CHARSETS
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
183 ## Each line corresponds to one charset.
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
184 ## The following attributes are listed in this order
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
185 ## separated by a colon `:' in one line.
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
186 ## CHARSET-SYMBOL-NAME,
100212
8770d8ed68e4 * international/mule-diag.el (list-character-sets): Doc fix.
Juanma Barranquero <lekktu@gmail.com>
parents: 100194
diff changeset
187 ## DIMENSION (1-4)
8770d8ed68e4 * international/mule-diag.el (list-character-sets): Doc fix.
Juanma Barranquero <lekktu@gmail.com>
parents: 100194
diff changeset
188 ## CHARS (number of characters in first dimension of charset)
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
189 ## ISO-FINAL-CHAR (character code of ISO-2022's final character)
90742
d12279146267 (list-character-sets-2): Don't print
Kenichi Handa <handa@m17n.org>
parents: 90737
diff changeset
190 ## -1 means that no final character is assigned.
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
191 ## DESCRIPTION (describing string of the charset)
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
192 ")
100212
8770d8ed68e4 * international/mule-diag.el (list-character-sets): Doc fix.
Juanma Barranquero <lekktu@gmail.com>
parents: 100194
diff changeset
193 (dolist (charset charset-list)
8770d8ed68e4 * international/mule-diag.el (list-character-sets): Doc fix.
Juanma Barranquero <lekktu@gmail.com>
parents: 100194
diff changeset
194 (princ (format "%s:%d:%d:%d:%s\n"
8770d8ed68e4 * international/mule-diag.el (list-character-sets): Doc fix.
Juanma Barranquero <lekktu@gmail.com>
parents: 100194
diff changeset
195 charset
8770d8ed68e4 * international/mule-diag.el (list-character-sets): Doc fix.
Juanma Barranquero <lekktu@gmail.com>
parents: 100194
diff changeset
196 (charset-dimension charset)
8770d8ed68e4 * international/mule-diag.el (list-character-sets): Doc fix.
Juanma Barranquero <lekktu@gmail.com>
parents: 100194
diff changeset
197 (charset-chars charset)
8770d8ed68e4 * international/mule-diag.el (list-character-sets): Doc fix.
Juanma Barranquero <lekktu@gmail.com>
parents: 100194
diff changeset
198 ;;; (char-width (make-char charset))
8770d8ed68e4 * international/mule-diag.el (list-character-sets): Doc fix.
Juanma Barranquero <lekktu@gmail.com>
parents: 100194
diff changeset
199 ;;; (charset-direction charset)
8770d8ed68e4 * international/mule-diag.el (list-character-sets): Doc fix.
Juanma Barranquero <lekktu@gmail.com>
parents: 100194
diff changeset
200 (charset-iso-final-char charset)
8770d8ed68e4 * international/mule-diag.el (list-character-sets): Doc fix.
Juanma Barranquero <lekktu@gmail.com>
parents: 100194
diff changeset
201 ;;; (charset-iso-graphic-plane charset)
8770d8ed68e4 * international/mule-diag.el (list-character-sets): Doc fix.
Juanma Barranquero <lekktu@gmail.com>
parents: 100194
diff changeset
202 (charset-description charset)))))
27912
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
203
88534
27fb0f57ffe3 Doc fixes.
Dave Love <fx@gnu.org>
parents: 88412
diff changeset
204 (defvar non-iso-charset-alist nil
27fb0f57ffe3 Doc fixes.
Dave Love <fx@gnu.org>
parents: 88412
diff changeset
205 "Obsolete.")
94154
2b060bb498d6 (non-iso-charset-alist): Fix typo in obsolescence declaration.
Juanma Barranquero <lekktu@gmail.com>
parents: 93975
diff changeset
206 (make-obsolete-variable 'non-iso-charset-alist "no longer relevant." "23.1")
27912
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
207
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
208 (defun decode-codepage-char (codepage code)
43231
06e0fbd07e17 Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents: 42362
diff changeset
209 "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
210 Return a decoded character string. Each CODEPAGE corresponds to a
94154
2b060bb498d6 (non-iso-charset-alist): Fix typo in obsolescence declaration.
Juanma Barranquero <lekktu@gmail.com>
parents: 93975
diff changeset
211 coding system cpCODEPAGE."
88534
27fb0f57ffe3 Doc fixes.
Dave Love <fx@gnu.org>
parents: 88412
diff changeset
212 (decode-char (intern (format "cp%d" codepage)) code))
90104
a01e7a9f1659 Revision: miles@gnu.org--gnu-2005/emacs--unicode--0--patch-14
Miles Bader <miles@gnu.org>
parents: 89943
diff changeset
213 (make-obsolete 'decode-codepage-char 'decode-char "23.1")
27912
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
214
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
215 ;; A variable to hold charset input history.
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
216 (defvar charset-history nil)
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
217
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
218
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
219 ;;;###autoload
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
220 (defun read-charset (prompt &optional default-value initial-input)
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
221 "Read a character set from the minibuffer, prompting with string PROMPT.
88534
27fb0f57ffe3 Doc fixes.
Dave Love <fx@gnu.org>
parents: 88412
diff changeset
222 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
223
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
224 Optional arguments are DEFAULT-VALUE and INITIAL-INPUT.
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
225 DEFAULT-VALUE, if non-nil, is the default value.
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
226 INITIAL-INPUT, if non-nil, is a string inserted in the minibuffer initially.
100194
f76e0ce31e62 * international/mule-diag.el (unicodedata-file, unicode-data): Remove.
Juanma Barranquero <lekktu@gmail.com>
parents: 97914
diff changeset
227 See the documentation of the function `completing-read' for the detailed
f76e0ce31e62 * international/mule-diag.el (unicodedata-file, unicode-data): Remove.
Juanma Barranquero <lekktu@gmail.com>
parents: 97914
diff changeset
228 meanings of these arguments."
88534
27fb0f57ffe3 Doc fixes.
Dave Love <fx@gnu.org>
parents: 88412
diff changeset
229 (let* ((table (mapcar (lambda (x) (list (symbol-name x))) charset-list))
27912
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
230 (charset (completing-read prompt table
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
231 nil t initial-input 'charset-history
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
232 default-value)))
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
233 (if (> (length charset) 0)
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
234 (intern charset))))
30765
1e5a486b8b25 punctuation fixes in doc strings
Sam Steingold <sds@gnu.org>
parents: 30126
diff changeset
235
27912
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
236 ;; 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
237 ;; 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
238 ;; (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
239 ;; bytes of the characters. If the dimension is one, ROW should be 0.
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
240
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
241 (defun list-block-of-chars (charset row min max)
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
242 (let (i ch)
89713
dd442ee53657 (stretches-for-character-list): Delete it.
Kenichi Handa <handa@m17n.org>
parents: 89498
diff changeset
243 (insert-char ?- (+ 7 (* 4 16)))
dd442ee53657 (stretches-for-character-list): Delete it.
Kenichi Handa <handa@m17n.org>
parents: 89498
diff changeset
244 (insert "\n ")
27912
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
245 (setq i 0)
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
246 (while (< i 16)
89483
2f877ed80fa6 *** empty log message ***
Kenichi Handa <handa@m17n.org>
parents: 88123 89412
diff changeset
247 (insert (format "%4X" i))
27912
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
248 (setq i (1+ i)))
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
249 (setq i (* (/ min 16) 16))
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
250 (while (<= i max)
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
251 (if (= (% i 16) 0)
89713
dd442ee53657 (stretches-for-character-list): Delete it.
Kenichi Handa <handa@m17n.org>
parents: 89498
diff changeset
252 (insert (format "\n%6Xx" (/ (+ (* row 256) i) 16))))
89483
2f877ed80fa6 *** empty log message ***
Kenichi Handa <handa@m17n.org>
parents: 88123 89412
diff changeset
253 (setq ch (if (< i min)
2f877ed80fa6 *** empty log message ***
Kenichi Handa <handa@m17n.org>
parents: 88123 89412
diff changeset
254 32
2f877ed80fa6 *** empty log message ***
Kenichi Handa <handa@m17n.org>
parents: 88123 89412
diff changeset
255 (or (decode-char charset (+ (* row 256) i))
2f877ed80fa6 *** empty log message ***
Kenichi Handa <handa@m17n.org>
parents: 88123 89412
diff changeset
256 32))) ; gap in mapping
91067
4edb36b0e1cf (list-block-of-chars): Don't insert non-Unicode characters.
Kenichi Handa <handa@m17n.org>
parents: 91041
diff changeset
257 ;; Don't insert control codes, non-Unicode characters.
89483
2f877ed80fa6 *** empty log message ***
Kenichi Handa <handa@m17n.org>
parents: 88123 89412
diff changeset
258 (if (or (< ch 32) (= ch 127))
2f877ed80fa6 *** empty log message ***
Kenichi Handa <handa@m17n.org>
parents: 88123 89412
diff changeset
259 (setq ch (single-key-description ch))
2f877ed80fa6 *** empty log message ***
Kenichi Handa <handa@m17n.org>
parents: 88123 89412
diff changeset
260 (if (and (>= ch 128) (< ch 160))
91067
4edb36b0e1cf (list-block-of-chars): Don't insert non-Unicode characters.
Kenichi Handa <handa@m17n.org>
parents: 91041
diff changeset
261 (setq ch (format "%02Xh" ch))
4edb36b0e1cf (list-block-of-chars): Don't insert non-Unicode characters.
Kenichi Handa <handa@m17n.org>
parents: 91041
diff changeset
262 (if (> ch #x10FFFF)
4edb36b0e1cf (list-block-of-chars): Don't insert non-Unicode characters.
Kenichi Handa <handa@m17n.org>
parents: 91041
diff changeset
263 (setq ch 32))))
89713
dd442ee53657 (stretches-for-character-list): Delete it.
Kenichi Handa <handa@m17n.org>
parents: 89498
diff changeset
264 (insert "\t" ch)
27912
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
265 (setq i (1+ i))))
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
266 (insert "\n"))
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 ;;;###autoload
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
269 (defun list-charset-chars (charset)
88540
875760cbcb15 (list-character-sets-2): Avoid
Dave Love <fx@gnu.org>
parents: 88537
diff changeset
270 "Display a list of characters in character set CHARSET."
27912
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
271 (interactive (list (read-charset "Character set: ")))
89799
694e157b2143 (list-character-sets): Fix the first line message.
Kenichi Handa <handa@m17n.org>
parents: 89713
diff changeset
272 (or (charsetp charset)
694e157b2143 (list-character-sets): Fix the first line message.
Kenichi Handa <handa@m17n.org>
parents: 89713
diff changeset
273 (error "Invalid character set: %s" charset))
47603
28c9630ee23e (list-character-sets): Use the buffer
Kenichi Handa <handa@m17n.org>
parents: 47548
diff changeset
274 (with-output-to-temp-buffer "*Character List*"
27912
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
275 (with-current-buffer standard-output
89498
bc83bb07e632 (list-charset-chars): Set buffer file
Dave Love <fx@gnu.org>
parents: 89483
diff changeset
276 (if (coding-system-p charset)
bc83bb07e632 (list-charset-chars): Set buffer file
Dave Love <fx@gnu.org>
parents: 89483
diff changeset
277 ;; Useful to be able to do C-u C-x = to find file code, for
bc83bb07e632 (list-charset-chars): Set buffer file
Dave Love <fx@gnu.org>
parents: 89483
diff changeset
278 ;; instance:
bc83bb07e632 (list-charset-chars): Set buffer file
Dave Love <fx@gnu.org>
parents: 89483
diff changeset
279 (set-buffer-file-coding-system charset))
47603
28c9630ee23e (list-character-sets): Use the buffer
Kenichi Handa <handa@m17n.org>
parents: 47548
diff changeset
280 (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
281 (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
282 (if slot
28c9630ee23e (list-character-sets): Use the buffer
Kenichi Handa <handa@m17n.org>
parents: 47548
diff changeset
283 (setcdr slot
28c9630ee23e (list-character-sets): Use the buffer
Kenichi Handa <handa@m17n.org>
parents: 47548
diff changeset
284 (cons (format " (%s)" charset)
28c9630ee23e (list-character-sets): Use the buffer
Kenichi Handa <handa@m17n.org>
parents: 47548
diff changeset
285 (cdr slot)))))
89713
dd442ee53657 (stretches-for-character-list): Delete it.
Kenichi Handa <handa@m17n.org>
parents: 89498
diff changeset
286 (setq tab-width 4)
27912
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
287 (set-buffer-multibyte t)
88540
875760cbcb15 (list-character-sets-2): Avoid
Dave Love <fx@gnu.org>
parents: 88537
diff changeset
288 (let ((dim (charset-dimension charset))
875760cbcb15 (list-character-sets-2): Avoid
Dave Love <fx@gnu.org>
parents: 88537
diff changeset
289 (chars (charset-chars charset))
875760cbcb15 (list-character-sets-2): Avoid
Dave Love <fx@gnu.org>
parents: 88537
diff changeset
290 ;; (plane (charset-iso-graphic-plane charset))
875760cbcb15 (list-character-sets-2): Avoid
Dave Love <fx@gnu.org>
parents: 88537
diff changeset
291 (plane 1)
875760cbcb15 (list-character-sets-2): Avoid
Dave Love <fx@gnu.org>
parents: 88537
diff changeset
292 (range (plist-get (charset-plist charset) :code-space))
875760cbcb15 (list-character-sets-2): Avoid
Dave Love <fx@gnu.org>
parents: 88537
diff changeset
293 min max min2 max2)
875760cbcb15 (list-character-sets-2): Avoid
Dave Love <fx@gnu.org>
parents: 88537
diff changeset
294 (if (> dim 2)
875760cbcb15 (list-character-sets-2): Avoid
Dave Love <fx@gnu.org>
parents: 88537
diff changeset
295 (error "Can only list 1- and 2-dimensional charsets"))
875760cbcb15 (list-character-sets-2): Avoid
Dave Love <fx@gnu.org>
parents: 88537
diff changeset
296 (insert (format "Characters in the coded character set %s.\n" charset))
89807
9b7ce1c86476 (list-charset-chars): Put charset text property.
Kenichi Handa <handa@m17n.org>
parents: 89799
diff changeset
297 (narrow-to-region (point) (point))
88540
875760cbcb15 (list-character-sets-2): Avoid
Dave Love <fx@gnu.org>
parents: 88537
diff changeset
298 (setq min (aref range 0)
875760cbcb15 (list-character-sets-2): Avoid
Dave Love <fx@gnu.org>
parents: 88537
diff changeset
299 max (aref range 1))
875760cbcb15 (list-character-sets-2): Avoid
Dave Love <fx@gnu.org>
parents: 88537
diff changeset
300 (if (= dim 1)
875760cbcb15 (list-character-sets-2): Avoid
Dave Love <fx@gnu.org>
parents: 88537
diff changeset
301 (list-block-of-chars charset 0 min max)
875760cbcb15 (list-character-sets-2): Avoid
Dave Love <fx@gnu.org>
parents: 88537
diff changeset
302 (setq min2 (aref range 2)
875760cbcb15 (list-character-sets-2): Avoid
Dave Love <fx@gnu.org>
parents: 88537
diff changeset
303 max2 (aref range 3))
875760cbcb15 (list-character-sets-2): Avoid
Dave Love <fx@gnu.org>
parents: 88537
diff changeset
304 (let ((i min2))
875760cbcb15 (list-character-sets-2): Avoid
Dave Love <fx@gnu.org>
parents: 88537
diff changeset
305 (while (<= i max2)
875760cbcb15 (list-character-sets-2): Avoid
Dave Love <fx@gnu.org>
parents: 88537
diff changeset
306 (list-block-of-chars charset i min max)
89807
9b7ce1c86476 (list-charset-chars): Put charset text property.
Kenichi Handa <handa@m17n.org>
parents: 89799
diff changeset
307 (setq i (1+ i)))))
9b7ce1c86476 (list-charset-chars): Put charset text property.
Kenichi Handa <handa@m17n.org>
parents: 89799
diff changeset
308 (put-text-property (point-min) (point-max) 'charset charset)
9b7ce1c86476 (list-charset-chars): Put charset text property.
Kenichi Handa <handa@m17n.org>
parents: 89799
diff changeset
309 (widen)))))
27912
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
310
28899
133a92b8094d (syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents: 28216
diff changeset
311
133a92b8094d (syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents: 28216
diff changeset
312 ;;;###autoload
31246
d8ce7bce2aab (charset-multibyte-form-string): New function.
Kenichi Handa <handa@m17n.org>
parents: 30765
diff changeset
313 (defun describe-character-set (charset)
43231
06e0fbd07e17 Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents: 42362
diff changeset
314 "Display information about built-in character set CHARSET."
88534
27fb0f57ffe3 Doc fixes.
Dave Love <fx@gnu.org>
parents: 88412
diff changeset
315 (interactive (list (read-charset "Charset: ")))
31246
d8ce7bce2aab (charset-multibyte-form-string): New function.
Kenichi Handa <handa@m17n.org>
parents: 30765
diff changeset
316 (or (charsetp charset)
d8ce7bce2aab (charset-multibyte-form-string): New function.
Kenichi Handa <handa@m17n.org>
parents: 30765
diff changeset
317 (error "Invalid charset: %S" charset))
105372
bd2966850aac Use `called-interactively-p' instead of `interactive-p'.
Juanma Barranquero <lekktu@gmail.com>
parents: 104823
diff changeset
318 (help-setup-xref (list #'describe-character-set charset)
bd2966850aac Use `called-interactively-p' instead of `interactive-p'.
Juanma Barranquero <lekktu@gmail.com>
parents: 104823
diff changeset
319 (called-interactively-p 'interactive))
88537
4668340a1e0d (list-character-sets-1): Fix last change.
Dave Love <fx@gnu.org>
parents: 88534
diff changeset
320 (with-output-to-temp-buffer (help-buffer)
4668340a1e0d (list-character-sets-1): Fix last change.
Dave Love <fx@gnu.org>
parents: 88534
diff changeset
321 (with-current-buffer standard-output
88637
10c911c19787 (print-coding-system): (Incomplete)
Dave Love <fx@gnu.org>
parents: 88566
diff changeset
322 (insert "Character set: " (symbol-name charset))
10c911c19787 (print-coding-system): (Incomplete)
Dave Love <fx@gnu.org>
parents: 88566
diff changeset
323 (let ((name (get-charset-property charset :name)))
10c911c19787 (print-coding-system): (Incomplete)
Dave Love <fx@gnu.org>
parents: 88566
diff changeset
324 (if (not (eq name charset))
10c911c19787 (print-coding-system): (Incomplete)
Dave Love <fx@gnu.org>
parents: 88566
diff changeset
325 (insert " (alias of " (symbol-name name) ?\))))
10c911c19787 (print-coding-system): (Incomplete)
Dave Love <fx@gnu.org>
parents: 88566
diff changeset
326 (insert "\n\n" (charset-description charset) "\n\n")
88701
c68f88e42678 (describe-character-set): Account for
Dave Love <fx@gnu.org>
parents: 88655
diff changeset
327 (insert "Number of contained characters: ")
c68f88e42678 (describe-character-set): Account for
Dave Love <fx@gnu.org>
parents: 88655
diff changeset
328 (dotimes (i (charset-dimension charset))
c68f88e42678 (describe-character-set): Account for
Dave Love <fx@gnu.org>
parents: 88655
diff changeset
329 (unless (= i 0)
89904
76c449b624ad Sync to HEAD.
Kenichi Handa <handa@m17n.org>
parents: 89807
diff changeset
330 (insert ?x))
89412
afe83cde22dd (describe-character-set): Fix
Dave Love <fx@gnu.org>
parents: 89369
diff changeset
331 (insert (format "%d" (charset-chars charset (1+ i)))))
88701
c68f88e42678 (describe-character-set): Account for
Dave Love <fx@gnu.org>
parents: 88655
diff changeset
332 (insert ?\n)
88637
10c911c19787 (print-coding-system): (Incomplete)
Dave Love <fx@gnu.org>
parents: 88566
diff changeset
333 (let ((char (charset-iso-final-char charset)))
10c911c19787 (print-coding-system): (Incomplete)
Dave Love <fx@gnu.org>
parents: 88566
diff changeset
334 (when (> char 0)
10c911c19787 (print-coding-system): (Incomplete)
Dave Love <fx@gnu.org>
parents: 88566
diff changeset
335 (insert "Final char of ISO2022 designation sequence: ")
10c911c19787 (print-coding-system): (Incomplete)
Dave Love <fx@gnu.org>
parents: 88566
diff changeset
336 (insert (format "`%c'\n" char))))
10c911c19787 (print-coding-system): (Incomplete)
Dave Love <fx@gnu.org>
parents: 88566
diff changeset
337 (let (aliases)
10c911c19787 (print-coding-system): (Incomplete)
Dave Love <fx@gnu.org>
parents: 88566
diff changeset
338 (dolist (c charset-list)
10c911c19787 (print-coding-system): (Incomplete)
Dave Love <fx@gnu.org>
parents: 88566
diff changeset
339 (if (and (not (eq c charset))
10c911c19787 (print-coding-system): (Incomplete)
Dave Love <fx@gnu.org>
parents: 88566
diff changeset
340 (eq charset (get-charset-property c :name)))
10c911c19787 (print-coding-system): (Incomplete)
Dave Love <fx@gnu.org>
parents: 88566
diff changeset
341 (push c aliases)))
10c911c19787 (print-coding-system): (Incomplete)
Dave Love <fx@gnu.org>
parents: 88566
diff changeset
342 (if aliases
10c911c19787 (print-coding-system): (Incomplete)
Dave Love <fx@gnu.org>
parents: 88566
diff changeset
343 (insert "Aliases: " (mapconcat #'symbol-name aliases ", ") ?\n)))
94154
2b060bb498d6 (non-iso-charset-alist): Fix typo in obsolescence declaration.
Juanma Barranquero <lekktu@gmail.com>
parents: 93975
diff changeset
344
88637
10c911c19787 (print-coding-system): (Incomplete)
Dave Love <fx@gnu.org>
parents: 88566
diff changeset
345 (dolist (elt `((:ascii-compatible-p "ASCII compatible." nil)
10c911c19787 (print-coding-system): (Incomplete)
Dave Love <fx@gnu.org>
parents: 88566
diff changeset
346 (:map "Map file: " identity)
10c911c19787 (print-coding-system): (Incomplete)
Dave Love <fx@gnu.org>
parents: 88566
diff changeset
347 (:unify-map "Unification map file: " identity)
10c911c19787 (print-coding-system): (Incomplete)
Dave Love <fx@gnu.org>
parents: 88566
diff changeset
348 (:invalid-code
10c911c19787 (print-coding-system): (Incomplete)
Dave Love <fx@gnu.org>
parents: 88566
diff changeset
349 nil
10c911c19787 (print-coding-system): (Incomplete)
Dave Love <fx@gnu.org>
parents: 88566
diff changeset
350 ,(lambda (c)
10c911c19787 (print-coding-system): (Incomplete)
Dave Love <fx@gnu.org>
parents: 88566
diff changeset
351 (format "Invalid character: %c (code %d)" c c)))
10c911c19787 (print-coding-system): (Incomplete)
Dave Love <fx@gnu.org>
parents: 88566
diff changeset
352 (:emacs-mule-id "Id in emacs-mule coding system: "
10c911c19787 (print-coding-system): (Incomplete)
Dave Love <fx@gnu.org>
parents: 88566
diff changeset
353 number-to-string)
10c911c19787 (print-coding-system): (Incomplete)
Dave Love <fx@gnu.org>
parents: 88566
diff changeset
354 (:parents "Parents: "
10c911c19787 (print-coding-system): (Incomplete)
Dave Love <fx@gnu.org>
parents: 88566
diff changeset
355 (lambda (parents)
10c911c19787 (print-coding-system): (Incomplete)
Dave Love <fx@gnu.org>
parents: 88566
diff changeset
356 (mapconcat ,(lambda (elt)
10c911c19787 (print-coding-system): (Incomplete)
Dave Love <fx@gnu.org>
parents: 88566
diff changeset
357 (format "%s" elt))
10c911c19787 (print-coding-system): (Incomplete)
Dave Love <fx@gnu.org>
parents: 88566
diff changeset
358 parents
10c911c19787 (print-coding-system): (Incomplete)
Dave Love <fx@gnu.org>
parents: 88566
diff changeset
359 ", ")))
10c911c19787 (print-coding-system): (Incomplete)
Dave Love <fx@gnu.org>
parents: 88566
diff changeset
360 (:code-space "Code space: " ,(lambda (c)
10c911c19787 (print-coding-system): (Incomplete)
Dave Love <fx@gnu.org>
parents: 88566
diff changeset
361 (format "%s" c)))
10c911c19787 (print-coding-system): (Incomplete)
Dave Love <fx@gnu.org>
parents: 88566
diff changeset
362 (:code-offset "Code offset: " number-to-string)
10c911c19787 (print-coding-system): (Incomplete)
Dave Love <fx@gnu.org>
parents: 88566
diff changeset
363 (:iso-revision-number "ISO revision number: "
10c911c19787 (print-coding-system): (Incomplete)
Dave Love <fx@gnu.org>
parents: 88566
diff changeset
364 number-to-string)
10c911c19787 (print-coding-system): (Incomplete)
Dave Love <fx@gnu.org>
parents: 88566
diff changeset
365 (:supplementary-p
10c911c19787 (print-coding-system): (Incomplete)
Dave Love <fx@gnu.org>
parents: 88566
diff changeset
366 "Used only as a parent of some other charset." nil)))
10c911c19787 (print-coding-system): (Incomplete)
Dave Love <fx@gnu.org>
parents: 88566
diff changeset
367 (let ((val (get-charset-property charset (car elt))))
10c911c19787 (print-coding-system): (Incomplete)
Dave Love <fx@gnu.org>
parents: 88566
diff changeset
368 (when val
10c911c19787 (print-coding-system): (Incomplete)
Dave Love <fx@gnu.org>
parents: 88566
diff changeset
369 (if (cadr elt) (insert (cadr elt)))
10c911c19787 (print-coding-system): (Incomplete)
Dave Love <fx@gnu.org>
parents: 88566
diff changeset
370 (if (nth 2 elt)
110618
7019133063c8 international/mule-diag.el (describe-character-set): Use princ with proper print-length and print-level instead of insert.
Kenichi Handa <handa@m17n.org>
parents: 106815
diff changeset
371 (let ((print-length 10) (print-level 2))
7019133063c8 international/mule-diag.el (describe-character-set): Use princ with proper print-length and print-level instead of insert.
Kenichi Handa <handa@m17n.org>
parents: 106815
diff changeset
372 (princ (funcall (nth 2 elt) val) (current-buffer))))
88637
10c911c19787 (print-coding-system): (Incomplete)
Dave Love <fx@gnu.org>
parents: 88566
diff changeset
373 (insert ?\n)))))))
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
374
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
375 ;;; CODING-SYSTEM
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
376
95622
b4f1005a6470 Remove unnecessary eval-when-compiles.
Glenn Morris <rgm@gnu.org>
parents: 95405
diff changeset
377 (defvar graphic-register) ; dynamic bondage
88648
dd88ab5e7207 (describe-current-coding-system): Fix
Dave Love <fx@gnu.org>
parents: 88637
diff changeset
378
dd88ab5e7207 (describe-current-coding-system): Fix
Dave Love <fx@gnu.org>
parents: 88637
diff changeset
379 ;; Print information about designation of each graphic register in
dd88ab5e7207 (describe-current-coding-system): Fix
Dave Love <fx@gnu.org>
parents: 88637
diff changeset
380 ;; DESIGNATIONS in human readable format. See the documentation of
dd88ab5e7207 (describe-current-coding-system): Fix
Dave Love <fx@gnu.org>
parents: 88637
diff changeset
381 ;; `define-coding-system' for the meaning of DESIGNATIONS
dd88ab5e7207 (describe-current-coding-system): Fix
Dave Love <fx@gnu.org>
parents: 88637
diff changeset
382 ;; (`:designation' property).
dd88ab5e7207 (describe-current-coding-system): Fix
Dave Love <fx@gnu.org>
parents: 88637
diff changeset
383 (defun print-designation (designations)
dd88ab5e7207 (describe-current-coding-system): Fix
Dave Love <fx@gnu.org>
parents: 88637
diff changeset
384 (let (charset)
dd88ab5e7207 (describe-current-coding-system): Fix
Dave Love <fx@gnu.org>
parents: 88637
diff changeset
385 (dotimes (graphic-register 4)
dd88ab5e7207 (describe-current-coding-system): Fix
Dave Love <fx@gnu.org>
parents: 88637
diff changeset
386 (setq charset (aref designations graphic-register))
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
387 (princ (format
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
388 " G%d -- %s\n"
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
389 graphic-register
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
390 (cond ((null charset)
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
391 "never used")
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
392 ((eq charset t)
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
393 "no initial designation, and used by any charsets")
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
394 ((symbolp charset)
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
395 (format "%s:%s"
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
396 charset (charset-description charset)))
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
397 ((listp charset)
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
398 (if (charsetp (car charset))
52433
875975e6fae5 (non-iso-charset-alist): Define as
Dave Love <fx@gnu.org>
parents: 52401
diff changeset
399 (format "%s:%s, and also used by the following:"
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
400 (car charset)
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
401 (charset-description (car charset)))
52433
875975e6fae5 (non-iso-charset-alist): Define as
Dave Love <fx@gnu.org>
parents: 52401
diff changeset
402 "no initial designation, and used by the following:"))
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
403 (t
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
404 "invalid designation information"))))
18559
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
405 (when (listp charset)
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
406 (setq charset (cdr charset))
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
407 (while charset
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
408 (cond ((eq (car charset) t)
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
409 (princ "\tany other charsets\n"))
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
410 ((charsetp (car charset))
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
411 (princ (format "\t%s:%s\n"
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
412 (car charset)
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
413 (charset-description (car charset)))))
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
414 (t
30765
1e5a486b8b25 punctuation fixes in doc strings
Sam Steingold <sds@gnu.org>
parents: 30126
diff changeset
415 "invalid designation information"))
88648
dd88ab5e7207 (describe-current-coding-system): Fix
Dave Love <fx@gnu.org>
parents: 88637
diff changeset
416 (setq charset (cdr charset)))))))
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
417
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
418 ;;;###autoload
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
419 (defun describe-coding-system (coding-system)
22306
6819832df39b Many doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 22290
diff changeset
420 "Display information about CODING-SYSTEM."
65680
ed770a0a7846 2005-09-24 Emilio C. Lopes <eclig@gmx.net>
Romain Francoise <romain@orebokech.com>
parents: 64085
diff changeset
421 (interactive "zDescribe coding system (default current choices): ")
18300
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
422 (if (null coding-system)
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
423 (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
424 (help-setup-xref (list #'describe-coding-system coding-system)
105372
bd2966850aac Use `called-interactively-p' instead of `interactive-p'.
Juanma Barranquero <lekktu@gmail.com>
parents: 104823
diff changeset
425 (called-interactively-p 'interactive))
40664
4e5f8e42b8d1 (list-character-sets, sort-listed-character-sets, describe-character-set)
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 40639
diff changeset
426 (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
427 (print-coding-system-briefly coding-system 'doc-string)
47548
698b4a4bb562 (describe-coding-system): Remove unused `coding-spec' variable.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 46490
diff changeset
428 (let ((type (coding-system-type coding-system))
89483
2f877ed80fa6 *** empty log message ***
Kenichi Handa <handa@m17n.org>
parents: 88123 89412
diff changeset
429 ;; Fixme: use this
2f877ed80fa6 *** empty log message ***
Kenichi Handa <handa@m17n.org>
parents: 88123 89412
diff changeset
430 (extra-spec (coding-system-plist coding-system)))
18300
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
431 (princ "Type: ")
47548
698b4a4bb562 (describe-coding-system): Remove unused `coding-spec' variable.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 46490
diff changeset
432 (princ type)
88412
524f9b5b2ac5 (print-designation): Arguments changed.
Kenichi Handa <handa@m17n.org>
parents: 43292
diff changeset
433 (cond ((eq type 'undecided)
47548
698b4a4bb562 (describe-coding-system): Remove unused `coding-spec' variable.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 46490
diff changeset
434 (princ " (do automatic conversion)"))
88412
524f9b5b2ac5 (print-designation): Arguments changed.
Kenichi Handa <handa@m17n.org>
parents: 43292
diff changeset
435 ((eq type 'utf-8)
524f9b5b2ac5 (print-designation): Arguments changed.
Kenichi Handa <handa@m17n.org>
parents: 43292
diff changeset
436 (princ " (UTF-8: Emacs internal multibyte form)"))
88993
a7223f475d71 (describe-coding-system): Add utf-16
Dave Love <fx@gnu.org>
parents: 88895
diff changeset
437 ((eq type 'utf-16)
a7223f475d71 (describe-coding-system): Add utf-16
Dave Love <fx@gnu.org>
parents: 88895
diff changeset
438 ;; (princ " (UTF-16)")
a7223f475d71 (describe-coding-system): Add utf-16
Dave Love <fx@gnu.org>
parents: 88895
diff changeset
439 )
88648
dd88ab5e7207 (describe-current-coding-system): Fix
Dave Love <fx@gnu.org>
parents: 88637
diff changeset
440 ((eq type 'shift-jis)
47548
698b4a4bb562 (describe-coding-system): Remove unused `coding-spec' variable.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 46490
diff changeset
441 (princ " (Shift-JIS, MS-KANJI)"))
88412
524f9b5b2ac5 (print-designation): Arguments changed.
Kenichi Handa <handa@m17n.org>
parents: 43292
diff changeset
442 ((eq type 'iso-2022)
47548
698b4a4bb562 (describe-coding-system): Remove unused `coding-spec' variable.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 46490
diff changeset
443 (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
444 (princ "Initial designations:\n")
88648
dd88ab5e7207 (describe-current-coding-system): Fix
Dave Love <fx@gnu.org>
parents: 88637
diff changeset
445 (print-designation (coding-system-get coding-system
dd88ab5e7207 (describe-current-coding-system): Fix
Dave Love <fx@gnu.org>
parents: 88637
diff changeset
446 :designation))
dd88ab5e7207 (describe-current-coding-system): Fix
Dave Love <fx@gnu.org>
parents: 88637
diff changeset
447
dd88ab5e7207 (describe-current-coding-system): Fix
Dave Love <fx@gnu.org>
parents: 88637
diff changeset
448 (when (coding-system-get coding-system :flags)
dd88ab5e7207 (describe-current-coding-system): Fix
Dave Love <fx@gnu.org>
parents: 88637
diff changeset
449 (princ "Other specifications: \n ")
dd88ab5e7207 (describe-current-coding-system): Fix
Dave Love <fx@gnu.org>
parents: 88637
diff changeset
450 (apply #'print-list
dd88ab5e7207 (describe-current-coding-system): Fix
Dave Love <fx@gnu.org>
parents: 88637
diff changeset
451 (coding-system-get coding-system :flags))))
88412
524f9b5b2ac5 (print-designation): Arguments changed.
Kenichi Handa <handa@m17n.org>
parents: 43292
diff changeset
452 ((eq type 'charset)
524f9b5b2ac5 (print-designation): Arguments changed.
Kenichi Handa <handa@m17n.org>
parents: 43292
diff changeset
453 (princ " (charset)"))
524f9b5b2ac5 (print-designation): Arguments changed.
Kenichi Handa <handa@m17n.org>
parents: 43292
diff changeset
454 ((eq type 'ccl)
47548
698b4a4bb562 (describe-coding-system): Remove unused `coding-spec' variable.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 46490
diff changeset
455 (princ " (do conversion by CCL program)"))
88412
524f9b5b2ac5 (print-designation): Arguments changed.
Kenichi Handa <handa@m17n.org>
parents: 43292
diff changeset
456 ((eq type 'raw-text)
47548
698b4a4bb562 (describe-coding-system): Remove unused `coding-spec' variable.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 46490
diff changeset
457 (princ " (text with random binary characters)"))
88566
2c3cb7fbba2a (describe-coding-system): Avoid error
Dave Love <fx@gnu.org>
parents: 88542
diff changeset
458 ((eq type 'emacs-mule)
2c3cb7fbba2a (describe-coding-system): Avoid error
Dave Love <fx@gnu.org>
parents: 88542
diff changeset
459 (princ " (Emacs 21 internal encoding)"))
103178
4f9eafb38e10 (describe-coding-system): Fix for big5.
Kenichi Handa <handa@m17n.org>
parents: 102934
diff changeset
460 ((eq type 'big5))
88412
524f9b5b2ac5 (print-designation): Arguments changed.
Kenichi Handa <handa@m17n.org>
parents: 43292
diff changeset
461 (t (princ ": invalid coding-system.")))
20163
5ff1329561b4 (list-input-methods): Handle the case
Kenichi Handa <handa@m17n.org>
parents: 20114
diff changeset
462 (princ "\nEOL type: ")
18300
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
463 (let ((eol-type (coding-system-eol-type coding-system)))
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
464 (cond ((vectorp eol-type)
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
465 (princ "Automatic selection from:\n\t")
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
466 (princ eol-type)
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
467 (princ "\n"))
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
468 ((or (null eol-type) (eq eol-type 0)) (princ "LF\n"))
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
469 ((eq eol-type 1) (princ "CRLF\n"))
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
470 ((eq eol-type 2) (princ "CR\n"))
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
471 (t (princ "invalid\n")))))
88534
27fb0f57ffe3 Doc fixes.
Dave Love <fx@gnu.org>
parents: 88412
diff changeset
472 (let ((postread (coding-system-get coding-system :post-read-conversion)))
20114
cbf191888430 (describe-coding-system): Print
Kenichi Handa <handa@m17n.org>
parents: 20092
diff changeset
473 (when postread
35585
a185af43bdf4 (describe-char-after): Doc fix.
Dave Love <fx@gnu.org>
parents: 34931
diff changeset
474 (princ "After decoding text normally,")
a185af43bdf4 (describe-char-after): Doc fix.
Dave Love <fx@gnu.org>
parents: 34931
diff changeset
475 (princ " perform post-conversion using the function: ")
20114
cbf191888430 (describe-coding-system): Print
Kenichi Handa <handa@m17n.org>
parents: 20092
diff changeset
476 (princ "\n ")
cbf191888430 (describe-coding-system): Print
Kenichi Handa <handa@m17n.org>
parents: 20092
diff changeset
477 (princ postread)
cbf191888430 (describe-coding-system): Print
Kenichi Handa <handa@m17n.org>
parents: 20092
diff changeset
478 (princ "\n")))
88534
27fb0f57ffe3 Doc fixes.
Dave Love <fx@gnu.org>
parents: 88412
diff changeset
479 (let ((prewrite (coding-system-get coding-system :pre-write-conversion)))
20114
cbf191888430 (describe-coding-system): Print
Kenichi Handa <handa@m17n.org>
parents: 20092
diff changeset
480 (when prewrite
35585
a185af43bdf4 (describe-char-after): Doc fix.
Dave Love <fx@gnu.org>
parents: 34931
diff changeset
481 (princ "Before encoding text normally,")
a185af43bdf4 (describe-char-after): Doc fix.
Dave Love <fx@gnu.org>
parents: 34931
diff changeset
482 (princ " perform pre-conversion using the function: ")
20114
cbf191888430 (describe-coding-system): Print
Kenichi Handa <handa@m17n.org>
parents: 20092
diff changeset
483 (princ "\n ")
cbf191888430 (describe-coding-system): Print
Kenichi Handa <handa@m17n.org>
parents: 20092
diff changeset
484 (princ prewrite)
cbf191888430 (describe-coding-system): Print
Kenichi Handa <handa@m17n.org>
parents: 20092
diff changeset
485 (princ "\n")))
40664
4e5f8e42b8d1 (list-character-sets, sort-listed-character-sets, describe-character-set)
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 40639
diff changeset
486 (with-current-buffer standard-output
88566
2c3cb7fbba2a (describe-coding-system): Avoid error
Dave Love <fx@gnu.org>
parents: 88542
diff changeset
487 (let ((charsets (coding-system-charset-list coding-system)))
2c3cb7fbba2a (describe-coding-system): Avoid error
Dave Love <fx@gnu.org>
parents: 88542
diff changeset
488 (when (and (not (eq (coding-system-base coding-system) 'raw-text))
36989
ce090eb0edda (describe-coding-system): For raw-text and emacs-mule, don't add
Kenichi Handa <handa@m17n.org>
parents: 35747
diff changeset
489 charsets)
88566
2c3cb7fbba2a (describe-coding-system): Avoid error
Dave Love <fx@gnu.org>
parents: 88542
diff changeset
490 (cond
2c3cb7fbba2a (describe-coding-system): Avoid error
Dave Love <fx@gnu.org>
parents: 88542
diff changeset
491 ((eq charsets 'iso-2022)
2c3cb7fbba2a (describe-coding-system): Avoid error
Dave Love <fx@gnu.org>
parents: 88542
diff changeset
492 (insert "This coding system can encode all ISO 2022 charsets."))
2c3cb7fbba2a (describe-coding-system): Avoid error
Dave Love <fx@gnu.org>
parents: 88542
diff changeset
493 ((eq charsets 'emacs-mule)
2c3cb7fbba2a (describe-coding-system): Avoid error
Dave Love <fx@gnu.org>
parents: 88542
diff changeset
494 (insert "This coding system can encode all emacs-mule charsets\
2c3cb7fbba2a (describe-coding-system): Avoid error
Dave Love <fx@gnu.org>
parents: 88542
diff changeset
495 ."""))
2c3cb7fbba2a (describe-coding-system): Avoid error
Dave Love <fx@gnu.org>
parents: 88542
diff changeset
496 (t
35585
a185af43bdf4 (describe-char-after): Doc fix.
Dave Love <fx@gnu.org>
parents: 34931
diff changeset
497 (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
498 (while charsets
d8ce7bce2aab (charset-multibyte-form-string): New function.
Kenichi Handa <handa@m17n.org>
parents: 30765
diff changeset
499 (insert " " (symbol-name (car charsets)))
d8ce7bce2aab (charset-multibyte-form-string): New function.
Kenichi Handa <handa@m17n.org>
parents: 30765
diff changeset
500 (search-backward (symbol-name (car charsets)))
40639
d3a680cb99fd (describe-character-set)
Miles Bader <miles@gnu.org>
parents: 39475
diff changeset
501 (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
502 (goto-char (point-max))
88566
2c3cb7fbba2a (describe-coding-system): Avoid error
Dave Love <fx@gnu.org>
parents: 88542
diff changeset
503 (setq charsets (cdr charsets)))))))))))
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
504
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
505 ;;;###autoload
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
506 (defun describe-current-coding-system-briefly ()
18199
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
507 "Display coding systems currently used in a brief format in echo area.
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
508
18199
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
509 The format is \"F[..],K[..],T[..],P>[..],P<[..], default F[..],P<[..],P<[..]\",
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
510 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
511 in place of `..':
30765
1e5a486b8b25 punctuation fixes in doc strings
Sam Steingold <sds@gnu.org>
parents: 30126
diff changeset
512 `buffer-file-coding-system' (of the current buffer)
1e5a486b8b25 punctuation fixes in doc strings
Sam Steingold <sds@gnu.org>
parents: 30126
diff changeset
513 eol-type of `buffer-file-coding-system' (of the current buffer)
22306
6819832df39b Many doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 22290
diff changeset
514 Value returned by `keyboard-coding-system'
30765
1e5a486b8b25 punctuation fixes in doc strings
Sam Steingold <sds@gnu.org>
parents: 30126
diff changeset
515 eol-type of `keyboard-coding-system'
1e5a486b8b25 punctuation fixes in doc strings
Sam Steingold <sds@gnu.org>
parents: 30126
diff changeset
516 Value returned by `terminal-coding-system'.
1e5a486b8b25 punctuation fixes in doc strings
Sam Steingold <sds@gnu.org>
parents: 30126
diff changeset
517 eol-type of `terminal-coding-system'
22306
6819832df39b Many doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 22290
diff changeset
518 `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
519 eol-type of `process-coding-system' for read (of the current buffer, if any)
22306
6819832df39b Many doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 22290
diff changeset
520 `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
521 eol-type of `process-coding-system' for write (of the current buffer, if any)
104664
50fdf250e26b * mh-e/mh-comp.el (mh-send-letter):
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 104386
diff changeset
522 default `buffer-file-coding-system'
50fdf250e26b * mh-e/mh-comp.el (mh-send-letter):
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 104386
diff changeset
523 eol-type of default `buffer-file-coding-system'
22306
6819832df39b Many doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 22290
diff changeset
524 `default-process-coding-system' for read
30765
1e5a486b8b25 punctuation fixes in doc strings
Sam Steingold <sds@gnu.org>
parents: 30126
diff changeset
525 eol-type of `default-process-coding-system' for read
22306
6819832df39b Many doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 22290
diff changeset
526 `default-process-coding-system' for write
30765
1e5a486b8b25 punctuation fixes in doc strings
Sam Steingold <sds@gnu.org>
parents: 30126
diff changeset
527 eol-type of `default-process-coding-system'"
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
528 (interactive)
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
529 (let* ((proc (get-buffer-process (current-buffer)))
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
530 (process-coding-systems (if proc (process-coding-system proc))))
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
531 (message
24865
a4b8bb7bed21 (describe-current-coding-system-briefly): Fix format string.
Kenichi Handa <handa@m17n.org>
parents: 24724
diff changeset
532 "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
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
533 (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
534 (coding-system-eol-type-mnemonic buffer-file-coding-system)
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
535 (coding-system-mnemonic (keyboard-coding-system))
18199
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
536 (coding-system-eol-type-mnemonic (keyboard-coding-system))
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
537 (coding-system-mnemonic (terminal-coding-system))
18199
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
538 (coding-system-eol-type-mnemonic (terminal-coding-system))
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
539 (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
540 (coding-system-eol-type-mnemonic (car process-coding-systems))
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
541 (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
542 (coding-system-eol-type-mnemonic (cdr process-coding-systems))
104664
50fdf250e26b * mh-e/mh-comp.el (mh-send-letter):
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 104386
diff changeset
543 (coding-system-mnemonic (default-value 'buffer-file-coding-system))
50fdf250e26b * mh-e/mh-comp.el (mh-send-letter):
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 104386
diff changeset
544 (coding-system-eol-type-mnemonic
50fdf250e26b * mh-e/mh-comp.el (mh-send-letter):
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 104386
diff changeset
545 (default-value 'buffer-file-coding-system))
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
546 (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
547 (coding-system-eol-type-mnemonic (car default-process-coding-system))
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
548 (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
549 (coding-system-eol-type-mnemonic (cdr default-process-coding-system))
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
550 )))
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
551
18300
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
552 (defun print-coding-system-briefly (coding-system &optional doc-string)
89483
2f877ed80fa6 *** empty log message ***
Kenichi Handa <handa@m17n.org>
parents: 88123 89412
diff changeset
553 "Print symbol name and mnemonic letter of CODING-SYSTEM with `princ'.
2f877ed80fa6 *** empty log message ***
Kenichi Handa <handa@m17n.org>
parents: 88123 89412
diff changeset
554 If DOC-STRING is non-nil, print also the docstring of CODING-SYSTEM.
2f877ed80fa6 *** empty log message ***
Kenichi Handa <handa@m17n.org>
parents: 88123 89412
diff changeset
555 If DOC-STRING is `tightly', don't print an empty line before the
2f877ed80fa6 *** empty log message ***
Kenichi Handa <handa@m17n.org>
parents: 88123 89412
diff changeset
556 docstring, and print only the first line of the docstring."
18199
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
557 (if (not coding-system)
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
558 (princ "nil\n")
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
559 (princ (format "%c -- %s"
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
560 (coding-system-mnemonic coding-system)
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
561 coding-system))
88655
ea446bb886ad (print-coding-system-briefly): Fix
Dave Love <fx@gnu.org>
parents: 88648
diff changeset
562 (let ((aliases (coding-system-aliases coding-system)))
46490
e541dfaa4964 (print-coding-system-briefly): Fix the handling of an alias of which
Kenichi Handa <handa@m17n.org>
parents: 45909
diff changeset
563 (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
564 (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
565 (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
566 ((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
567 (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
568 (t
e541dfaa4964 (print-coding-system-briefly): Fix the handling of an alias of which
Kenichi Handa <handa@m17n.org>
parents: 45909
diff changeset
569 (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
570 (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
571 (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
572 (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
573 (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
574 (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
575 (aref base-eol-type eol-type))))))))
50496
ad2c77c56a81 (print-coding-system-briefly): If
Kenichi Handa <handa@m17n.org>
parents: 49875
diff changeset
576 (princ "\n")
ad2c77c56a81 (print-coding-system-briefly): If
Kenichi Handa <handa@m17n.org>
parents: 49875
diff changeset
577 (or (eq doc-string 'tightly)
ad2c77c56a81 (print-coding-system-briefly): If
Kenichi Handa <handa@m17n.org>
parents: 49875
diff changeset
578 (princ "\n"))
ad2c77c56a81 (print-coding-system-briefly): If
Kenichi Handa <handa@m17n.org>
parents: 49875
diff changeset
579 (if doc-string
ad2c77c56a81 (print-coding-system-briefly): If
Kenichi Handa <handa@m17n.org>
parents: 49875
diff changeset
580 (let ((doc (or (coding-system-doc-string coding-system) "")))
ad2c77c56a81 (print-coding-system-briefly): If
Kenichi Handa <handa@m17n.org>
parents: 49875
diff changeset
581 (when (eq doc-string 'tightly)
ad2c77c56a81 (print-coding-system-briefly): If
Kenichi Handa <handa@m17n.org>
parents: 49875
diff changeset
582 (if (string-match "\n" doc)
ad2c77c56a81 (print-coding-system-briefly): If
Kenichi Handa <handa@m17n.org>
parents: 49875
diff changeset
583 (setq doc (substring doc 0 (match-beginning 0))))
ad2c77c56a81 (print-coding-system-briefly): If
Kenichi Handa <handa@m17n.org>
parents: 49875
diff changeset
584 (setq doc (concat " " doc)))
ad2c77c56a81 (print-coding-system-briefly): If
Kenichi Handa <handa@m17n.org>
parents: 49875
diff changeset
585 (princ (format "%s\n" doc))))))
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
586
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
587 ;;;###autoload
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
588 (defun describe-current-coding-system ()
22306
6819832df39b Many doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 22290
diff changeset
589 "Display coding systems currently used, in detail."
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
590 (interactive)
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
591 (with-output-to-temp-buffer "*Help*"
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
592 (let* ((proc (get-buffer-process (current-buffer)))
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
593 (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
594 (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
595 (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
596 (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
597 (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
598 (princ "Default coding system (for new files):\n ")
104664
50fdf250e26b * mh-e/mh-comp.el (mh-send-letter):
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 104386
diff changeset
599 (print-coding-system-briefly (default-value 'buffer-file-coding-system))
19081
f33df9d64fe8 (describe-current-coding-system): Clean up output format.
Richard M. Stallman <rms@gnu.org>
parents: 18799
diff changeset
600 (princ "Coding system for keyboard input:\n ")
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
601 (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
602 (princ "Coding system for terminal output:\n ")
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
603 (print-coding-system-briefly (terminal-coding-system))
95348
5d45e3ef3e0f (describe-current-coding-system):
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 95201
diff changeset
604 (when (boundp 'selection-coding-system)
5d45e3ef3e0f (describe-current-coding-system):
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 95201
diff changeset
605 (princ "Coding system for inter-client cut and paste:\n ")
5d45e3ef3e0f (describe-current-coding-system):
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 95201
diff changeset
606 (print-coding-system-briefly selection-coding-system))
19081
f33df9d64fe8 (describe-current-coding-system): Clean up output format.
Richard M. Stallman <rms@gnu.org>
parents: 18799
diff changeset
607 (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
608 (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
609 (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
610 (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
611 (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
612 (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
613 (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
614 (princ " decoding: ")
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
615 (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
616 (princ " encoding: ")
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
617 (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
618
40664
4e5f8e42b8d1 (list-character-sets, sort-listed-character-sets, describe-character-set)
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 40639
diff changeset
619 (with-current-buffer standard-output
18300
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
620
43231
06e0fbd07e17 Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents: 42362
diff changeset
621 (princ "
06e0fbd07e17 Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents: 42362
diff changeset
622 Priority order for recognizing coding systems when reading files:\n")
88412
524f9b5b2ac5 (print-designation): Arguments changed.
Kenichi Handa <handa@m17n.org>
parents: 43292
diff changeset
623 (let ((i 1))
524f9b5b2ac5 (print-designation): Arguments changed.
Kenichi Handa <handa@m17n.org>
parents: 43292
diff changeset
624 (dolist (elt (coding-system-priority-list))
524f9b5b2ac5 (print-designation): Arguments changed.
Kenichi Handa <handa@m17n.org>
parents: 43292
diff changeset
625 (princ (format " %d. %s " i elt))
524f9b5b2ac5 (print-designation): Arguments changed.
Kenichi Handa <handa@m17n.org>
parents: 43292
diff changeset
626 (let ((aliases (coding-system-aliases elt)))
524f9b5b2ac5 (print-designation): Arguments changed.
Kenichi Handa <handa@m17n.org>
parents: 43292
diff changeset
627 (if (eq elt (car aliases))
20114
cbf191888430 (describe-coding-system): Print
Kenichi Handa <handa@m17n.org>
parents: 20092
diff changeset
628 (if (cdr aliases)
cbf191888430 (describe-coding-system): Print
Kenichi Handa <handa@m17n.org>
parents: 20092
diff changeset
629 (princ (cons 'alias: (cdr aliases))))
88412
524f9b5b2ac5 (print-designation): Arguments changed.
Kenichi Handa <handa@m17n.org>
parents: 43292
diff changeset
630 (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
631 (terpri)
88412
524f9b5b2ac5 (print-designation): Arguments changed.
Kenichi Handa <handa@m17n.org>
parents: 43292
diff changeset
632 (setq i (1+ i)))))
20114
cbf191888430 (describe-coding-system): Print
Kenichi Handa <handa@m17n.org>
parents: 20092
diff changeset
633
18300
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
634 (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
635 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
636 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
637
88655
ea446bb886ad (print-coding-system-briefly): Fix
Dave Love <fx@gnu.org>
parents: 88648
diff changeset
638 ;; Fixme: should this be replaced or junked?
88412
524f9b5b2ac5 (print-designation): Arguments changed.
Kenichi Handa <handa@m17n.org>
parents: 43292
diff changeset
639 (if nil
18799
6c0d648d2cf8 (describe-current-coding-system): Use coding-category-iso-7-else
Kenichi Handa <handa@m17n.org>
parents: 18696
diff changeset
640 (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
641 coding-system codings)
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
642 (while categories
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
643 (setq coding-system (symbol-value (car categories)))
84910
90defdcad2cb (describe-current-coding-system): Use `mapc' rather than `mapcar'.
Juanma Barranquero <lekktu@gmail.com>
parents: 78310
diff changeset
644 (mapc
47548
698b4a4bb562 (describe-coding-system): Remove unused `coding-spec' variable.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 46490
diff changeset
645 (lambda (x)
698b4a4bb562 (describe-coding-system): Remove unused `coding-spec' variable.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 46490
diff changeset
646 (if (and (not (eq x coding-system))
88637
10c911c19787 (print-coding-system): (Incomplete)
Dave Love <fx@gnu.org>
parents: 88566
diff changeset
647 (let ((flags (coding-system-get :flags)))
10c911c19787 (print-coding-system): (Incomplete)
Dave Love <fx@gnu.org>
parents: 88566
diff changeset
648 (not (or (memq 'use-roman flags)
10c911c19787 (print-coding-system): (Incomplete)
Dave Love <fx@gnu.org>
parents: 88566
diff changeset
649 (memq 'use-oldjis flags)))))
47548
698b4a4bb562 (describe-coding-system): Remove unused `coding-spec' variable.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 46490
diff changeset
650 (setq codings (cons x codings))))
18300
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
651 (get (car categories) 'coding-systems))
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
652 (if codings
54519
2d359989a04e (describe-current-coding-system): Use window-width instead of frame-width.
Juri Linkov <juri@jurta.org>
parents: 52797
diff changeset
653 (let ((max-col (window-width))
18300
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
654 pos)
43231
06e0fbd07e17 Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents: 42362
diff changeset
655 (princ (format "\
06e0fbd07e17 Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents: 42362
diff changeset
656 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
657 coding-system))
18300
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
658 (while codings
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
659 (setq pos (point))
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
660 (insert (format " %s" (car codings)))
18559
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
661 (when (> (current-column) max-col)
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
662 (goto-char pos)
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
663 (insert "\n ")
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
664 (goto-char (point-max)))
18300
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
665 (setq codings (cdr codings)))
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
666 (insert "\n\n")))
88412
524f9b5b2ac5 (print-designation): Arguments changed.
Kenichi Handa <handa@m17n.org>
parents: 43292
diff changeset
667 (setq categories (cdr categories)))))
18300
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
668
19081
f33df9d64fe8 (describe-current-coding-system): Clean up output format.
Richard M. Stallman <rms@gnu.org>
parents: 18799
diff changeset
669 (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
670 (terpri)
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
671 (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
672 (princ " ---------\t--------------\t\t----------------\n")
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
673 (let ((func (lambda (operation alist)
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
674 (princ " ")
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
675 (princ operation)
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
676 (if (not alist)
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
677 (princ "\tnothing specified\n")
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
678 (while alist
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
679 (indent-to 16)
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
680 (prin1 (car (car alist)))
20114
cbf191888430 (describe-coding-system): Print
Kenichi Handa <handa@m17n.org>
parents: 20092
diff changeset
681 (if (>= (current-column) 40)
cbf191888430 (describe-coding-system): Print
Kenichi Handa <handa@m17n.org>
parents: 20092
diff changeset
682 (newline))
18300
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
683 (indent-to 40)
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
684 (princ (cdr (car alist)))
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
685 (princ "\n")
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
686 (setq alist (cdr alist)))))))
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
687 (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
688 (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
689 (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
690 (help-mode))))
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
691
20114
cbf191888430 (describe-coding-system): Print
Kenichi Handa <handa@m17n.org>
parents: 20092
diff changeset
692 (defun print-coding-system (coding-system)
88534
27fb0f57ffe3 Doc fixes.
Dave Love <fx@gnu.org>
parents: 88412
diff changeset
693 "Print detailed information on CODING-SYSTEM."
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
694 (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
695 (eol-type (coding-system-eol-type coding-system))
88637
10c911c19787 (print-coding-system): (Incomplete)
Dave Love <fx@gnu.org>
parents: 88566
diff changeset
696 (flags (coding-system-get coding-system :flags))
88655
ea446bb886ad (print-coding-system-briefly): Fix
Dave Love <fx@gnu.org>
parents: 88648
diff changeset
697 (aliases (coding-system-aliases coding-system)))
20114
cbf191888430 (describe-coding-system): Print
Kenichi Handa <handa@m17n.org>
parents: 20092
diff changeset
698 (if (not (eq (car aliases) coding-system))
cbf191888430 (describe-coding-system): Print
Kenichi Handa <handa@m17n.org>
parents: 20092
diff changeset
699 (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
700 (princ coding-system)
100212
8770d8ed68e4 * international/mule-diag.el (list-character-sets): Doc fix.
Juanma Barranquero <lekktu@gmail.com>
parents: 100194
diff changeset
701 (dolist (alias (cdr aliases))
18559
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
702 (princ ",")
100212
8770d8ed68e4 * international/mule-diag.el (list-character-sets): Doc fix.
Juanma Barranquero <lekktu@gmail.com>
parents: 100194
diff changeset
703 (princ alias))
18199
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
704 (princ (format ":%s:%c:%d:"
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
705 type
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
706 (coding-system-mnemonic coding-system)
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
707 (if (integerp eol-type) eol-type 3)))
88637
10c911c19787 (print-coding-system): (Incomplete)
Dave Love <fx@gnu.org>
parents: 88566
diff changeset
708 (cond ((eq type 'iso2022)
18199
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
709 (let ((idx 0)
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
710 charset)
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
711 (while (< idx 4)
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
712 (setq charset (aref flags idx))
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
713 (cond ((null charset)
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
714 (princ -1))
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
715 ((eq charset t)
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
716 (princ -2))
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
717 ((charsetp charset)
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
718 (princ charset))
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
719 ((listp charset)
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
720 (princ "(")
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
721 (princ (car charset))
18199
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
722 (setq charset (cdr charset))
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
723 (while charset
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
724 (princ ",")
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
725 (princ (car charset))
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
726 (setq charset (cdr charset)))
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
727 (princ ")")))
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
728 (princ ",")
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
729 (setq idx (1+ idx)))
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
730 (while (< idx 12)
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
731 (princ (if (aref flags idx) 1 0))
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
732 (princ ",")
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
733 (setq idx (1+ idx)))
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
734 (princ (if (aref flags idx) 1 0))))
88637
10c911c19787 (print-coding-system): (Incomplete)
Dave Love <fx@gnu.org>
parents: 88566
diff changeset
735 ((eq type 'ccl)
18199
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
736 (let (i len)
21967
9f92d6a5254f (print-coding-system):
Richard M. Stallman <rms@gnu.org>
parents: 21469
diff changeset
737 (if (symbolp (car flags))
9f92d6a5254f (print-coding-system):
Richard M. Stallman <rms@gnu.org>
parents: 21469
diff changeset
738 (princ (format " %s" (car flags)))
9f92d6a5254f (print-coding-system):
Richard M. Stallman <rms@gnu.org>
parents: 21469
diff changeset
739 (setq i 0 len (length (car flags)))
9f92d6a5254f (print-coding-system):
Richard M. Stallman <rms@gnu.org>
parents: 21469
diff changeset
740 (while (< i len)
9f92d6a5254f (print-coding-system):
Richard M. Stallman <rms@gnu.org>
parents: 21469
diff changeset
741 (princ (format " %x" (aref (car flags) i)))
9f92d6a5254f (print-coding-system):
Richard M. Stallman <rms@gnu.org>
parents: 21469
diff changeset
742 (setq i (1+ i))))
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
743 (princ ",")
21967
9f92d6a5254f (print-coding-system):
Richard M. Stallman <rms@gnu.org>
parents: 21469
diff changeset
744 (if (symbolp (cdr flags))
9f92d6a5254f (print-coding-system):
Richard M. Stallman <rms@gnu.org>
parents: 21469
diff changeset
745 (princ (format "%s" (cdr flags)))
9f92d6a5254f (print-coding-system):
Richard M. Stallman <rms@gnu.org>
parents: 21469
diff changeset
746 (setq i 0 len (length (cdr flags)))
9f92d6a5254f (print-coding-system):
Richard M. Stallman <rms@gnu.org>
parents: 21469
diff changeset
747 (while (< i len)
9f92d6a5254f (print-coding-system):
Richard M. Stallman <rms@gnu.org>
parents: 21469
diff changeset
748 (princ (format " %x" (aref (cdr flags) i)))
9f92d6a5254f (print-coding-system):
Richard M. Stallman <rms@gnu.org>
parents: 21469
diff changeset
749 (setq i (1+ i))))))
18199
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
750 (t (princ 0)))
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
751 (princ ":")
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
752 (princ (coding-system-doc-string coding-system))
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
753 (princ "\n"))))
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
754
18199
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
755 ;;;###autoload
18559
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
756 (defun list-coding-systems (&optional arg)
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
757 "Display a list of all coding systems.
22306
6819832df39b Many doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 22290
diff changeset
758 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
759
100194
f76e0ce31e62 * international/mule-diag.el (unicodedata-file, unicode-data): Remove.
Juanma Barranquero <lekktu@gmail.com>
parents: 97914
diff changeset
760 With prefix ARG, the output format gets more cryptic,
22306
6819832df39b Many doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 22290
diff changeset
761 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
762 (interactive "P")
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
763 (with-output-to-temp-buffer "*Help*"
22339
69de59462e22 (list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents: 22306
diff changeset
764 (list-coding-systems-1 arg)))
69de59462e22 (list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents: 22306
diff changeset
765
69de59462e22 (list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents: 22306
diff changeset
766 (defun list-coding-systems-1 (arg)
69de59462e22 (list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents: 22306
diff changeset
767 (if (null arg)
69de59462e22 (list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents: 22306
diff changeset
768 (princ "\
18199
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
769 ###############################################
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
770 # 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
771 # MNEMONIC-LETTER -- CODING-SYSTEM-NAME
50496
ad2c77c56a81 (print-coding-system-briefly): If
Kenichi Handa <handa@m17n.org>
parents: 49875
diff changeset
772 # DOC-STRING
18199
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
773 ")
22339
69de59462e22 (list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents: 22306
diff changeset
774 (princ "\
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
775 #########################
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
776 ## LIST OF CODING SYSTEMS
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
777 ## Each line corresponds to one coding system
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
778 ## Format of a line is:
18199
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
779 ## 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
780 ## :PRE-WRITE-CONVERSION:DOC-STRING,
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
781 ## where
18199
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
782 ## NAME = coding system name
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
783 ## ALIAS = alias of the coding system
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
784 ## 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
785 ## 0 (EMACS-MULE), 1 (SJIS), 2 (ISO2022), 3 (BIG5), or 4 (CCL)
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
786 ## EOL = 0 (LF), 1 (CRLF), 2 (CR), or 3 (Automatic detection)
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
787 ## FLAGS =
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
788 ## if TYPE = 2 then
52433
875975e6fae5 (non-iso-charset-alist): Define as
Dave Love <fx@gnu.org>
parents: 52401
diff changeset
789 ## comma (`,') separated data of the following:
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
790 ## G0, G1, G2, G3, SHORT-FORM, ASCII-EOL, ASCII-CNTL, SEVEN,
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
791 ## LOCKING-SHIFT, SINGLE-SHIFT, USE-ROMAN, USE-OLDJIS, NO-ISO6429
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
792 ## else if TYPE = 4 then
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
793 ## comma (`,') separated CCL programs for read and write
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
794 ## else
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
795 ## 0
18199
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
796 ## POST-READ-CONVERSION, PRE-WRITE-CONVERSION = function name to be called
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
797 ##
18199
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
798 "))
50496
ad2c77c56a81 (print-coding-system-briefly): If
Kenichi Handa <handa@m17n.org>
parents: 49875
diff changeset
799 (dolist (coding-system (sort-coding-systems (coding-system-list 'base-only)))
ad2c77c56a81 (print-coding-system-briefly): If
Kenichi Handa <handa@m17n.org>
parents: 49875
diff changeset
800 (if (null arg)
ad2c77c56a81 (print-coding-system-briefly): If
Kenichi Handa <handa@m17n.org>
parents: 49875
diff changeset
801 (print-coding-system-briefly coding-system 'tightly)
ad2c77c56a81 (print-coding-system-briefly): If
Kenichi Handa <handa@m17n.org>
parents: 49875
diff changeset
802 (print-coding-system coding-system))))
18559
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
803
88655
ea446bb886ad (print-coding-system-briefly): Fix
Dave Love <fx@gnu.org>
parents: 88648
diff changeset
804 ;; Fixme: delete?
26688
1830bc1903fb (list-coding-categories): Fix typo;
Gerd Moellmann <gerd@gnu.org>
parents: 26189
diff changeset
805 ;;;###autoload
18559
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
806 (defun list-coding-categories ()
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
807 "Display a list of all coding categories."
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
808 (with-output-to-temp-buffer "*Help*"
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
809 (princ "\
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
810 ############################
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
811 ## LIST OF CODING CATEGORIES (ordered by priority)
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
812 ## CATEGORY:CODING-SYSTEM
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
813 ##
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
814 ")
18559
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
815 (let ((l coding-category-list))
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
816 (while l
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
817 (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
818 (setq l (cdr l))))))
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
819
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
820 ;;; FONT
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
821
95841
b4e36ff621b3 Add some compiler declarations, for builds without X.
Glenn Morris <rgm@gnu.org>
parents: 95622
diff changeset
822 (declare-function font-info "font.c" (name &optional frame))
b4e36ff621b3 Add some compiler declarations, for builds without X.
Glenn Morris <rgm@gnu.org>
parents: 95622
diff changeset
823
102934
ed0a00c1025a * international/mule-diag.el (describe-font-internal): Change
Chong Yidong <cyd@stupidchicken.com>
parents: 102519
diff changeset
824 (defun describe-font-internal (font-info &optional ignored)
ed0a00c1025a * international/mule-diag.el (describe-font-internal): Change
Chong Yidong <cyd@stupidchicken.com>
parents: 102519
diff changeset
825 "Print information about a font in FONT-INFO.
ed0a00c1025a * international/mule-diag.el (describe-font-internal): Change
Chong Yidong <cyd@stupidchicken.com>
parents: 102519
diff changeset
826 The IGNORED argument is ignored."
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
827 (print-list "name (opened by):" (aref font-info 0))
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
828 (print-list " full name:" (aref font-info 1))
28899
133a92b8094d (syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents: 28216
diff changeset
829 (print-list " size:" (format "%2d" (aref font-info 2)))
133a92b8094d (syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents: 28216
diff changeset
830 (print-list " height:" (format "%2d" (aref font-info 3)))
133a92b8094d (syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents: 28216
diff changeset
831 (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
832 (print-list "relative-compose:" (format "%2d" (aref font-info 5))))
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
833
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
834 ;;;###autoload
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
835 (defun describe-font (fontname)
72263
12a2fefc1194 (describe-font): Improve docstring
Kenichi Handa <handa@m17n.org>
parents: 65680
diff changeset
836 "Display information about a font whose name is FONTNAME.
12a2fefc1194 (describe-font): Improve docstring
Kenichi Handa <handa@m17n.org>
parents: 65680
diff changeset
837 The font must be already used by Emacs."
12a2fefc1194 (describe-font): Improve docstring
Kenichi Handa <handa@m17n.org>
parents: 65680
diff changeset
838 (interactive "sFont name (default current choice for ASCII chars): ")
28216
cad26a9da36b (describe-font): Don't refer to
Kenichi Handa <handa@m17n.org>
parents: 27973
diff changeset
839 (or (and window-system (fboundp 'fontset-list))
72263
12a2fefc1194 (describe-font): Improve docstring
Kenichi Handa <handa@m17n.org>
parents: 65680
diff changeset
840 (error "No fonts being used"))
95405
6c4caa612333 (describe-font): Don't check fontset
Kenichi Handa <handa@m17n.org>
parents: 95348
diff changeset
841 (let (font-info)
6c4caa612333 (describe-font): Don't check fontset
Kenichi Handa <handa@m17n.org>
parents: 95348
diff changeset
842 (if (or (not fontname) (= (length fontname) 0))
6c4caa612333 (describe-font): Don't check fontset
Kenichi Handa <handa@m17n.org>
parents: 95348
diff changeset
843 (setq fontname (face-attribute 'default :font)))
72263
12a2fefc1194 (describe-font): Improve docstring
Kenichi Handa <handa@m17n.org>
parents: 65680
diff changeset
844 (setq font-info (font-info fontname))
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
845 (if (null font-info)
95405
6c4caa612333 (describe-font): Don't check fontset
Kenichi Handa <handa@m17n.org>
parents: 95348
diff changeset
846 (if (fontp fontname 'font-object)
72263
12a2fefc1194 (describe-font): Improve docstring
Kenichi Handa <handa@m17n.org>
parents: 65680
diff changeset
847 ;; The font should be surely used. So, there's some
12a2fefc1194 (describe-font): Improve docstring
Kenichi Handa <handa@m17n.org>
parents: 65680
diff changeset
848 ;; problem about getting information about it. It is
12a2fefc1194 (describe-font): Improve docstring
Kenichi Handa <handa@m17n.org>
parents: 65680
diff changeset
849 ;; better to print the fontname to show which font has
12a2fefc1194 (describe-font): Improve docstring
Kenichi Handa <handa@m17n.org>
parents: 65680
diff changeset
850 ;; this problem.
95405
6c4caa612333 (describe-font): Don't check fontset
Kenichi Handa <handa@m17n.org>
parents: 95348
diff changeset
851 (message "No information about \"%s\"" (font-xlfd-name fontname))
6c4caa612333 (describe-font): Don't check fontset
Kenichi Handa <handa@m17n.org>
parents: 95348
diff changeset
852 (message "No matching font found"))
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
853 (with-output-to-temp-buffer "*Help*"
102934
ed0a00c1025a * international/mule-diag.el (describe-font-internal): Change
Chong Yidong <cyd@stupidchicken.com>
parents: 102519
diff changeset
854 (describe-font-internal font-info)))))
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
855
89355
6f8fa82cac02 (print-fontset-element): New
Kenichi Handa <handa@m17n.org>
parents: 89346
diff changeset
856 (defun print-fontset-element (val)
6f8fa82cac02 (print-fontset-element): New
Kenichi Handa <handa@m17n.org>
parents: 89346
diff changeset
857 ;; VAL has this format:
6f8fa82cac02 (print-fontset-element): New
Kenichi Handa <handa@m17n.org>
parents: 89346
diff changeset
858 ;; ((REQUESTED-FONT-NAME OPENED-FONT-NAME ...) ...)
6f8fa82cac02 (print-fontset-element): New
Kenichi Handa <handa@m17n.org>
parents: 89346
diff changeset
859 ;; CHAR RANGE is already inserted. Get character codes from
6f8fa82cac02 (print-fontset-element): New
Kenichi Handa <handa@m17n.org>
parents: 89346
diff changeset
860 ;; the current line.
6f8fa82cac02 (print-fontset-element): New
Kenichi Handa <handa@m17n.org>
parents: 89346
diff changeset
861 (beginning-of-line)
6f8fa82cac02 (print-fontset-element): New
Kenichi Handa <handa@m17n.org>
parents: 89346
diff changeset
862 (let ((from (following-char))
6f8fa82cac02 (print-fontset-element): New
Kenichi Handa <handa@m17n.org>
parents: 89346
diff changeset
863 (to (if (looking-at "[^.]*[.]* ")
6f8fa82cac02 (print-fontset-element): New
Kenichi Handa <handa@m17n.org>
parents: 89346
diff changeset
864 (char-after (match-end 0)))))
6f8fa82cac02 (print-fontset-element): New
Kenichi Handa <handa@m17n.org>
parents: 89346
diff changeset
865 (if (re-search-forward "[ \t]*$" nil t)
6f8fa82cac02 (print-fontset-element): New
Kenichi Handa <handa@m17n.org>
parents: 89346
diff changeset
866 (delete-region (match-beginning 0) (match-end 0)))
6f8fa82cac02 (print-fontset-element): New
Kenichi Handa <handa@m17n.org>
parents: 89346
diff changeset
867
6f8fa82cac02 (print-fontset-element): New
Kenichi Handa <handa@m17n.org>
parents: 89346
diff changeset
868 ;; For non-ASCII characters, insert also CODE RANGE.
6f8fa82cac02 (print-fontset-element): New
Kenichi Handa <handa@m17n.org>
parents: 89346
diff changeset
869 (if (or (>= from 128) (and to (>= to 128)))
6f8fa82cac02 (print-fontset-element): New
Kenichi Handa <handa@m17n.org>
parents: 89346
diff changeset
870 (if to
6f8fa82cac02 (print-fontset-element): New
Kenichi Handa <handa@m17n.org>
parents: 89346
diff changeset
871 (insert (format " (#x%02X .. #x%02X)" from to))
6f8fa82cac02 (print-fontset-element): New
Kenichi Handa <handa@m17n.org>
parents: 89346
diff changeset
872 (insert (format " (#x%02X)" from))))
6f8fa82cac02 (print-fontset-element): New
Kenichi Handa <handa@m17n.org>
parents: 89346
diff changeset
873
6f8fa82cac02 (print-fontset-element): New
Kenichi Handa <handa@m17n.org>
parents: 89346
diff changeset
874 ;; Insert a requested font name.
6f8fa82cac02 (print-fontset-element): New
Kenichi Handa <handa@m17n.org>
parents: 89346
diff changeset
875 (dolist (elt val)
91515
2ebe99b97e12 (print-fontset-element): Handle the
Kenichi Handa <handa@m17n.org>
parents: 91327
diff changeset
876 (if (not elt)
2ebe99b97e12 (print-fontset-element): Handle the
Kenichi Handa <handa@m17n.org>
parents: 91327
diff changeset
877 (insert "\n -- inhibit fallback fonts --")
2ebe99b97e12 (print-fontset-element): Handle the
Kenichi Handa <handa@m17n.org>
parents: 91327
diff changeset
878 (let ((requested (car elt)))
2ebe99b97e12 (print-fontset-element): Handle the
Kenichi Handa <handa@m17n.org>
parents: 91327
diff changeset
879 (if (stringp requested)
2ebe99b97e12 (print-fontset-element): Handle the
Kenichi Handa <handa@m17n.org>
parents: 91327
diff changeset
880 (insert "\n " requested)
2ebe99b97e12 (print-fontset-element): Handle the
Kenichi Handa <handa@m17n.org>
parents: 91327
diff changeset
881 (let (family registry weight slant width adstyle)
2ebe99b97e12 (print-fontset-element): Handle the
Kenichi Handa <handa@m17n.org>
parents: 91327
diff changeset
882 (if (and (fboundp 'fontp) (fontp requested))
2ebe99b97e12 (print-fontset-element): Handle the
Kenichi Handa <handa@m17n.org>
parents: 91327
diff changeset
883 (setq family (font-get requested :family)
2ebe99b97e12 (print-fontset-element): Handle the
Kenichi Handa <handa@m17n.org>
parents: 91327
diff changeset
884 registry (font-get requested :registry)
2ebe99b97e12 (print-fontset-element): Handle the
Kenichi Handa <handa@m17n.org>
parents: 91327
diff changeset
885 weight (font-get requested :weight)
2ebe99b97e12 (print-fontset-element): Handle the
Kenichi Handa <handa@m17n.org>
parents: 91327
diff changeset
886 slant (font-get requested :slant)
2ebe99b97e12 (print-fontset-element): Handle the
Kenichi Handa <handa@m17n.org>
parents: 91327
diff changeset
887 width (font-get requested :width)
2ebe99b97e12 (print-fontset-element): Handle the
Kenichi Handa <handa@m17n.org>
parents: 91327
diff changeset
888 adstyle (font-get requested :adstyle))
2ebe99b97e12 (print-fontset-element): Handle the
Kenichi Handa <handa@m17n.org>
parents: 91327
diff changeset
889 (setq family (aref requested 0)
2ebe99b97e12 (print-fontset-element): Handle the
Kenichi Handa <handa@m17n.org>
parents: 91327
diff changeset
890 registry (aref requested 5)
2ebe99b97e12 (print-fontset-element): Handle the
Kenichi Handa <handa@m17n.org>
parents: 91327
diff changeset
891 weight (aref requested 1)
2ebe99b97e12 (print-fontset-element): Handle the
Kenichi Handa <handa@m17n.org>
parents: 91327
diff changeset
892 slant (aref requested 2)
2ebe99b97e12 (print-fontset-element): Handle the
Kenichi Handa <handa@m17n.org>
parents: 91327
diff changeset
893 width (aref requested 3)
2ebe99b97e12 (print-fontset-element): Handle the
Kenichi Handa <handa@m17n.org>
parents: 91327
diff changeset
894 adstyle (aref requested 4)))
2ebe99b97e12 (print-fontset-element): Handle the
Kenichi Handa <handa@m17n.org>
parents: 91327
diff changeset
895 (if (not family)
2ebe99b97e12 (print-fontset-element): Handle the
Kenichi Handa <handa@m17n.org>
parents: 91327
diff changeset
896 (setq family "*-*")
2ebe99b97e12 (print-fontset-element): Handle the
Kenichi Handa <handa@m17n.org>
parents: 91327
diff changeset
897 (if (symbolp family)
2ebe99b97e12 (print-fontset-element): Handle the
Kenichi Handa <handa@m17n.org>
parents: 91327
diff changeset
898 (setq family (symbol-name family)))
2ebe99b97e12 (print-fontset-element): Handle the
Kenichi Handa <handa@m17n.org>
parents: 91327
diff changeset
899 (or (string-match "-" family)
2ebe99b97e12 (print-fontset-element): Handle the
Kenichi Handa <handa@m17n.org>
parents: 91327
diff changeset
900 (setq family (concat "*-" family))))
2ebe99b97e12 (print-fontset-element): Handle the
Kenichi Handa <handa@m17n.org>
parents: 91327
diff changeset
901 (if (not registry)
2ebe99b97e12 (print-fontset-element): Handle the
Kenichi Handa <handa@m17n.org>
parents: 91327
diff changeset
902 (setq registry "*-*")
2ebe99b97e12 (print-fontset-element): Handle the
Kenichi Handa <handa@m17n.org>
parents: 91327
diff changeset
903 (if (symbolp registry)
2ebe99b97e12 (print-fontset-element): Handle the
Kenichi Handa <handa@m17n.org>
parents: 91327
diff changeset
904 (setq registry (symbol-name registry)))
2ebe99b97e12 (print-fontset-element): Handle the
Kenichi Handa <handa@m17n.org>
parents: 91327
diff changeset
905 (or (string-match "-" registry)
2ebe99b97e12 (print-fontset-element): Handle the
Kenichi Handa <handa@m17n.org>
parents: 91327
diff changeset
906 (= (aref registry (1- (length registry))) ?*)
2ebe99b97e12 (print-fontset-element): Handle the
Kenichi Handa <handa@m17n.org>
parents: 91327
diff changeset
907 (setq registry (concat registry "*"))))
2ebe99b97e12 (print-fontset-element): Handle the
Kenichi Handa <handa@m17n.org>
parents: 91327
diff changeset
908 (insert (format"\n -%s-%s-%s-%s-%s-*-*-*-*-*-*-%s"
2ebe99b97e12 (print-fontset-element): Handle the
Kenichi Handa <handa@m17n.org>
parents: 91327
diff changeset
909 family (or weight "*") (or slant "*") (or width "*")
2ebe99b97e12 (print-fontset-element): Handle the
Kenichi Handa <handa@m17n.org>
parents: 91327
diff changeset
910 (or adstyle "*") registry)))))
89355
6f8fa82cac02 (print-fontset-element): New
Kenichi Handa <handa@m17n.org>
parents: 89346
diff changeset
911
91515
2ebe99b97e12 (print-fontset-element): Handle the
Kenichi Handa <handa@m17n.org>
parents: 91327
diff changeset
912 ;; Insert opened font names (if any).
2ebe99b97e12 (print-fontset-element): Handle the
Kenichi Handa <handa@m17n.org>
parents: 91327
diff changeset
913 (if (and (boundp 'print-opened) (symbol-value 'print-opened))
2ebe99b97e12 (print-fontset-element): Handle the
Kenichi Handa <handa@m17n.org>
parents: 91327
diff changeset
914 (dolist (opened (cdr elt))
2ebe99b97e12 (print-fontset-element): Handle the
Kenichi Handa <handa@m17n.org>
parents: 91327
diff changeset
915 (insert "\n\t[" opened "]")))))))
89355
6f8fa82cac02 (print-fontset-element): New
Kenichi Handa <handa@m17n.org>
parents: 89346
diff changeset
916
95841
b4e36ff621b3 Add some compiler declarations, for builds without X.
Glenn Morris <rgm@gnu.org>
parents: 95622
diff changeset
917 (declare-function query-fontset "fontset.c" (pattern &optional regexpp))
b4e36ff621b3 Add some compiler declarations, for builds without X.
Glenn Morris <rgm@gnu.org>
parents: 95622
diff changeset
918 (declare-function fontset-info "fontset.c" (fontset &optional frame))
b4e36ff621b3 Add some compiler declarations, for builds without X.
Glenn Morris <rgm@gnu.org>
parents: 95622
diff changeset
919
89355
6f8fa82cac02 (print-fontset-element): New
Kenichi Handa <handa@m17n.org>
parents: 89346
diff changeset
920 (defun print-fontset (fontset &optional print-opened)
43231
06e0fbd07e17 Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents: 42362
diff changeset
921 "Print information about FONTSET.
102519
2d1154701720 (print-fontset): Handling of the
Kenichi Handa <handa@m17n.org>
parents: 101170
diff changeset
922 FONTSET nil means the fontset of the selected frame, t means the
2d1154701720 (print-fontset): Handling of the
Kenichi Handa <handa@m17n.org>
parents: 101170
diff changeset
923 default fontset.
89355
6f8fa82cac02 (print-fontset-element): New
Kenichi Handa <handa@m17n.org>
parents: 89346
diff changeset
924 If optional arg PRINT-OPENED is non-nil, also print names of all opened
43231
06e0fbd07e17 Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents: 42362
diff changeset
925 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
926 the current buffer."
102519
2d1154701720 (print-fontset): Handling of the
Kenichi Handa <handa@m17n.org>
parents: 101170
diff changeset
927 (if (eq fontset t)
2d1154701720 (print-fontset): Handling of the
Kenichi Handa <handa@m17n.org>
parents: 101170
diff changeset
928 (setq fontset (query-fontset "fontset-default"))
2d1154701720 (print-fontset): Handling of the
Kenichi Handa <handa@m17n.org>
parents: 101170
diff changeset
929 (if (eq fontset nil)
2d1154701720 (print-fontset): Handling of the
Kenichi Handa <handa@m17n.org>
parents: 101170
diff changeset
930 (setq fontset (face-attribute 'default :fontset))))
88895
ab54ec5d2b3c (print-fontset): Use describe-vector
Kenichi Handa <handa@m17n.org>
parents: 88818
diff changeset
931 (beginning-of-line)
102519
2d1154701720 (print-fontset): Handling of the
Kenichi Handa <handa@m17n.org>
parents: 101170
diff changeset
932 (narrow-to-region (point) (point))
88895
ab54ec5d2b3c (print-fontset): Use describe-vector
Kenichi Handa <handa@m17n.org>
parents: 88818
diff changeset
933 (insert "Fontset: " fontset "\n")
89355
6f8fa82cac02 (print-fontset-element): New
Kenichi Handa <handa@m17n.org>
parents: 89346
diff changeset
934 (insert (propertize "CHAR RANGE" 'face 'underline)
6f8fa82cac02 (print-fontset-element): New
Kenichi Handa <handa@m17n.org>
parents: 89346
diff changeset
935 " (" (propertize "CODE RANGE" 'face 'underline) ")\n")
6f8fa82cac02 (print-fontset-element): New
Kenichi Handa <handa@m17n.org>
parents: 89346
diff changeset
936 (insert " " (propertize "FONT NAME" 'face 'underline)
6f8fa82cac02 (print-fontset-element): New
Kenichi Handa <handa@m17n.org>
parents: 89346
diff changeset
937 " (" (propertize "REQUESTED" 'face 'underline)
6f8fa82cac02 (print-fontset-element): New
Kenichi Handa <handa@m17n.org>
parents: 89346
diff changeset
938 " and [" (propertize "OPENED" 'face 'underline) "])")
102519
2d1154701720 (print-fontset): Handling of the
Kenichi Handa <handa@m17n.org>
parents: 101170
diff changeset
939 (let* ((info (fontset-info fontset))
2d1154701720 (print-fontset): Handling of the
Kenichi Handa <handa@m17n.org>
parents: 101170
diff changeset
940 (default-info (char-table-extra-slot info 0))
2d1154701720 (print-fontset): Handling of the
Kenichi Handa <handa@m17n.org>
parents: 101170
diff changeset
941 start1 end1 start2 end2)
89355
6f8fa82cac02 (print-fontset-element): New
Kenichi Handa <handa@m17n.org>
parents: 89346
diff changeset
942 (describe-vector info 'print-fontset-element)
102519
2d1154701720 (print-fontset): Handling of the
Kenichi Handa <handa@m17n.org>
parents: 101170
diff changeset
943 (when (char-table-range info nil)
2d1154701720 (print-fontset): Handling of the
Kenichi Handa <handa@m17n.org>
parents: 101170
diff changeset
944 ;; The default of FONTSET is described.
2d1154701720 (print-fontset): Handling of the
Kenichi Handa <handa@m17n.org>
parents: 101170
diff changeset
945 (setq start1 (re-search-backward "^default"))
2d1154701720 (print-fontset): Handling of the
Kenichi Handa <handa@m17n.org>
parents: 101170
diff changeset
946 (delete-region (point) (line-end-position))
2d1154701720 (print-fontset): Handling of the
Kenichi Handa <handa@m17n.org>
parents: 101170
diff changeset
947 (insert "\n ---<fallback to the default of the specified fontset>---")
2d1154701720 (print-fontset): Handling of the
Kenichi Handa <handa@m17n.org>
parents: 101170
diff changeset
948 (put-text-property (line-beginning-position) (point) 'face 'highlight)
2d1154701720 (print-fontset): Handling of the
Kenichi Handa <handa@m17n.org>
parents: 101170
diff changeset
949 (goto-char (point-max))
2d1154701720 (print-fontset): Handling of the
Kenichi Handa <handa@m17n.org>
parents: 101170
diff changeset
950 (setq end1 (setq start2 (point))))
2d1154701720 (print-fontset): Handling of the
Kenichi Handa <handa@m17n.org>
parents: 101170
diff changeset
951 (when default-info
2d1154701720 (print-fontset): Handling of the
Kenichi Handa <handa@m17n.org>
parents: 101170
diff changeset
952 (insert "\n ---<fallback to the default fontset>---")
2d1154701720 (print-fontset): Handling of the
Kenichi Handa <handa@m17n.org>
parents: 101170
diff changeset
953 (put-text-property (line-beginning-position) (point) 'face 'highlight)
2d1154701720 (print-fontset): Handling of the
Kenichi Handa <handa@m17n.org>
parents: 101170
diff changeset
954 (describe-vector default-info 'print-fontset-element)
2d1154701720 (print-fontset): Handling of the
Kenichi Handa <handa@m17n.org>
parents: 101170
diff changeset
955 (when (char-table-range default-info nil)
2d1154701720 (print-fontset): Handling of the
Kenichi Handa <handa@m17n.org>
parents: 101170
diff changeset
956 ;; The default of the default fontset is described.
2d1154701720 (print-fontset): Handling of the
Kenichi Handa <handa@m17n.org>
parents: 101170
diff changeset
957 (setq end2 (re-search-backward "^default"))
2d1154701720 (print-fontset): Handling of the
Kenichi Handa <handa@m17n.org>
parents: 101170
diff changeset
958 (delete-region (point) (line-end-position))
2d1154701720 (print-fontset): Handling of the
Kenichi Handa <handa@m17n.org>
parents: 101170
diff changeset
959 (insert "\n ---<fallback to the default of the default fontset>---")
2d1154701720 (print-fontset): Handling of the
Kenichi Handa <handa@m17n.org>
parents: 101170
diff changeset
960 (put-text-property (line-beginning-position) (point) 'face 'highlight)))
2d1154701720 (print-fontset): Handling of the
Kenichi Handa <handa@m17n.org>
parents: 101170
diff changeset
961 (if (and start1 end2)
2d1154701720 (print-fontset): Handling of the
Kenichi Handa <handa@m17n.org>
parents: 101170
diff changeset
962 ;; Reoder the printed information to match with the font
2d1154701720 (print-fontset): Handling of the
Kenichi Handa <handa@m17n.org>
parents: 101170
diff changeset
963 ;; searching strategy; i.e. FONTSET, the default fontset,
2d1154701720 (print-fontset): Handling of the
Kenichi Handa <handa@m17n.org>
parents: 101170
diff changeset
964 ;; default of FONTSET, default of the default fontset.
2d1154701720 (print-fontset): Handling of the
Kenichi Handa <handa@m17n.org>
parents: 101170
diff changeset
965 (transpose-regions start1 end1 start2 end2))
2d1154701720 (print-fontset): Handling of the
Kenichi Handa <handa@m17n.org>
parents: 101170
diff changeset
966 (goto-char (point-max)))
2d1154701720 (print-fontset): Handling of the
Kenichi Handa <handa@m17n.org>
parents: 101170
diff changeset
967 (widen))
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
968
95841
b4e36ff621b3 Add some compiler declarations, for builds without X.
Glenn Morris <rgm@gnu.org>
parents: 95622
diff changeset
969 (defvar fontset-alias-alist)
b4e36ff621b3 Add some compiler declarations, for builds without X.
Glenn Morris <rgm@gnu.org>
parents: 95622
diff changeset
970 (declare-function fontset-list "fontset.c" ())
b4e36ff621b3 Add some compiler declarations, for builds without X.
Glenn Morris <rgm@gnu.org>
parents: 95622
diff changeset
971
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
972 ;;;###autoload
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
973 (defun describe-fontset (fontset)
43231
06e0fbd07e17 Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents: 42362
diff changeset
974 "Display information about FONTSET.
28899
133a92b8094d (syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents: 28216
diff changeset
975 This shows which font is used for which character(s)."
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
976 (interactive
28216
cad26a9da36b (describe-font): Don't refer to
Kenichi Handa <handa@m17n.org>
parents: 27973
diff changeset
977 (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
978 (error "No fontsets being used")
35585
a185af43bdf4 (describe-char-after): Doc fix.
Dave Love <fx@gnu.org>
parents: 34931
diff changeset
979 (let ((fontset-list (nconc
45909
9f98a97f5469 (describe-fontset): Don't cons uselessly.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 45871
diff changeset
980 (fontset-list)
9f98a97f5469 (describe-fontset): Don't cons uselessly.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 45871
diff changeset
981 (mapcar 'cdr fontset-alias-alist)))
18559
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
982 (completion-ignore-case t))
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
983 (list (completing-read
65680
ed770a0a7846 2005-09-24 Emilio C. Lopes <eclig@gmx.net>
Romain Francoise <romain@orebokech.com>
parents: 64085
diff changeset
984 "Fontset (default used by the current frame): "
18559
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
985 fontset-list nil t)))))
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
986 (if (= (length fontset) 0)
102519
2d1154701720 (print-fontset): Handling of the
Kenichi Handa <handa@m17n.org>
parents: 101170
diff changeset
987 (setq fontset (face-attribute 'default :fontset))
2d1154701720 (print-fontset): Handling of the
Kenichi Handa <handa@m17n.org>
parents: 101170
diff changeset
988 (setq fontset (query-fontset fontset)))
105372
bd2966850aac Use `called-interactively-p' instead of `interactive-p'.
Juanma Barranquero <lekktu@gmail.com>
parents: 104823
diff changeset
989 (help-setup-xref (list #'describe-fontset fontset)
bd2966850aac Use `called-interactively-p' instead of `interactive-p'.
Juanma Barranquero <lekktu@gmail.com>
parents: 104823
diff changeset
990 (called-interactively-p 'interactive))
40664
4e5f8e42b8d1 (list-character-sets, sort-listed-character-sets, describe-character-set)
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 40639
diff changeset
991 (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
992 (with-current-buffer standard-output
28899
133a92b8094d (syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents: 28216
diff changeset
993 (print-fontset fontset t))))
18559
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
994
95841
b4e36ff621b3 Add some compiler declarations, for builds without X.
Glenn Morris <rgm@gnu.org>
parents: 95622
diff changeset
995 (declare-function fontset-plain-name "fontset" (fontset))
b4e36ff621b3 Add some compiler declarations, for builds without X.
Glenn Morris <rgm@gnu.org>
parents: 95622
diff changeset
996
18559
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
997 ;;;###autoload
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
998 (defun list-fontsets (arg)
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
999 "Display a list of all fontsets.
22306
6819832df39b Many doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 22290
diff changeset
1000 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
1001 With prefix arg, also list the fonts contained in each fontset;
22306
6819832df39b Many doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 22290
diff changeset
1002 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
1003 (interactive "P")
28216
cad26a9da36b (describe-font): Don't refer to
Kenichi Handa <handa@m17n.org>
parents: 27973
diff changeset
1004 (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
1005 (error "No fontsets being used")
105372
bd2966850aac Use `called-interactively-p' instead of `interactive-p'.
Juanma Barranquero <lekktu@gmail.com>
parents: 104823
diff changeset
1006 (help-setup-xref (list #'list-fontsets arg)
bd2966850aac Use `called-interactively-p' instead of `interactive-p'.
Juanma Barranquero <lekktu@gmail.com>
parents: 104823
diff changeset
1007 (called-interactively-p 'interactive))
40664
4e5f8e42b8d1 (list-character-sets, sort-listed-character-sets, describe-character-set)
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 40639
diff changeset
1008 (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
1009 (with-current-buffer standard-output
22339
69de59462e22 (list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents: 22306
diff changeset
1010 ;; 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
1011 (let ((fontsets
782215de9b98 (list-fontsets): Sort fontsets by plain names.
Kenichi Handa <handa@m17n.org>
parents: 23582
diff changeset
1012 (sort (fontset-list)
47548
698b4a4bb562 (describe-coding-system): Remove unused `coding-spec' variable.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 46490
diff changeset
1013 (lambda (x y)
698b4a4bb562 (describe-coding-system): Remove unused `coding-spec' variable.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 46490
diff changeset
1014 (string< (fontset-plain-name x)
698b4a4bb562 (describe-coding-system): Remove unused `coding-spec' variable.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 46490
diff changeset
1015 (fontset-plain-name y))))))
21469
ea652c41eec6 (list-input-methods): Fix doc string.
Karl Heuer <kwzh@gnu.org>
parents: 20731
diff changeset
1016 (while fontsets
28899
133a92b8094d (syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents: 28216
diff changeset
1017 (if arg
133a92b8094d (syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents: 28216
diff changeset
1018 (print-fontset (car fontsets) nil)
133a92b8094d (syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents: 28216
diff changeset
1019 (insert "Fontset: " (car fontsets) "\n"))
21469
ea652c41eec6 (list-input-methods): Fix doc string.
Karl Heuer <kwzh@gnu.org>
parents: 20731
diff changeset
1020 (setq fontsets (cdr fontsets))))))))
18300
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
1021
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
1022 ;;;###autoload
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
1023 (defun list-input-methods ()
22306
6819832df39b Many doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 22290
diff changeset
1024 "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
1025 (interactive)
105372
bd2966850aac Use `called-interactively-p' instead of `interactive-p'.
Juanma Barranquero <lekktu@gmail.com>
parents: 104823
diff changeset
1026 (help-setup-xref '(list-input-methods)
bd2966850aac Use `called-interactively-p' instead of `interactive-p'.
Juanma Barranquero <lekktu@gmail.com>
parents: 104823
diff changeset
1027 (called-interactively-p 'interactive))
47548
698b4a4bb562 (describe-coding-system): Remove unused `coding-spec' variable.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 46490
diff changeset
1028 (with-output-to-temp-buffer (help-buffer)
43231
06e0fbd07e17 Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents: 42362
diff changeset
1029 (list-input-methods-1)
06e0fbd07e17 Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents: 42362
diff changeset
1030 (with-current-buffer standard-output
06e0fbd07e17 Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents: 42362
diff changeset
1031 (save-excursion
06e0fbd07e17 Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents: 42362
diff changeset
1032 (goto-char (point-min))
06e0fbd07e17 Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents: 42362
diff changeset
1033 (while (re-search-forward
06e0fbd07e17 Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents: 42362
diff changeset
1034 "^ \\([^ ]+\\) (`.*' in mode line)$" nil t)
54970
4234b07e2bdb (list-input-methods): Fix args to help-xref-button.
Juri Linkov <juri@jurta.org>
parents: 54519
diff changeset
1035 (help-xref-button 1 'help-input-method (match-string 1)))))))
22339
69de59462e22 (list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents: 22306
diff changeset
1036
69de59462e22 (list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents: 22306
diff changeset
1037 (defun list-input-methods-1 ()
69de59462e22 (list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents: 22306
diff changeset
1038 (if (not input-method-alist)
100212
8770d8ed68e4 * international/mule-diag.el (list-character-sets): Doc fix.
Juanma Barranquero <lekktu@gmail.com>
parents: 100194
diff changeset
1039 (princ "
44746
8f2bf8b392fe (list-input-methods-1): Doc fix
Pavel Janík <Pavel@Janik.cz>
parents: 43977
diff changeset
1040 No input method is available, perhaps because you have not
100212
8770d8ed68e4 * international/mule-diag.el (list-character-sets): Doc fix.
Juanma Barranquero <lekktu@gmail.com>
parents: 100194
diff changeset
1041 installed LEIM (Libraries of Emacs Input Methods).")
22339
69de59462e22 (list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents: 22306
diff changeset
1042 (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
1043 (princ " SHORT-DESCRIPTION\n------------------------------\n")
69de59462e22 (list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents: 22306
diff changeset
1044 (setq input-method-alist
69de59462e22 (list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents: 22306
diff changeset
1045 (sort input-method-alist
47548
698b4a4bb562 (describe-coding-system): Remove unused `coding-spec' variable.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 46490
diff changeset
1046 (lambda (x y) (string< (nth 1 x) (nth 1 y)))))
100212
8770d8ed68e4 * international/mule-diag.el (list-character-sets): Doc fix.
Juanma Barranquero <lekktu@gmail.com>
parents: 100194
diff changeset
1047
8770d8ed68e4 * international/mule-diag.el (list-character-sets): Doc fix.
Juanma Barranquero <lekktu@gmail.com>
parents: 100194
diff changeset
1048 (let (language)
8770d8ed68e4 * international/mule-diag.el (list-character-sets): Doc fix.
Juanma Barranquero <lekktu@gmail.com>
parents: 100194
diff changeset
1049 (dolist (elt input-method-alist)
22339
69de59462e22 (list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents: 22306
diff changeset
1050 (when (not (equal language (nth 1 elt)))
69de59462e22 (list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents: 22306
diff changeset
1051 (setq language (nth 1 elt))
69de59462e22 (list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents: 22306
diff changeset
1052 (princ language)
69de59462e22 (list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents: 22306
diff changeset
1053 (terpri))
69de59462e22 (list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents: 22306
diff changeset
1054 (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
1055 (car elt)
69de59462e22 (list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents: 22306
diff changeset
1056 (let ((title (nth 3 elt)))
69de59462e22 (list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents: 22306
diff changeset
1057 (if (and (consp title) (stringp (car title)))
69de59462e22 (list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents: 22306
diff changeset
1058 (car title)
69de59462e22 (list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents: 22306
diff changeset
1059 title))
100212
8770d8ed68e4 * international/mule-diag.el (list-character-sets): Doc fix.
Juanma Barranquero <lekktu@gmail.com>
parents: 100194
diff changeset
1060 (nth 4 elt)))))))
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1061
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1062 ;;; DIAGNOSIS
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1063
18559
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
1064 ;; 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
1065 (defun insert-section (section-number title)
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1066 (insert "########################################\n"
18559
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
1067 "# Section " (format "%d" section-number) ". " title "\n"
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1068 "########################################\n\n"))
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1069
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1070 ;;;###autoload
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1071 (defun mule-diag ()
24724
df2a95fa1429 (mule-diag): Change MULE to Mule in docstring.
Kenichi Handa <handa@m17n.org>
parents: 24691
diff changeset
1072 "Display diagnosis of the multilingual environment (Mule).
18559
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
1073
22306
6819832df39b Many doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 22290
diff changeset
1074 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
1075 environment, including lists of input methods, coding systems,
22306
6819832df39b Many doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 22290
diff changeset
1076 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
1077 system which uses fontsets)."
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1078 (interactive)
18559
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
1079 (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
1080 (with-current-buffer standard-output
22339
69de59462e22 (list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents: 22306
diff changeset
1081 (insert "###############################################\n"
69de59462e22 (list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents: 22306
diff changeset
1082 "### Current Status of Multilingual Features ###\n"
69de59462e22 (list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents: 22306
diff changeset
1083 "###############################################\n\n"
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1084 "CONTENTS: Section 1. General Information\n"
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1085 " Section 2. Display\n"
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1086 " Section 3. Input methods\n"
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1087 " Section 4. Coding systems\n"
18559
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
1088 " Section 5. Character sets\n")
28216
cad26a9da36b (describe-font): Don't refer to
Kenichi Handa <handa@m17n.org>
parents: 27973
diff changeset
1089 (if (and window-system (fboundp 'fontset-list))
18559
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
1090 (insert " Section 6. Fontsets\n"))
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1091 (insert "\n")
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1092
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1093 (insert-section 1 "General Information")
19425
572165bfff3e (mule-diag): Don't print primary-language.
Richard M. Stallman <rms@gnu.org>
parents: 19265
diff changeset
1094 (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
1095 (insert "Configuration options:\n " system-configuration-options "\n\n")
aeb6db8df2b9 (mule-diag): Insert information about
Kenichi Handa <handa@m17n.org>
parents: 34078
diff changeset
1096 (insert "Multibyte characters awareness:\n"
104823
68150c643e2e Use default-value rather than default-enable-multibyte-characters.
Glenn Morris <rgm@gnu.org>
parents: 104664
diff changeset
1097 (format " default: %S\n" (default-value
68150c643e2e Use default-value rather than default-enable-multibyte-characters.
Glenn Morris <rgm@gnu.org>
parents: 104664
diff changeset
1098 'enable-multibyte-characters))
34631
aeb6db8df2b9 (mule-diag): Insert information about
Kenichi Handa <handa@m17n.org>
parents: 34078
diff changeset
1099 (format " current-buffer: %S\n\n" enable-multibyte-characters))
aeb6db8df2b9 (mule-diag): Insert information about
Kenichi Handa <handa@m17n.org>
parents: 34078
diff changeset
1100 (insert "Current language environment: " current-language-environment
aeb6db8df2b9 (mule-diag): Insert information about
Kenichi Handa <handa@m17n.org>
parents: 34078
diff changeset
1101 "\n\n")
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1102
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1103 (insert-section 2 "Display")
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1104 (if window-system
100234
a31a3e84b5b8 * international/mule-diag.el (mule-diag): Display the window
Juanma Barranquero <lekktu@gmail.com>
parents: 100212
diff changeset
1105 (insert (format "Window-system: %s, version %s"
a31a3e84b5b8 * international/mule-diag.el (mule-diag): Display the window
Juanma Barranquero <lekktu@gmail.com>
parents: 100212
diff changeset
1106 window-system window-system-version))
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1107 (insert "Terminal: " (getenv "TERM")))
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1108 (insert "\n\n")
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1109
100212
8770d8ed68e4 * international/mule-diag.el (list-character-sets): Doc fix.
Juanma Barranquero <lekktu@gmail.com>
parents: 100194
diff changeset
1110 (if window-system
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1111 (let ((font (cdr (assq 'font (frame-parameters)))))
102519
2d1154701720 (print-fontset): Handling of the
Kenichi Handa <handa@m17n.org>
parents: 101170
diff changeset
1112 (insert "The font and fontset of the selected frame are:\n"
2d1154701720 (print-fontset): Handling of the
Kenichi Handa <handa@m17n.org>
parents: 101170
diff changeset
1113 " font: " font "\n"
2d1154701720 (print-fontset): Handling of the
Kenichi Handa <handa@m17n.org>
parents: 101170
diff changeset
1114 " fontset: " (face-attribute 'default :fontset) "\n"))
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1115 (insert "Coding system of the terminal: "
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1116 (symbol-name (terminal-coding-system))))
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1117 (insert "\n\n")
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1118
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1119 (insert-section 3 "Input methods")
22339
69de59462e22 (list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents: 22306
diff changeset
1120 (list-input-methods-1)
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1121 (insert "\n")
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1122 (if default-input-method
26189
88faf40281cd (mule-diag): Handle the case that
Kenichi Handa <handa@m17n.org>
parents: 24865
diff changeset
1123 (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
1124 (insert "No default input method is specified\n"))
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1125
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1126 (insert-section 4 "Coding systems")
22339
69de59462e22 (list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents: 22306
diff changeset
1127 (list-coding-systems-1 t)
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1128 (insert "\n")
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1129
18559
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
1130 (insert-section 5 "Character sets")
27912
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
1131 (list-character-sets-2)
18559
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
1132 (insert "\n")
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1133
28216
cad26a9da36b (describe-font): Don't refer to
Kenichi Handa <handa@m17n.org>
parents: 27973
diff changeset
1134 (when (and window-system (fboundp 'fontset-list))
22339
69de59462e22 (list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents: 22306
diff changeset
1135 ;; This code duplicates most of list-fontsets.
18559
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
1136 (insert-section 6 "Fontsets")
22339
69de59462e22 (list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents: 22306
diff changeset
1137 (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
1138 (insert "------------\t\t\t\t\t\t ----- -----\n")
100212
8770d8ed68e4 * international/mule-diag.el (list-character-sets): Doc fix.
Juanma Barranquero <lekktu@gmail.com>
parents: 100194
diff changeset
1139 (dolist (fontset (fontset-list))
8770d8ed68e4 * international/mule-diag.el (list-character-sets): Doc fix.
Juanma Barranquero <lekktu@gmail.com>
parents: 100194
diff changeset
1140 (print-fontset fontset t)))
104386
2e0765155e47 Use help-print-return-message rather than the now obsolete alias.
Glenn Morris <rgm@gnu.org>
parents: 103855
diff changeset
1141 (help-print-return-message))))
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1142
89483
2f877ed80fa6 *** empty log message ***
Kenichi Handa <handa@m17n.org>
parents: 88123 89412
diff changeset
1143 ;;;###autoload
97914
3202a37b62f3 (font-show-log): Fix previous change.
Kenichi Handa <handa@m17n.org>
parents: 97536
diff changeset
1144 (defun font-show-log (&optional limit)
97536
eba6b2798c48 (font-show-log): Add optional arg N to control the limit of font
Kenichi Handa <handa@m17n.org>
parents: 95841
diff changeset
1145 "Show log of font listing and opening.
97914
3202a37b62f3 (font-show-log): Fix previous change.
Kenichi Handa <handa@m17n.org>
parents: 97536
diff changeset
1146 Prefix arg LIMIT says how many fonts to show for each listing.
3202a37b62f3 (font-show-log): Fix previous change.
Kenichi Handa <handa@m17n.org>
parents: 97536
diff changeset
1147 The default is 20. If LIMIT is negative, do not limit the listing."
3202a37b62f3 (font-show-log): Fix previous change.
Kenichi Handa <handa@m17n.org>
parents: 97536
diff changeset
1148 (interactive "P")
3202a37b62f3 (font-show-log): Fix previous change.
Kenichi Handa <handa@m17n.org>
parents: 97536
diff changeset
1149 (setq limit (if limit (prefix-numeric-value limit) 20))
95174
0626142129fe (font-show-log): New function.
Kenichi Handa <handa@m17n.org>
parents: 94664
diff changeset
1150 (if (eq font-log t)
0626142129fe (font-show-log): New function.
Kenichi Handa <handa@m17n.org>
parents: 94664
diff changeset
1151 (message "Font logging is currently suppressed")
0626142129fe (font-show-log): New function.
Kenichi Handa <handa@m17n.org>
parents: 94664
diff changeset
1152 (with-output-to-temp-buffer "*Help*"
0626142129fe (font-show-log): New function.
Kenichi Handa <handa@m17n.org>
parents: 94664
diff changeset
1153 (set-buffer standard-output)
0626142129fe (font-show-log): New function.
Kenichi Handa <handa@m17n.org>
parents: 94664
diff changeset
1154 (dolist (elt (reverse font-log))
0626142129fe (font-show-log): New function.
Kenichi Handa <handa@m17n.org>
parents: 94664
diff changeset
1155 (insert (format "%s: %s\n" (car elt) (cadr elt)))
0626142129fe (font-show-log): New function.
Kenichi Handa <handa@m17n.org>
parents: 94664
diff changeset
1156 (setq elt (nth 2 elt))
0626142129fe (font-show-log): New function.
Kenichi Handa <handa@m17n.org>
parents: 94664
diff changeset
1157 (if (or (vectorp elt) (listp elt))
97536
eba6b2798c48 (font-show-log): Add optional arg N to control the limit of font
Kenichi Handa <handa@m17n.org>
parents: 95841
diff changeset
1158 (let ((i 0))
95200
fd38f2fd3d08 (font-show-log): Limit each listing
Kenichi Handa <handa@m17n.org>
parents: 95174
diff changeset
1159 (catch 'tag
fd38f2fd3d08 (font-show-log): Limit each listing
Kenichi Handa <handa@m17n.org>
parents: 95174
diff changeset
1160 (mapc #'(lambda (x)
fd38f2fd3d08 (font-show-log): Limit each listing
Kenichi Handa <handa@m17n.org>
parents: 95174
diff changeset
1161 (setq i (1+ i))
97914
3202a37b62f3 (font-show-log): Fix previous change.
Kenichi Handa <handa@m17n.org>
parents: 97536
diff changeset
1162 (when (= i limit)
95200
fd38f2fd3d08 (font-show-log): Limit each listing
Kenichi Handa <handa@m17n.org>
parents: 95174
diff changeset
1163 (insert " ...\n")
fd38f2fd3d08 (font-show-log): Limit each listing
Kenichi Handa <handa@m17n.org>
parents: 95174
diff changeset
1164 (throw 'tag nil))
fd38f2fd3d08 (font-show-log): Limit each listing
Kenichi Handa <handa@m17n.org>
parents: 95174
diff changeset
1165 (insert (format " %s\n" x)))
fd38f2fd3d08 (font-show-log): Limit each listing
Kenichi Handa <handa@m17n.org>
parents: 95174
diff changeset
1166 elt)))
95174
0626142129fe (font-show-log): New function.
Kenichi Handa <handa@m17n.org>
parents: 94664
diff changeset
1167 (insert (format " %s\n" elt)))))))
0626142129fe (font-show-log): New function.
Kenichi Handa <handa@m17n.org>
parents: 94664
diff changeset
1168
0626142129fe (font-show-log): New function.
Kenichi Handa <handa@m17n.org>
parents: 94664
diff changeset
1169
48050
7f760c845427 (non-iso-charset-alist): Move to
Dave Love <fx@gnu.org>
parents: 47913
diff changeset
1170 (provide 'mule-diag)
7f760c845427 (non-iso-charset-alist): Move to
Dave Love <fx@gnu.org>
parents: 47913
diff changeset
1171
93975
1e3a407766b9 Fix up comment convention on the arch-tag lines.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 91515
diff changeset
1172 ;; arch-tag: cd3b607c-2893-45a0-a4fa-a6535754dbee
18199
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
1173 ;;; mule-diag.el ends here