annotate lisp/international/mule-diag.el @ 88821:690d527d1ad2

(access_keymap): Remove generic char code. (push_key_description): Use CHARACTERP.
author Dave Love <fx@gnu.org>
date Wed, 03 Jul 2002 22:01:54 +0000
parents 9ae3a7ed0b93
children ab54ec5d2b3c
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
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
3 ;; Copyright (C) 1995 Electrotechnical Laboratory, JAPAN.
18377
8b4a66c66dd6 Change copyright notice.
Richard M. Stallman <rms@gnu.org>
parents: 18300
diff changeset
4 ;; Licensed to the Free Software Foundation.
43231
06e0fbd07e17 Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents: 42362
diff changeset
5 ;; Copyright (C) 2001, 2002 Free Software Foundation, Inc.
88412
524f9b5b2ac5 (print-designation): Arguments changed.
Kenichi Handa <handa@m17n.org>
parents: 43292
diff changeset
6 ;; Copyright (C) 2001, 2002
524f9b5b2ac5 (print-designation): Arguments changed.
Kenichi Handa <handa@m17n.org>
parents: 43292
diff changeset
7 ;; National Institute of Advanced Industrial Science and Technology (AIST)
524f9b5b2ac5 (print-designation): Arguments changed.
Kenichi Handa <handa@m17n.org>
parents: 43292
diff changeset
8 ;; Registration Number H13PRO009
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
9
27953
8b485e43ac51 (list-character-sets): Call
Dave Love <fx@gnu.org>
parents: 27912
diff changeset
10 ;; Keywords: multilingual, charset, coding system, fontset, diagnosis, i18n
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
11
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
12 ;; This file is part of GNU Emacs.
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
13
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
14 ;; GNU Emacs is free software; you can redistribute it and/or modify
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
15 ;; it under the terms of the GNU General Public License as published by
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
16 ;; the Free Software Foundation; either version 2, or (at your option)
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
17 ;; any later version.
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
18
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
19 ;; GNU Emacs is distributed in the hope that it will be useful,
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
20 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
21 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
22 ;; GNU General Public License for more details.
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
23
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
24 ;; You should have received a copy of the GNU General Public License
17071
70194012fb3a Fix FSF address in comment.
Karl Heuer <kwzh@gnu.org>
parents: 17052
diff changeset
25 ;; along with GNU Emacs; see the file COPYING. If not, write to the
70194012fb3a Fix FSF address in comment.
Karl Heuer <kwzh@gnu.org>
parents: 17052
diff changeset
26 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
70194012fb3a Fix FSF address in comment.
Karl Heuer <kwzh@gnu.org>
parents: 17052
diff changeset
27 ;; Boston, MA 02111-1307, USA.
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
28
38414
67b464da13ec Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents: 36989
diff changeset
29 ;;; Commentary:
67b464da13ec Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents: 36989
diff changeset
30
67b464da13ec Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents: 36989
diff changeset
31 ;;; Code:
67b464da13ec Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents: 36989
diff changeset
32
40722
1b9616706fd5 (help-funs): Require help-funs.
Richard M. Stallman <rms@gnu.org>
parents: 40664
diff changeset
33 ;; Make sure the help-xref button type is defined.
41586
f41a14872734 Require help-fns instead of help-funs.
Eli Zaretskii <eliz@gnu.org>
parents: 40722
diff changeset
34 (require 'help-fns)
40722
1b9616706fd5 (help-funs): Require help-funs.
Richard M. Stallman <rms@gnu.org>
parents: 40664
diff changeset
35
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
36 ;;; General utility function
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
37
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
38 (defun print-list (&rest args)
88534
27fb0f57ffe3 Doc fixes.
Dave Love <fx@gnu.org>
parents: 88412
diff changeset
39 "Print all arguments with single space separator in one line."
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
40 (while (cdr args)
18559
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
41 (when (car args)
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
42 (princ (car args))
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
43 (princ " "))
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
44 (setq args (cdr args)))
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
45 (princ (car args))
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
46 (princ "\n"))
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
47
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
48 ;;; CHARSET
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
49
40639
d3a680cb99fd (describe-character-set)
Miles Bader <miles@gnu.org>
parents: 39475
diff changeset
50 (define-button-type 'sort-listed-character-sets
d3a680cb99fd (describe-character-set)
Miles Bader <miles@gnu.org>
parents: 39475
diff changeset
51 'help-echo (purecopy "mouse-2, RET: sort on this column")
d3a680cb99fd (describe-character-set)
Miles Bader <miles@gnu.org>
parents: 39475
diff changeset
52 'face 'bold
d3a680cb99fd (describe-character-set)
Miles Bader <miles@gnu.org>
parents: 39475
diff changeset
53 'action #'(lambda (button)
d3a680cb99fd (describe-character-set)
Miles Bader <miles@gnu.org>
parents: 39475
diff changeset
54 (sort-listed-character-sets (button-get button 'sort-key))))
d3a680cb99fd (describe-character-set)
Miles Bader <miles@gnu.org>
parents: 39475
diff changeset
55
d3a680cb99fd (describe-character-set)
Miles Bader <miles@gnu.org>
parents: 39475
diff changeset
56 (define-button-type 'list-charset-chars
d3a680cb99fd (describe-character-set)
Miles Bader <miles@gnu.org>
parents: 39475
diff changeset
57 :supertype 'help-xref
d3a680cb99fd (describe-character-set)
Miles Bader <miles@gnu.org>
parents: 39475
diff changeset
58 'help-function #'list-charset-chars
d3a680cb99fd (describe-character-set)
Miles Bader <miles@gnu.org>
parents: 39475
diff changeset
59 '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
60
d3a680cb99fd (describe-character-set)
Miles Bader <miles@gnu.org>
parents: 39475
diff changeset
61
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
62 ;;;###autoload
27912
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
63 (defun list-character-sets (arg)
18559
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
64 "Display a list of all character sets.
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
65
43231
06e0fbd07e17 Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents: 42362
diff changeset
66 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
67 column contains the number of characters in a block of this character
06e0fbd07e17 Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents: 42362
diff changeset
68 set. The FINAL-CHAR column contains an ISO-2022 <final-char> to use
06e0fbd07e17 Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents: 42362
diff changeset
69 for designating this character set in ISO-2022-based coding systems.
18559
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
70
22306
6819832df39b Many doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 22290
diff changeset
71 With prefix arg, the output format gets more cryptic,
6819832df39b Many doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 22290
diff changeset
72 but still shows the full information."
18559
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
73 (interactive "P")
40664
4e5f8e42b8d1 (list-character-sets, sort-listed-character-sets, describe-character-set)
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 40639
diff changeset
74 (help-setup-xref (list #'list-character-sets arg) (interactive-p))
4e5f8e42b8d1 (list-character-sets, sort-listed-character-sets, describe-character-set)
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 40639
diff changeset
75 (with-output-to-temp-buffer (help-buffer)
27912
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
76 (with-current-buffer standard-output
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
77 (if arg
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
78 (list-character-sets-2)
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
79 ;; Insert header.
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
80 (insert
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
81 (substitute-command-keys
27973
cf535f97695d (list-character-sets): Make help-echo
Kenichi Handa <handa@m17n.org>
parents: 27953
diff changeset
82 (concat "Use "
cf535f97695d (list-character-sets): Make help-echo
Kenichi Handa <handa@m17n.org>
parents: 27953
diff changeset
83 (if (display-mouse-p) "\\[help-follow-mouse] or ")
cf535f97695d (list-character-sets): Make help-echo
Kenichi Handa <handa@m17n.org>
parents: 27953
diff changeset
84 "\\[help-follow]:\n")))
cf535f97695d (list-character-sets): Make help-echo
Kenichi Handa <handa@m17n.org>
parents: 27953
diff changeset
85 (insert " on a column title to sort by that title,")
88534
27fb0f57ffe3 Doc fixes.
Dave Love <fx@gnu.org>
parents: 88412
diff changeset
86 (indent-to 48)
27912
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
87 (insert "+----DIMENSION\n")
27973
cf535f97695d (list-character-sets): Make help-echo
Kenichi Handa <handa@m17n.org>
parents: 27953
diff changeset
88 (insert " on a charset name to list characters.")
88534
27fb0f57ffe3 Doc fixes.
Dave Love <fx@gnu.org>
parents: 88412
diff changeset
89 (indent-to 48)
27912
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
90 (insert "| +--CHARS\n")
88534
27fb0f57ffe3 Doc fixes.
Dave Love <fx@gnu.org>
parents: 88412
diff changeset
91 (let ((columns '(("CHARSET-NAME" . name) "\t\t\t\t\t"
27fb0f57ffe3 Doc fixes.
Dave Love <fx@gnu.org>
parents: 88412
diff changeset
92 ("D CH FINAL-CHAR" . iso-spec)))
27912
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
93 pos)
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
94 (while columns
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
95 (if (stringp (car columns))
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
96 (insert (car columns))
40639
d3a680cb99fd (describe-character-set)
Miles Bader <miles@gnu.org>
parents: 39475
diff changeset
97 (insert-text-button (car (car columns))
d3a680cb99fd (describe-character-set)
Miles Bader <miles@gnu.org>
parents: 39475
diff changeset
98 :type 'sort-listed-character-sets
d3a680cb99fd (describe-character-set)
Miles Bader <miles@gnu.org>
parents: 39475
diff changeset
99 'sort-key (cdr (car columns)))
27912
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
100 (goto-char (point-max)))
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
101 (setq columns (cdr columns)))
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
102 (insert "\n"))
88534
27fb0f57ffe3 Doc fixes.
Dave Love <fx@gnu.org>
parents: 88412
diff changeset
103 (insert "------------\t\t\t\t\t- --- ----------\n")
27912
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
104
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
105 ;; Insert body sorted by charset IDs.
88534
27fb0f57ffe3 Doc fixes.
Dave Love <fx@gnu.org>
parents: 88412
diff changeset
106 (list-character-sets-1 'name)))))
27912
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
107
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
108 (defun sort-listed-character-sets (sort-key)
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
109 (if sort-key
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
110 (save-excursion
40664
4e5f8e42b8d1 (list-character-sets, sort-listed-character-sets, describe-character-set)
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 40639
diff changeset
111 (help-setup-xref (list #'list-character-sets nil) t)
27912
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
112 (let ((buffer-read-only nil))
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
113 (goto-char (point-min))
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
114 (re-search-forward "[0-9][0-9][0-9]")
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
115 (beginning-of-line)
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
116 (delete-region (point) (point-max))
40664
4e5f8e42b8d1 (list-character-sets, sort-listed-character-sets, describe-character-set)
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 40639
diff changeset
117 (list-character-sets-1 sort-key)))))
27912
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
118
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
119 (defun list-character-sets-1 (sort-key)
88534
27fb0f57ffe3 Doc fixes.
Dave Love <fx@gnu.org>
parents: 88412
diff changeset
120 "Insert a list of character sets sorted by SORT-KEY.
27fb0f57ffe3 Doc fixes.
Dave Love <fx@gnu.org>
parents: 88412
diff changeset
121 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
122 (or sort-key
88534
27fb0f57ffe3 Doc fixes.
Dave Love <fx@gnu.org>
parents: 88412
diff changeset
123 (setq sort-key 'name))
27fb0f57ffe3 Doc fixes.
Dave Love <fx@gnu.org>
parents: 88412
diff changeset
124 (let ((tail charset-list)
27fb0f57ffe3 Doc fixes.
Dave Love <fx@gnu.org>
parents: 88412
diff changeset
125 charset-info-list charset sort-func)
27fb0f57ffe3 Doc fixes.
Dave Love <fx@gnu.org>
parents: 88412
diff changeset
126 (dolist (charset charset-list)
27912
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
127 ;; Generate a list that contains all information to display.
88534
27fb0f57ffe3 Doc fixes.
Dave Love <fx@gnu.org>
parents: 88412
diff changeset
128 (push (list charset
27fb0f57ffe3 Doc fixes.
Dave Love <fx@gnu.org>
parents: 88412
diff changeset
129 (charset-dimension charset)
27fb0f57ffe3 Doc fixes.
Dave Love <fx@gnu.org>
parents: 88412
diff changeset
130 (charset-chars charset)
27fb0f57ffe3 Doc fixes.
Dave Love <fx@gnu.org>
parents: 88412
diff changeset
131 (charset-iso-final-char charset))
27fb0f57ffe3 Doc fixes.
Dave Love <fx@gnu.org>
parents: 88412
diff changeset
132 charset-info-list))
27912
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
133
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
134 ;; Determine a predicate for `sort' by SORT-KEY.
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
135 (setq sort-func
88534
27fb0f57ffe3 Doc fixes.
Dave Love <fx@gnu.org>
parents: 88412
diff changeset
136 (cond ((eq sort-key 'name)
27fb0f57ffe3 Doc fixes.
Dave Love <fx@gnu.org>
parents: 88412
diff changeset
137 (lambda (x y) (string< (car x) (car y))))
27912
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
138
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
139 ((eq sort-key 'iso-spec)
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
140 ;; Sort by DIMENSION CHARS FINAL-CHAR
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
141 (function
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
142 (lambda (x y)
88534
27fb0f57ffe3 Doc fixes.
Dave Love <fx@gnu.org>
parents: 88412
diff changeset
143 (or (< (nth 1 x) (nth 1 y))
27fb0f57ffe3 Doc fixes.
Dave Love <fx@gnu.org>
parents: 88412
diff changeset
144 (and (= (nth 1 x) (nth 1 y))
27fb0f57ffe3 Doc fixes.
Dave Love <fx@gnu.org>
parents: 88412
diff changeset
145 (or (< (nth 2 x) (nth 2 y))
27fb0f57ffe3 Doc fixes.
Dave Love <fx@gnu.org>
parents: 88412
diff changeset
146 (and (= (nth 2 x) (nth 2 y))
27fb0f57ffe3 Doc fixes.
Dave Love <fx@gnu.org>
parents: 88412
diff changeset
147 (< (nth 3 x) (nth 3 y)))))))))
27912
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
148 (t
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
149 (error "Invalid charset sort key: %s" sort-key))))
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
150
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
151 (setq charset-info-list (sort charset-info-list sort-func))
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.
88537
4668340a1e0d (list-character-sets-1): Fix last change.
Dave Love <fx@gnu.org>
parents: 88534
diff changeset
154 (dolist (elt charset-info-list)
88534
27fb0f57ffe3 Doc fixes.
Dave Love <fx@gnu.org>
parents: 88412
diff changeset
155 (insert-text-button (symbol-name (car elt))
40639
d3a680cb99fd (describe-character-set)
Miles Bader <miles@gnu.org>
parents: 39475
diff changeset
156 :type 'list-charset-chars
88534
27fb0f57ffe3 Doc fixes.
Dave Love <fx@gnu.org>
parents: 88412
diff changeset
157 'help-args (list (car elt)))
27912
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
158 (goto-char (point-max))
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
159 (insert "\t")
88534
27fb0f57ffe3 Doc fixes.
Dave Love <fx@gnu.org>
parents: 88412
diff changeset
160 ;; (indent-to 40)
27fb0f57ffe3 Doc fixes.
Dave Love <fx@gnu.org>
parents: 88412
diff changeset
161 ;; (insert (nth 2 elt)) ; MULTIBYTE-FORM
27fb0f57ffe3 Doc fixes.
Dave Love <fx@gnu.org>
parents: 88412
diff changeset
162 (indent-to 48)
27fb0f57ffe3 Doc fixes.
Dave Love <fx@gnu.org>
parents: 88412
diff changeset
163 (insert (format "%d %3d " (nth 1 elt) (nth 2 elt)) ; DIMENSION and CHARS
27fb0f57ffe3 Doc fixes.
Dave Love <fx@gnu.org>
parents: 88412
diff changeset
164 (if (< (nth 3 elt) 0)
27fb0f57ffe3 Doc fixes.
Dave Love <fx@gnu.org>
parents: 88412
diff changeset
165 "none"
27fb0f57ffe3 Doc fixes.
Dave Love <fx@gnu.org>
parents: 88412
diff changeset
166 (nth 3 elt))) ; FINAL-CHAR
27912
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
167 (insert "\n"))))
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
168
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
169
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
170 ;; 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
171
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
172 (defun list-character-sets-2 ()
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
173 (insert "#########################
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
174 ## LIST OF CHARSETS
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
175 ## Each line corresponds to one charset.
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
176 ## The following attributes are listed in this order
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
177 ## separated by a colon `:' in one line.
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
178 ## CHARSET-SYMBOL-NAME,
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
179 ## DIMENSION (1 or 2)
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
180 ## CHARS (94 or 96)
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
181 ## WIDTH (occupied column numbers: 1 or 2),
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
182 ## DIRECTION (0:left-to-right, 1:right-to-left),
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
183 ## ISO-FINAL-CHAR (character code of ISO-2022's final character)
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
184 ## ISO-GRAPHIC-PLANE (ISO-2022's graphic plane, 0:GL, 1:GR)
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
185 ## DESCRIPTION (describing string of the charset)
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
186 ")
27912
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
187 (let ((l charset-list)
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
188 charset)
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
189 (while l
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
190 (setq charset (car l) l (cdr l))
88534
27fb0f57ffe3 Doc fixes.
Dave Love <fx@gnu.org>
parents: 88412
diff changeset
191 (princ (format "%s:%d:%d:%d:%d:%s\n"
27912
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
192 charset
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
193 (charset-dimension charset)
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
194 (charset-chars charset)
88534
27fb0f57ffe3 Doc fixes.
Dave Love <fx@gnu.org>
parents: 88412
diff changeset
195 (aref char-width-table (make-char charset))
27fb0f57ffe3 Doc fixes.
Dave Love <fx@gnu.org>
parents: 88412
diff changeset
196 ;;; (charset-direction charset)
27912
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
197 (charset-iso-final-char charset)
88534
27fb0f57ffe3 Doc fixes.
Dave Love <fx@gnu.org>
parents: 88412
diff changeset
198 ;;; (charset-iso-graphic-plane charset)
27912
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
199 (charset-description charset))))))
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
200
88534
27fb0f57ffe3 Doc fixes.
Dave Love <fx@gnu.org>
parents: 88412
diff changeset
201 (defvar non-iso-charset-alist nil
27fb0f57ffe3 Doc fixes.
Dave Love <fx@gnu.org>
parents: 88412
diff changeset
202 "Obsolete.")
27fb0f57ffe3 Doc fixes.
Dave Love <fx@gnu.org>
parents: 88412
diff changeset
203 (make-obsolete-variable 'non-iso-charset-alist "no longer relevant" "22.1")
27912
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
204
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
205 (defun decode-codepage-char (codepage code)
43231
06e0fbd07e17 Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents: 42362
diff changeset
206 "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
207 Return a decoded character string. Each CODEPAGE corresponds to a
88534
27fb0f57ffe3 Doc fixes.
Dave Love <fx@gnu.org>
parents: 88412
diff changeset
208 coding system cpCODEPAGE. This function is obsolete."
27fb0f57ffe3 Doc fixes.
Dave Love <fx@gnu.org>
parents: 88412
diff changeset
209 (decode-char (intern (format "cp%d" codepage)) code))
27fb0f57ffe3 Doc fixes.
Dave Love <fx@gnu.org>
parents: 88412
diff changeset
210 (make-obsolete 'decode-codepage-char 'decode-char "22.1")
27912
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
211
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
212 ;; A variable to hold charset input history.
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
213 (defvar charset-history nil)
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
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
216 ;;;###autoload
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
217 (defun read-charset (prompt &optional default-value initial-input)
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
218 "Read a character set from the minibuffer, prompting with string PROMPT.
88534
27fb0f57ffe3 Doc fixes.
Dave Love <fx@gnu.org>
parents: 88412
diff changeset
219 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
220
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
221 Optional arguments are DEFAULT-VALUE and INITIAL-INPUT.
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
222 DEFAULT-VALUE, if non-nil, is the default value.
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
223 INITIAL-INPUT, if non-nil, is a string inserted in the minibuffer initially.
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
224 See the documentation of the function `completing-read' for the
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
225 detailed meanings of these arguments."
88534
27fb0f57ffe3 Doc fixes.
Dave Love <fx@gnu.org>
parents: 88412
diff changeset
226 (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
227 (charset (completing-read prompt table
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
228 nil t initial-input 'charset-history
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
229 default-value)))
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
230 (if (> (length charset) 0)
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
231 (intern charset))))
30765
1e5a486b8b25 punctuation fixes in doc strings
Sam Steingold <sds@gnu.org>
parents: 30126
diff changeset
232
27912
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
233
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
234 ;; 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
235 ;; 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
236 ;; (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
237 ;; bytes of the characters. If the dimension is one, ROW should be 0.
29454
f0dee30140f0 (non-iso-charset-alist): Specify
Kenichi Handa <handa@m17n.org>
parents: 29228
diff changeset
238 ;; For a non-ISO charset, CHARSET is a translation table (symbol) or a
f0dee30140f0 (non-iso-charset-alist): Specify
Kenichi Handa <handa@m17n.org>
parents: 29228
diff changeset
239 ;; function to get Emacs' character codes that corresponds to the
f0dee30140f0 (non-iso-charset-alist): Specify
Kenichi Handa <handa@m17n.org>
parents: 29228
diff changeset
240 ;; characters to list.
27912
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
241
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
242 (defun list-block-of-chars (charset row min max)
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
243 (let (i ch)
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
244 (insert-char ?- (+ 4 (* 3 16)))
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
245 (insert "\n ")
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
246 (setq i 0)
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
247 (while (< i 16)
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
248 (insert (format "%3X" i))
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
249 (setq i (1+ i)))
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
250 (setq i (* (/ min 16) 16))
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
251 (while (<= i max)
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
252 (if (= (% i 16) 0)
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
253 (insert (format "\n%3Xx" (/ (+ (* row 256) i) 16))))
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
254 (setq ch (cond ((< i min)
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
255 32)
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
256 ((charsetp charset)
88542
a34155e74c6f (list-character-sets): Doc fix.
Dave Love <fx@gnu.org>
parents: 88540
diff changeset
257 (condition-case nil
a34155e74c6f (list-character-sets): Doc fix.
Dave Love <fx@gnu.org>
parents: 88540
diff changeset
258 (if (= row 0)
a34155e74c6f (list-character-sets): Doc fix.
Dave Love <fx@gnu.org>
parents: 88540
diff changeset
259 (make-char charset i)
a34155e74c6f (list-character-sets): Doc fix.
Dave Love <fx@gnu.org>
parents: 88540
diff changeset
260 (make-char charset row i))
a34155e74c6f (list-character-sets): Doc fix.
Dave Love <fx@gnu.org>
parents: 88540
diff changeset
261 (error 32))) ; gap in mapping
29454
f0dee30140f0 (non-iso-charset-alist): Specify
Kenichi Handa <handa@m17n.org>
parents: 29228
diff changeset
262 ((and (symbolp charset) (get charset 'translation-table))
f0dee30140f0 (non-iso-charset-alist): Specify
Kenichi Handa <handa@m17n.org>
parents: 29228
diff changeset
263 (aref (get charset 'translation-table) i))
27912
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
264 (t (funcall charset (+ (* row 256) i)))))
29026
3666bafb45c7 (list-character-sets-1): Handle
Kenichi Handa <handa@m17n.org>
parents: 28964
diff changeset
265 (if (and (char-table-p charset)
3666bafb45c7 (list-character-sets-1): Handle
Kenichi Handa <handa@m17n.org>
parents: 28964
diff changeset
266 (or (< ch 32) (and (>= ch 127) (<= ch 255))))
27912
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
267 ;; Don't insert a control code.
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
268 (setq ch 32))
43231
06e0fbd07e17 Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents: 42362
diff changeset
269 (unless ch (setq ch 32))
06e0fbd07e17 Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents: 42362
diff changeset
270 (if (eq ch ?\t)
06e0fbd07e17 Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents: 42362
diff changeset
271 ;; Make it visible.
06e0fbd07e17 Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents: 42362
diff changeset
272 (setq ch (propertize "\t" 'display "^I")))
06e0fbd07e17 Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents: 42362
diff changeset
273 ;; This doesn't DTRT. Maybe it's better to insert "^J" and not
06e0fbd07e17 Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents: 42362
diff changeset
274 ;; worry about the buffer contents not being correct.
06e0fbd07e17 Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents: 42362
diff changeset
275 ;;; (if (eq ch ?\n)
06e0fbd07e17 Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents: 42362
diff changeset
276 ;;; (setq ch (propertize "\n" 'display "^J")))
29026
3666bafb45c7 (list-character-sets-1): Handle
Kenichi Handa <handa@m17n.org>
parents: 28964
diff changeset
277 (indent-to (+ (* (% i 16) 3) 6))
3666bafb45c7 (list-character-sets-1): Handle
Kenichi Handa <handa@m17n.org>
parents: 28964
diff changeset
278 (insert ch)
27912
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
279 (setq i (1+ i))))
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
280 (insert "\n"))
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
281
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
282 ;;;###autoload
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
283 (defun list-charset-chars (charset)
88540
875760cbcb15 (list-character-sets-2): Avoid
Dave Love <fx@gnu.org>
parents: 88537
diff changeset
284 "Display a list of characters in character set CHARSET."
27912
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
285 (interactive (list (read-charset "Character set: ")))
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
286 (with-output-to-temp-buffer "*Help*"
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
287 (with-current-buffer standard-output
43231
06e0fbd07e17 Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents: 42362
diff changeset
288 (setq indent-tabs-mode nil)
27912
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
289 (set-buffer-multibyte t)
88540
875760cbcb15 (list-character-sets-2): Avoid
Dave Love <fx@gnu.org>
parents: 88537
diff changeset
290 (unless (charsetp charset)
875760cbcb15 (list-character-sets-2): Avoid
Dave Love <fx@gnu.org>
parents: 88537
diff changeset
291 (error "Invalid character set %s" charset))
875760cbcb15 (list-character-sets-2): Avoid
Dave Love <fx@gnu.org>
parents: 88537
diff changeset
292 (let ((dim (charset-dimension charset))
875760cbcb15 (list-character-sets-2): Avoid
Dave Love <fx@gnu.org>
parents: 88537
diff changeset
293 (chars (charset-chars charset))
875760cbcb15 (list-character-sets-2): Avoid
Dave Love <fx@gnu.org>
parents: 88537
diff changeset
294 ;; (plane (charset-iso-graphic-plane charset))
875760cbcb15 (list-character-sets-2): Avoid
Dave Love <fx@gnu.org>
parents: 88537
diff changeset
295 (plane 1)
875760cbcb15 (list-character-sets-2): Avoid
Dave Love <fx@gnu.org>
parents: 88537
diff changeset
296 (range (plist-get (charset-plist charset) :code-space))
875760cbcb15 (list-character-sets-2): Avoid
Dave Love <fx@gnu.org>
parents: 88537
diff changeset
297 min max min2 max2)
875760cbcb15 (list-character-sets-2): Avoid
Dave Love <fx@gnu.org>
parents: 88537
diff changeset
298 (if (> dim 2)
875760cbcb15 (list-character-sets-2): Avoid
Dave Love <fx@gnu.org>
parents: 88537
diff changeset
299 (error "Can only list 1- and 2-dimensional charsets"))
875760cbcb15 (list-character-sets-2): Avoid
Dave Love <fx@gnu.org>
parents: 88537
diff changeset
300 (insert (format "Characters in the coded character set %s.\n" charset))
875760cbcb15 (list-character-sets-2): Avoid
Dave Love <fx@gnu.org>
parents: 88537
diff changeset
301 (setq min (aref range 0)
875760cbcb15 (list-character-sets-2): Avoid
Dave Love <fx@gnu.org>
parents: 88537
diff changeset
302 max (aref range 1))
875760cbcb15 (list-character-sets-2): Avoid
Dave Love <fx@gnu.org>
parents: 88537
diff changeset
303 (if (= dim 1)
875760cbcb15 (list-character-sets-2): Avoid
Dave Love <fx@gnu.org>
parents: 88537
diff changeset
304 (list-block-of-chars charset 0 min max)
875760cbcb15 (list-character-sets-2): Avoid
Dave Love <fx@gnu.org>
parents: 88537
diff changeset
305 (setq min2 (aref range 2)
875760cbcb15 (list-character-sets-2): Avoid
Dave Love <fx@gnu.org>
parents: 88537
diff changeset
306 max2 (aref range 3))
875760cbcb15 (list-character-sets-2): Avoid
Dave Love <fx@gnu.org>
parents: 88537
diff changeset
307 (let ((i min2))
875760cbcb15 (list-character-sets-2): Avoid
Dave Love <fx@gnu.org>
parents: 88537
diff changeset
308 (while (<= i max2)
875760cbcb15 (list-character-sets-2): Avoid
Dave Love <fx@gnu.org>
parents: 88537
diff changeset
309 (list-block-of-chars charset i min max)
875760cbcb15 (list-character-sets-2): Avoid
Dave Love <fx@gnu.org>
parents: 88537
diff changeset
310 (setq i (1+ i)))))))))
27912
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
311
28899
133a92b8094d (syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents: 28216
diff changeset
312
133a92b8094d (syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents: 28216
diff changeset
313 ;;;###autoload
31246
d8ce7bce2aab (charset-multibyte-form-string): New function.
Kenichi Handa <handa@m17n.org>
parents: 30765
diff changeset
314 (defun describe-character-set (charset)
43231
06e0fbd07e17 Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents: 42362
diff changeset
315 "Display information about built-in character set CHARSET."
88534
27fb0f57ffe3 Doc fixes.
Dave Love <fx@gnu.org>
parents: 88412
diff changeset
316 (interactive (list (read-charset "Charset: ")))
31246
d8ce7bce2aab (charset-multibyte-form-string): New function.
Kenichi Handa <handa@m17n.org>
parents: 30765
diff changeset
317 (or (charsetp charset)
d8ce7bce2aab (charset-multibyte-form-string): New function.
Kenichi Handa <handa@m17n.org>
parents: 30765
diff changeset
318 (error "Invalid charset: %S" charset))
88537
4668340a1e0d (list-character-sets-1): Fix last change.
Dave Love <fx@gnu.org>
parents: 88534
diff changeset
319 (help-setup-xref (list #'describe-character-set charset) (interactive-p))
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)
c68f88e42678 (describe-character-set): Account for
Dave Love <fx@gnu.org>
parents: 88655
diff changeset
330 (insert ?x))
c68f88e42678 (describe-character-set): Account for
Dave Love <fx@gnu.org>
parents: 88655
diff changeset
331 (insert (format "%d" (charset-chars charset) (1+ i))))
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))))
88537
4668340a1e0d (list-character-sets-1): Fix last change.
Dave Love <fx@gnu.org>
parents: 88534
diff changeset
337 (insert (format "Width (how many columns on screen): %d\n"
88540
875760cbcb15 (list-character-sets-2): Avoid
Dave Love <fx@gnu.org>
parents: 88537
diff changeset
338 (aref char-width-table (make-char charset))))
88637
10c911c19787 (print-coding-system): (Incomplete)
Dave Love <fx@gnu.org>
parents: 88566
diff changeset
339 (let (aliases)
10c911c19787 (print-coding-system): (Incomplete)
Dave Love <fx@gnu.org>
parents: 88566
diff changeset
340 (dolist (c charset-list)
10c911c19787 (print-coding-system): (Incomplete)
Dave Love <fx@gnu.org>
parents: 88566
diff changeset
341 (if (and (not (eq c charset))
10c911c19787 (print-coding-system): (Incomplete)
Dave Love <fx@gnu.org>
parents: 88566
diff changeset
342 (eq charset (get-charset-property c :name)))
10c911c19787 (print-coding-system): (Incomplete)
Dave Love <fx@gnu.org>
parents: 88566
diff changeset
343 (push c aliases)))
10c911c19787 (print-coding-system): (Incomplete)
Dave Love <fx@gnu.org>
parents: 88566
diff changeset
344 (if aliases
10c911c19787 (print-coding-system): (Incomplete)
Dave Love <fx@gnu.org>
parents: 88566
diff changeset
345 (insert "Aliases: " (mapconcat #'symbol-name aliases ", ") ?\n)))
10c911c19787 (print-coding-system): (Incomplete)
Dave Love <fx@gnu.org>
parents: 88566
diff changeset
346
10c911c19787 (print-coding-system): (Incomplete)
Dave Love <fx@gnu.org>
parents: 88566
diff changeset
347 (dolist (elt `((:ascii-compatible-p "ASCII compatible." nil)
10c911c19787 (print-coding-system): (Incomplete)
Dave Love <fx@gnu.org>
parents: 88566
diff changeset
348 (:map "Map file: " identity)
10c911c19787 (print-coding-system): (Incomplete)
Dave Love <fx@gnu.org>
parents: 88566
diff changeset
349 (:unify-map "Unification map file: " identity)
10c911c19787 (print-coding-system): (Incomplete)
Dave Love <fx@gnu.org>
parents: 88566
diff changeset
350 (:invalid-code
10c911c19787 (print-coding-system): (Incomplete)
Dave Love <fx@gnu.org>
parents: 88566
diff changeset
351 nil
10c911c19787 (print-coding-system): (Incomplete)
Dave Love <fx@gnu.org>
parents: 88566
diff changeset
352 ,(lambda (c)
10c911c19787 (print-coding-system): (Incomplete)
Dave Love <fx@gnu.org>
parents: 88566
diff changeset
353 (format "Invalid character: %c (code %d)" c c)))
10c911c19787 (print-coding-system): (Incomplete)
Dave Love <fx@gnu.org>
parents: 88566
diff changeset
354 (:emacs-mule-id "Id in emacs-mule coding system: "
10c911c19787 (print-coding-system): (Incomplete)
Dave Love <fx@gnu.org>
parents: 88566
diff changeset
355 number-to-string)
10c911c19787 (print-coding-system): (Incomplete)
Dave Love <fx@gnu.org>
parents: 88566
diff changeset
356 (:parents "Parents: "
10c911c19787 (print-coding-system): (Incomplete)
Dave Love <fx@gnu.org>
parents: 88566
diff changeset
357 (lambda (parents)
10c911c19787 (print-coding-system): (Incomplete)
Dave Love <fx@gnu.org>
parents: 88566
diff changeset
358 (mapconcat ,(lambda (elt)
10c911c19787 (print-coding-system): (Incomplete)
Dave Love <fx@gnu.org>
parents: 88566
diff changeset
359 (format "%s" elt))
10c911c19787 (print-coding-system): (Incomplete)
Dave Love <fx@gnu.org>
parents: 88566
diff changeset
360 parents
10c911c19787 (print-coding-system): (Incomplete)
Dave Love <fx@gnu.org>
parents: 88566
diff changeset
361 ", ")))
10c911c19787 (print-coding-system): (Incomplete)
Dave Love <fx@gnu.org>
parents: 88566
diff changeset
362 (:code-space "Code space: " ,(lambda (c)
10c911c19787 (print-coding-system): (Incomplete)
Dave Love <fx@gnu.org>
parents: 88566
diff changeset
363 (format "%s" c)))
10c911c19787 (print-coding-system): (Incomplete)
Dave Love <fx@gnu.org>
parents: 88566
diff changeset
364 (:code-offset "Code offset: " number-to-string)
10c911c19787 (print-coding-system): (Incomplete)
Dave Love <fx@gnu.org>
parents: 88566
diff changeset
365 (:iso-revision-number "ISO revision number: "
10c911c19787 (print-coding-system): (Incomplete)
Dave Love <fx@gnu.org>
parents: 88566
diff changeset
366 number-to-string)
10c911c19787 (print-coding-system): (Incomplete)
Dave Love <fx@gnu.org>
parents: 88566
diff changeset
367 (:supplementary-p
10c911c19787 (print-coding-system): (Incomplete)
Dave Love <fx@gnu.org>
parents: 88566
diff changeset
368 "Used only as a parent of some other charset." nil)))
10c911c19787 (print-coding-system): (Incomplete)
Dave Love <fx@gnu.org>
parents: 88566
diff changeset
369 (let ((val (get-charset-property charset (car elt))))
10c911c19787 (print-coding-system): (Incomplete)
Dave Love <fx@gnu.org>
parents: 88566
diff changeset
370 (when val
10c911c19787 (print-coding-system): (Incomplete)
Dave Love <fx@gnu.org>
parents: 88566
diff changeset
371 (if (cadr elt) (insert (cadr elt)))
10c911c19787 (print-coding-system): (Incomplete)
Dave Love <fx@gnu.org>
parents: 88566
diff changeset
372 (if (nth 2 elt)
10c911c19787 (print-coding-system): (Incomplete)
Dave Love <fx@gnu.org>
parents: 88566
diff changeset
373 (insert (funcall (nth 2 elt) val)))
10c911c19787 (print-coding-system): (Incomplete)
Dave Love <fx@gnu.org>
parents: 88566
diff changeset
374 (insert ?\n)))))))
31246
d8ce7bce2aab (charset-multibyte-form-string): New function.
Kenichi Handa <handa@m17n.org>
parents: 30765
diff changeset
375
d8ce7bce2aab (charset-multibyte-form-string): New function.
Kenichi Handa <handa@m17n.org>
parents: 30765
diff changeset
376 ;;;###autoload
28899
133a92b8094d (syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents: 28216
diff changeset
377 (defun describe-char-after (&optional pos)
35585
a185af43bdf4 (describe-char-after): Doc fix.
Dave Love <fx@gnu.org>
parents: 34931
diff changeset
378 "Display information about the character at POS in the current buffer.
a185af43bdf4 (describe-char-after): Doc fix.
Dave Love <fx@gnu.org>
parents: 34931
diff changeset
379 POS defaults to point.
28899
133a92b8094d (syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents: 28216
diff changeset
380 The information includes character code, charset and code points in it,
133a92b8094d (syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents: 28216
diff changeset
381 syntax, category, how the character is encoded in a file,
133a92b8094d (syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents: 28216
diff changeset
382 which font is being used for displaying the character."
133a92b8094d (syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents: 28216
diff changeset
383 (interactive)
133a92b8094d (syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents: 28216
diff changeset
384 (or pos
133a92b8094d (syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents: 28216
diff changeset
385 (setq pos (point)))
133a92b8094d (syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents: 28216
diff changeset
386 (if (>= pos (point-max))
133a92b8094d (syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents: 28216
diff changeset
387 (error "No character at point"))
133a92b8094d (syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents: 28216
diff changeset
388 (let* ((char (char-after pos))
133a92b8094d (syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents: 28216
diff changeset
389 (charset (char-charset char))
42362
daf469acc6d9 (describe-char-after): Describe the text properties of the char after point.
Richard M. Stallman <rms@gnu.org>
parents: 42209
diff changeset
390 (props (text-properties-at pos))
28899
133a92b8094d (syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents: 28216
diff changeset
391 (composition (find-composition (point) nil nil t))
133a92b8094d (syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents: 28216
diff changeset
392 (composed (if composition (buffer-substring (car composition)
133a92b8094d (syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents: 28216
diff changeset
393 (nth 1 composition))))
34764
14e6e9496603 (describe-char-after): Make *Help*
Kenichi Handa <handa@m17n.org>
parents: 34631
diff changeset
394 (multibyte-p enable-multibyte-characters)
28899
133a92b8094d (syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents: 28216
diff changeset
395 item-list max-width)
88648
dd88ab5e7207 (describe-current-coding-system): Fix
Dave Love <fx@gnu.org>
parents: 88637
diff changeset
396 (if (not (characterp char))
28964
7ba5753774e5 (describe-char-after): Call
Kenichi Handa <handa@m17n.org>
parents: 28899
diff changeset
397 (setq item-list
7ba5753774e5 (describe-char-after): Call
Kenichi Handa <handa@m17n.org>
parents: 28899
diff changeset
398 `(("character"
7ba5753774e5 (describe-char-after): Call
Kenichi Handa <handa@m17n.org>
parents: 28899
diff changeset
399 ,(format "%s (0%o, %d, 0x%x) -- invalid character code"
88648
dd88ab5e7207 (describe-current-coding-system): Fix
Dave Love <fx@gnu.org>
parents: 88637
diff changeset
400 (char-to-string char) char char char))))
28899
133a92b8094d (syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents: 28216
diff changeset
401 (setq item-list
133a92b8094d (syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents: 28216
diff changeset
402 `(("character"
88648
dd88ab5e7207 (describe-current-coding-system): Fix
Dave Love <fx@gnu.org>
parents: 88637
diff changeset
403 ,(format "%s (0%o, %d, 0x%x%s)"
dd88ab5e7207 (describe-current-coding-system): Fix
Dave Love <fx@gnu.org>
parents: 88637
diff changeset
404 (if (< char 256)
dd88ab5e7207 (describe-current-coding-system): Fix
Dave Love <fx@gnu.org>
parents: 88637
diff changeset
405 (single-key-description char)
dd88ab5e7207 (describe-current-coding-system): Fix
Dave Love <fx@gnu.org>
parents: 88637
diff changeset
406 (char-to-string char))
dd88ab5e7207 (describe-current-coding-system): Fix
Dave Love <fx@gnu.org>
parents: 88637
diff changeset
407 char char char
dd88ab5e7207 (describe-current-coding-system): Fix
Dave Love <fx@gnu.org>
parents: 88637
diff changeset
408 (if (encode-char char 'ucs)
dd88ab5e7207 (describe-current-coding-system): Fix
Dave Love <fx@gnu.org>
parents: 88637
diff changeset
409 (format ", U+%04X" (encode-char char 'ucs))
dd88ab5e7207 (describe-current-coding-system): Fix
Dave Love <fx@gnu.org>
parents: 88637
diff changeset
410 "")))
dd88ab5e7207 (describe-current-coding-system): Fix
Dave Love <fx@gnu.org>
parents: 88637
diff changeset
411 ("preferred charset"
28899
133a92b8094d (syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents: 28216
diff changeset
412 ,(symbol-name charset)
133a92b8094d (syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents: 28216
diff changeset
413 ,(format "(%s)" (charset-description charset)))
133a92b8094d (syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents: 28216
diff changeset
414 ("code point"
133a92b8094d (syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents: 28216
diff changeset
415 ,(let ((split (split-char char)))
88540
875760cbcb15 (list-character-sets-2): Avoid
Dave Love <fx@gnu.org>
parents: 88537
diff changeset
416 (mapconcat #'number-to-string (cdr split) " ")))
28899
133a92b8094d (syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents: 28216
diff changeset
417 ("syntax"
43231
06e0fbd07e17 Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents: 42362
diff changeset
418 ,(let* ((old-table (syntax-table))
06e0fbd07e17 Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents: 42362
diff changeset
419 (table (get-char-property (point) 'syntax-table)))
06e0fbd07e17 Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents: 42362
diff changeset
420 (if (consp table)
06e0fbd07e17 Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents: 42362
diff changeset
421 (nth 1 (assq (car table)
06e0fbd07e17 Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents: 42362
diff changeset
422 (mapcar #'cdr syntax-code-table)))
06e0fbd07e17 Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents: 42362
diff changeset
423 (unwind-protect
06e0fbd07e17 Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents: 42362
diff changeset
424 (progn
06e0fbd07e17 Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents: 42362
diff changeset
425 (if (syntax-table-p table)
06e0fbd07e17 Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents: 42362
diff changeset
426 (set-syntax-table table))
06e0fbd07e17 Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents: 42362
diff changeset
427 (nth 2 (assq (char-syntax char) syntax-code-table)))
06e0fbd07e17 Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents: 42362
diff changeset
428 (set-syntax-table old-table)))))
28899
133a92b8094d (syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents: 28216
diff changeset
429 ("category"
133a92b8094d (syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents: 28216
diff changeset
430 ,@(let ((category-set (char-category-set char)))
133a92b8094d (syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents: 28216
diff changeset
431 (if (not category-set)
133a92b8094d (syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents: 28216
diff changeset
432 '("-- none --")
133a92b8094d (syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents: 28216
diff changeset
433 (mapcar #'(lambda (x) (format "%c:%s "
133a92b8094d (syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents: 28216
diff changeset
434 x (category-docstring x)))
133a92b8094d (syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents: 28216
diff changeset
435 (category-set-mnemonics category-set)))))
43231
06e0fbd07e17 Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents: 42362
diff changeset
436 ,@(let ((props (aref char-code-property-table char))
06e0fbd07e17 Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents: 42362
diff changeset
437 ps)
06e0fbd07e17 Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents: 42362
diff changeset
438 (when props
06e0fbd07e17 Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents: 42362
diff changeset
439 (while props
06e0fbd07e17 Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents: 42362
diff changeset
440 (push (format "%s:" (pop props)) ps)
06e0fbd07e17 Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents: 42362
diff changeset
441 (push (format "%s;" (pop props)) ps))
06e0fbd07e17 Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents: 42362
diff changeset
442 (list (cons "Properties" (nreverse ps)))))
28899
133a92b8094d (syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents: 28216
diff changeset
443 ("buffer code"
133a92b8094d (syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents: 28216
diff changeset
444 ,(encoded-string-description
133a92b8094d (syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents: 28216
diff changeset
445 (string-as-unibyte (char-to-string char)) nil))
133a92b8094d (syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents: 28216
diff changeset
446 ("file code"
133a92b8094d (syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents: 28216
diff changeset
447 ,@(let* ((coding buffer-file-coding-system)
133a92b8094d (syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents: 28216
diff changeset
448 (encoded (encode-coding-char char coding)))
133a92b8094d (syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents: 28216
diff changeset
449 (if encoded
133a92b8094d (syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents: 28216
diff changeset
450 (list (encoded-string-description encoded coding)
133a92b8094d (syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents: 28216
diff changeset
451 (format "(encoded by coding system %S)" coding))
133a92b8094d (syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents: 28216
diff changeset
452 (list "not encodable by coding system"
133a92b8094d (syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents: 28216
diff changeset
453 (symbol-name coding)))))
29187
a51adf4f0b66 (describe-char-after): Use
Eli Zaretskii <eliz@gnu.org>
parents: 29057
diff changeset
454 ,(if (display-graphic-p (selected-frame))
28964
7ba5753774e5 (describe-char-after): Call
Kenichi Handa <handa@m17n.org>
parents: 28899
diff changeset
455 (list "font" (or (internal-char-font (point))
7ba5753774e5 (describe-char-after): Call
Kenichi Handa <handa@m17n.org>
parents: 28899
diff changeset
456 "-- none --"))
28899
133a92b8094d (syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents: 28216
diff changeset
457 (list "terminal code"
133a92b8094d (syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents: 28216
diff changeset
458 (let* ((coding (terminal-coding-system))
133a92b8094d (syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents: 28216
diff changeset
459 (encoded (encode-coding-char char coding)))
133a92b8094d (syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents: 28216
diff changeset
460 (if encoded
133a92b8094d (syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents: 28216
diff changeset
461 (encoded-string-description encoded coding)
88818
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
462 "not encodable"))))
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
463 ,@(let ((unicodedata (if (encode-char char 'ucs)
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
464 (unicode-data char))))
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
465 (if unicodedata
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
466 (cons (list "Unicode data" " ") unicodedata))))))
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
467 (setq max-width (apply #'max (mapcar #'(lambda (x)
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
468 (if (cadr x)
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
469 (length (car x))
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
470 0))
28964
7ba5753774e5 (describe-char-after): Call
Kenichi Handa <handa@m17n.org>
parents: 28899
diff changeset
471 item-list)))
7ba5753774e5 (describe-char-after): Call
Kenichi Handa <handa@m17n.org>
parents: 28899
diff changeset
472 (with-output-to-temp-buffer "*Help*"
7ba5753774e5 (describe-char-after): Call
Kenichi Handa <handa@m17n.org>
parents: 28899
diff changeset
473 (save-excursion
7ba5753774e5 (describe-char-after): Call
Kenichi Handa <handa@m17n.org>
parents: 28899
diff changeset
474 (set-buffer standard-output)
34764
14e6e9496603 (describe-char-after): Make *Help*
Kenichi Handa <handa@m17n.org>
parents: 34631
diff changeset
475 (set-buffer-multibyte multibyte-p)
28964
7ba5753774e5 (describe-char-after): Call
Kenichi Handa <handa@m17n.org>
parents: 28899
diff changeset
476 (let ((formatter (format "%%%ds:" max-width)))
7ba5753774e5 (describe-char-after): Call
Kenichi Handa <handa@m17n.org>
parents: 28899
diff changeset
477 (dolist (elt item-list)
88818
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
478 (when (cadr elt)
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
479 (insert (format formatter (car elt)))
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
480 (dolist (clm (cdr elt))
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
481 (when (>= (+ (current-column)
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
482 (or (string-match "\n" clm)
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
483 (string-width clm)) 1)
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
484 (frame-width))
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
485 (insert "\n")
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
486 (indent-to (1+ max-width)))
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
487 (insert " " clm))
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
488 (insert "\n"))))
28964
7ba5753774e5 (describe-char-after): Call
Kenichi Handa <handa@m17n.org>
parents: 28899
diff changeset
489 (when composition
34078
ebb2d5e5973e (describe-char-after): Fix typo.
Kenichi Handa <handa@m17n.org>
parents: 33837
diff changeset
490 (insert "\nComposed with the following character(s) "
28964
7ba5753774e5 (describe-char-after): Call
Kenichi Handa <handa@m17n.org>
parents: 28899
diff changeset
491 (mapconcat (lambda (x) (format "`%c'" x))
7ba5753774e5 (describe-char-after): Call
Kenichi Handa <handa@m17n.org>
parents: 28899
diff changeset
492 (substring composed 1)
7ba5753774e5 (describe-char-after): Call
Kenichi Handa <handa@m17n.org>
parents: 28899
diff changeset
493 ", ")
7ba5753774e5 (describe-char-after): Call
Kenichi Handa <handa@m17n.org>
parents: 28899
diff changeset
494 " to form `" composed "'")
7ba5753774e5 (describe-char-after): Call
Kenichi Handa <handa@m17n.org>
parents: 28899
diff changeset
495 (if (nth 3 composition)
7ba5753774e5 (describe-char-after): Call
Kenichi Handa <handa@m17n.org>
parents: 28899
diff changeset
496 (insert ".\n")
7ba5753774e5 (describe-char-after): Call
Kenichi Handa <handa@m17n.org>
parents: 28899
diff changeset
497 (insert "\nby the rule ("
7ba5753774e5 (describe-char-after): Call
Kenichi Handa <handa@m17n.org>
parents: 28899
diff changeset
498 (mapconcat (lambda (x)
7ba5753774e5 (describe-char-after): Call
Kenichi Handa <handa@m17n.org>
parents: 28899
diff changeset
499 (format (if (consp x) "%S" "?%c") x))
7ba5753774e5 (describe-char-after): Call
Kenichi Handa <handa@m17n.org>
parents: 28899
diff changeset
500 (nth 2 composition)
7ba5753774e5 (describe-char-after): Call
Kenichi Handa <handa@m17n.org>
parents: 28899
diff changeset
501 " ")
7ba5753774e5 (describe-char-after): Call
Kenichi Handa <handa@m17n.org>
parents: 28899
diff changeset
502 ").\n"
43231
06e0fbd07e17 Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents: 42362
diff changeset
503 "See the variable `reference-point-alist' for "
06e0fbd07e17 Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents: 42362
diff changeset
504 "the meaning of the rule.\n")))
42362
daf469acc6d9 (describe-char-after): Describe the text properties of the char after point.
Richard M. Stallman <rms@gnu.org>
parents: 42209
diff changeset
505 (if props
daf469acc6d9 (describe-char-after): Describe the text properties of the char after point.
Richard M. Stallman <rms@gnu.org>
parents: 42209
diff changeset
506 (insert "\nText properties\n"))
daf469acc6d9 (describe-char-after): Describe the text properties of the char after point.
Richard M. Stallman <rms@gnu.org>
parents: 42209
diff changeset
507 (while props
daf469acc6d9 (describe-char-after): Describe the text properties of the char after point.
Richard M. Stallman <rms@gnu.org>
parents: 42209
diff changeset
508 (insert (format " %s: %s" (car props) (cadr props)))
daf469acc6d9 (describe-char-after): Describe the text properties of the char after point.
Richard M. Stallman <rms@gnu.org>
parents: 42209
diff changeset
509 (setq props (cddr props)))
28964
7ba5753774e5 (describe-char-after): Call
Kenichi Handa <handa@m17n.org>
parents: 28899
diff changeset
510 ))))
28899
133a92b8094d (syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents: 28216
diff changeset
511
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
512
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
513 ;;; CODING-SYSTEM
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
514
88648
dd88ab5e7207 (describe-current-coding-system): Fix
Dave Love <fx@gnu.org>
parents: 88637
diff changeset
515 (eval-when-compile ; dynamic bondage
dd88ab5e7207 (describe-current-coding-system): Fix
Dave Love <fx@gnu.org>
parents: 88637
diff changeset
516 (defvar graphic-register))
dd88ab5e7207 (describe-current-coding-system): Fix
Dave Love <fx@gnu.org>
parents: 88637
diff changeset
517
dd88ab5e7207 (describe-current-coding-system): Fix
Dave Love <fx@gnu.org>
parents: 88637
diff changeset
518 ;; Print information about designation of each graphic register in
dd88ab5e7207 (describe-current-coding-system): Fix
Dave Love <fx@gnu.org>
parents: 88637
diff changeset
519 ;; DESIGNATIONS in human readable format. See the documentation of
dd88ab5e7207 (describe-current-coding-system): Fix
Dave Love <fx@gnu.org>
parents: 88637
diff changeset
520 ;; `define-coding-system' for the meaning of DESIGNATIONS
dd88ab5e7207 (describe-current-coding-system): Fix
Dave Love <fx@gnu.org>
parents: 88637
diff changeset
521 ;; (`:designation' property).
dd88ab5e7207 (describe-current-coding-system): Fix
Dave Love <fx@gnu.org>
parents: 88637
diff changeset
522 (defun print-designation (designations)
dd88ab5e7207 (describe-current-coding-system): Fix
Dave Love <fx@gnu.org>
parents: 88637
diff changeset
523 (let (charset)
dd88ab5e7207 (describe-current-coding-system): Fix
Dave Love <fx@gnu.org>
parents: 88637
diff changeset
524 (dotimes (graphic-register 4)
dd88ab5e7207 (describe-current-coding-system): Fix
Dave Love <fx@gnu.org>
parents: 88637
diff changeset
525 (setq charset (aref designations graphic-register))
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
526 (princ (format
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
527 " G%d -- %s\n"
88648
dd88ab5e7207 (describe-current-coding-system): Fix
Dave Love <fx@gnu.org>
parents: 88637
diff changeset
528 graphic-register
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
529 (cond ((null charset)
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
530 "never used")
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
531 ((eq charset t)
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
532 "no initial designation, and used by any charsets")
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
533 ((symbolp charset)
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
534 (format "%s:%s"
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
535 charset (charset-description charset)))
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
536 ((listp charset)
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
537 (if (charsetp (car charset))
88648
dd88ab5e7207 (describe-current-coding-system): Fix
Dave Love <fx@gnu.org>
parents: 88637
diff changeset
538 (format "%s:%s, and also used by the following:"
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
539 (car charset)
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
540 (charset-description (car charset)))
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
541 "no initial designation, and used by the followings:"))
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
542 (t
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
543 "invalid designation information"))))
18559
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
544 (when (listp charset)
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
545 (setq charset (cdr charset))
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
546 (while charset
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
547 (cond ((eq (car charset) t)
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
548 (princ "\tany other charsets\n"))
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
549 ((charsetp (car charset))
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
550 (princ (format "\t%s:%s\n"
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
551 (car charset)
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
552 (charset-description (car charset)))))
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
553 (t
30765
1e5a486b8b25 punctuation fixes in doc strings
Sam Steingold <sds@gnu.org>
parents: 30126
diff changeset
554 "invalid designation information"))
88648
dd88ab5e7207 (describe-current-coding-system): Fix
Dave Love <fx@gnu.org>
parents: 88637
diff changeset
555 (setq charset (cdr charset)))))))
88412
524f9b5b2ac5 (print-designation): Arguments changed.
Kenichi Handa <handa@m17n.org>
parents: 43292
diff changeset
556
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
557 ;;;###autoload
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
558 (defun describe-coding-system (coding-system)
22306
6819832df39b Many doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 22290
diff changeset
559 "Display information about CODING-SYSTEM."
18300
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
560 (interactive "zDescribe coding system (default, current choices): ")
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
561 (if (null coding-system)
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
562 (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
563 (help-setup-xref (list #'describe-coding-system coding-system)
4e5f8e42b8d1 (list-character-sets, sort-listed-character-sets, describe-character-set)
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 40639
diff changeset
564 (interactive-p))
4e5f8e42b8d1 (list-character-sets, sort-listed-character-sets, describe-character-set)
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 40639
diff changeset
565 (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
566 (print-coding-system-briefly coding-system 'doc-string)
88412
524f9b5b2ac5 (print-designation): Arguments changed.
Kenichi Handa <handa@m17n.org>
parents: 43292
diff changeset
567 (let* ((type (coding-system-type coding-system))
88534
27fb0f57ffe3 Doc fixes.
Dave Love <fx@gnu.org>
parents: 88412
diff changeset
568 ;; Fixme: use this
27fb0f57ffe3 Doc fixes.
Dave Love <fx@gnu.org>
parents: 88412
diff changeset
569 (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
570 (princ "Type: ")
88412
524f9b5b2ac5 (print-designation): Arguments changed.
Kenichi Handa <handa@m17n.org>
parents: 43292
diff changeset
571 (princ type)
524f9b5b2ac5 (print-designation): Arguments changed.
Kenichi Handa <handa@m17n.org>
parents: 43292
diff changeset
572 (cond ((eq type 'undecided)
524f9b5b2ac5 (print-designation): Arguments changed.
Kenichi Handa <handa@m17n.org>
parents: 43292
diff changeset
573 (princ " (do automatic conversion)"))
524f9b5b2ac5 (print-designation): Arguments changed.
Kenichi Handa <handa@m17n.org>
parents: 43292
diff changeset
574 ((eq type 'utf-8)
524f9b5b2ac5 (print-designation): Arguments changed.
Kenichi Handa <handa@m17n.org>
parents: 43292
diff changeset
575 (princ " (UTF-8: Emacs internal multibyte form)"))
88648
dd88ab5e7207 (describe-current-coding-system): Fix
Dave Love <fx@gnu.org>
parents: 88637
diff changeset
576 ((eq type 'shift-jis)
88412
524f9b5b2ac5 (print-designation): Arguments changed.
Kenichi Handa <handa@m17n.org>
parents: 43292
diff changeset
577 (princ " (Shift-JIS, MS-KANJI)"))
524f9b5b2ac5 (print-designation): Arguments changed.
Kenichi Handa <handa@m17n.org>
parents: 43292
diff changeset
578 ((eq type 'iso-2022)
524f9b5b2ac5 (print-designation): Arguments changed.
Kenichi Handa <handa@m17n.org>
parents: 43292
diff changeset
579 (princ " (variant of ISO-2022)\n")
88648
dd88ab5e7207 (describe-current-coding-system): Fix
Dave Love <fx@gnu.org>
parents: 88637
diff changeset
580 (princ "Initial designations:\n")
dd88ab5e7207 (describe-current-coding-system): Fix
Dave Love <fx@gnu.org>
parents: 88637
diff changeset
581 (print-designation (coding-system-get coding-system
dd88ab5e7207 (describe-current-coding-system): Fix
Dave Love <fx@gnu.org>
parents: 88637
diff changeset
582 :designation))
dd88ab5e7207 (describe-current-coding-system): Fix
Dave Love <fx@gnu.org>
parents: 88637
diff changeset
583
dd88ab5e7207 (describe-current-coding-system): Fix
Dave Love <fx@gnu.org>
parents: 88637
diff changeset
584 (when (coding-system-get coding-system :flags)
dd88ab5e7207 (describe-current-coding-system): Fix
Dave Love <fx@gnu.org>
parents: 88637
diff changeset
585 (princ "Other specifications: \n ")
dd88ab5e7207 (describe-current-coding-system): Fix
Dave Love <fx@gnu.org>
parents: 88637
diff changeset
586 (apply #'print-list
dd88ab5e7207 (describe-current-coding-system): Fix
Dave Love <fx@gnu.org>
parents: 88637
diff changeset
587 (coding-system-get coding-system :flags))))
88412
524f9b5b2ac5 (print-designation): Arguments changed.
Kenichi Handa <handa@m17n.org>
parents: 43292
diff changeset
588 ((eq type 'charset)
524f9b5b2ac5 (print-designation): Arguments changed.
Kenichi Handa <handa@m17n.org>
parents: 43292
diff changeset
589 (princ " (charset)"))
524f9b5b2ac5 (print-designation): Arguments changed.
Kenichi Handa <handa@m17n.org>
parents: 43292
diff changeset
590 ((eq type 'ccl)
524f9b5b2ac5 (print-designation): Arguments changed.
Kenichi Handa <handa@m17n.org>
parents: 43292
diff changeset
591 (princ " (do conversion by CCL program)"))
524f9b5b2ac5 (print-designation): Arguments changed.
Kenichi Handa <handa@m17n.org>
parents: 43292
diff changeset
592 ((eq type 'raw-text)
524f9b5b2ac5 (print-designation): Arguments changed.
Kenichi Handa <handa@m17n.org>
parents: 43292
diff changeset
593 (princ " (text with random binary characters)"))
88566
2c3cb7fbba2a (describe-coding-system): Avoid error
Dave Love <fx@gnu.org>
parents: 88542
diff changeset
594 ((eq type 'emacs-mule)
2c3cb7fbba2a (describe-coding-system): Avoid error
Dave Love <fx@gnu.org>
parents: 88542
diff changeset
595 (princ " (Emacs 21 internal encoding)"))
88412
524f9b5b2ac5 (print-designation): Arguments changed.
Kenichi Handa <handa@m17n.org>
parents: 43292
diff changeset
596 (t (princ ": invalid coding-system.")))
20163
5ff1329561b4 (list-input-methods): Handle the case
Kenichi Handa <handa@m17n.org>
parents: 20114
diff changeset
597 (princ "\nEOL type: ")
18300
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
598 (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
599 (cond ((vectorp eol-type)
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
600 (princ "Automatic selection from:\n\t")
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
601 (princ eol-type)
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
602 (princ "\n"))
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
603 ((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
604 ((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
605 ((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
606 (t (princ "invalid\n")))))
88534
27fb0f57ffe3 Doc fixes.
Dave Love <fx@gnu.org>
parents: 88412
diff changeset
607 (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
608 (when postread
35585
a185af43bdf4 (describe-char-after): Doc fix.
Dave Love <fx@gnu.org>
parents: 34931
diff changeset
609 (princ "After decoding text normally,")
a185af43bdf4 (describe-char-after): Doc fix.
Dave Love <fx@gnu.org>
parents: 34931
diff changeset
610 (princ " perform post-conversion using the function: ")
20114
cbf191888430 (describe-coding-system): Print
Kenichi Handa <handa@m17n.org>
parents: 20092
diff changeset
611 (princ "\n ")
cbf191888430 (describe-coding-system): Print
Kenichi Handa <handa@m17n.org>
parents: 20092
diff changeset
612 (princ postread)
cbf191888430 (describe-coding-system): Print
Kenichi Handa <handa@m17n.org>
parents: 20092
diff changeset
613 (princ "\n")))
88534
27fb0f57ffe3 Doc fixes.
Dave Love <fx@gnu.org>
parents: 88412
diff changeset
614 (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
615 (when prewrite
35585
a185af43bdf4 (describe-char-after): Doc fix.
Dave Love <fx@gnu.org>
parents: 34931
diff changeset
616 (princ "Before encoding text normally,")
a185af43bdf4 (describe-char-after): Doc fix.
Dave Love <fx@gnu.org>
parents: 34931
diff changeset
617 (princ " perform pre-conversion using the function: ")
20114
cbf191888430 (describe-coding-system): Print
Kenichi Handa <handa@m17n.org>
parents: 20092
diff changeset
618 (princ "\n ")
cbf191888430 (describe-coding-system): Print
Kenichi Handa <handa@m17n.org>
parents: 20092
diff changeset
619 (princ prewrite)
cbf191888430 (describe-coding-system): Print
Kenichi Handa <handa@m17n.org>
parents: 20092
diff changeset
620 (princ "\n")))
40664
4e5f8e42b8d1 (list-character-sets, sort-listed-character-sets, describe-character-set)
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 40639
diff changeset
621 (with-current-buffer standard-output
88566
2c3cb7fbba2a (describe-coding-system): Avoid error
Dave Love <fx@gnu.org>
parents: 88542
diff changeset
622 (let ((charsets (coding-system-charset-list coding-system)))
2c3cb7fbba2a (describe-coding-system): Avoid error
Dave Love <fx@gnu.org>
parents: 88542
diff changeset
623 (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
624 charsets)
88566
2c3cb7fbba2a (describe-coding-system): Avoid error
Dave Love <fx@gnu.org>
parents: 88542
diff changeset
625 (cond
2c3cb7fbba2a (describe-coding-system): Avoid error
Dave Love <fx@gnu.org>
parents: 88542
diff changeset
626 ((eq charsets 'iso-2022)
2c3cb7fbba2a (describe-coding-system): Avoid error
Dave Love <fx@gnu.org>
parents: 88542
diff changeset
627 (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
628 ((eq charsets 'emacs-mule)
2c3cb7fbba2a (describe-coding-system): Avoid error
Dave Love <fx@gnu.org>
parents: 88542
diff changeset
629 (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
630 ."""))
2c3cb7fbba2a (describe-coding-system): Avoid error
Dave Love <fx@gnu.org>
parents: 88542
diff changeset
631 (t
35585
a185af43bdf4 (describe-char-after): Doc fix.
Dave Love <fx@gnu.org>
parents: 34931
diff changeset
632 (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
633 (while charsets
d8ce7bce2aab (charset-multibyte-form-string): New function.
Kenichi Handa <handa@m17n.org>
parents: 30765
diff changeset
634 (insert " " (symbol-name (car charsets)))
d8ce7bce2aab (charset-multibyte-form-string): New function.
Kenichi Handa <handa@m17n.org>
parents: 30765
diff changeset
635 (search-backward (symbol-name (car charsets)))
40639
d3a680cb99fd (describe-character-set)
Miles Bader <miles@gnu.org>
parents: 39475
diff changeset
636 (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
637 (goto-char (point-max))
88566
2c3cb7fbba2a (describe-coding-system): Avoid error
Dave Love <fx@gnu.org>
parents: 88542
diff changeset
638 (setq charsets (cdr charsets)))))))))))
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
639
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
640 ;;;###autoload
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
641 (defun describe-current-coding-system-briefly ()
18199
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
642 "Display coding systems currently used in a brief format in echo area.
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
643
18199
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
644 The format is \"F[..],K[..],T[..],P>[..],P<[..], default F[..],P<[..],P<[..]\",
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
645 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
646 in place of `..':
30765
1e5a486b8b25 punctuation fixes in doc strings
Sam Steingold <sds@gnu.org>
parents: 30126
diff changeset
647 `buffer-file-coding-system' (of the current buffer)
1e5a486b8b25 punctuation fixes in doc strings
Sam Steingold <sds@gnu.org>
parents: 30126
diff changeset
648 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
649 Value returned by `keyboard-coding-system'
30765
1e5a486b8b25 punctuation fixes in doc strings
Sam Steingold <sds@gnu.org>
parents: 30126
diff changeset
650 eol-type of `keyboard-coding-system'
1e5a486b8b25 punctuation fixes in doc strings
Sam Steingold <sds@gnu.org>
parents: 30126
diff changeset
651 Value returned by `terminal-coding-system'.
1e5a486b8b25 punctuation fixes in doc strings
Sam Steingold <sds@gnu.org>
parents: 30126
diff changeset
652 eol-type of `terminal-coding-system'
22306
6819832df39b Many doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 22290
diff changeset
653 `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
654 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
655 `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
656 eol-type of `process-coding-system' for write (of the current buffer, if any)
22306
6819832df39b Many doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 22290
diff changeset
657 `default-buffer-file-coding-system'
30765
1e5a486b8b25 punctuation fixes in doc strings
Sam Steingold <sds@gnu.org>
parents: 30126
diff changeset
658 eol-type of `default-buffer-file-coding-system'
22306
6819832df39b Many doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 22290
diff changeset
659 `default-process-coding-system' for read
30765
1e5a486b8b25 punctuation fixes in doc strings
Sam Steingold <sds@gnu.org>
parents: 30126
diff changeset
660 eol-type of `default-process-coding-system' for read
22306
6819832df39b Many doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 22290
diff changeset
661 `default-process-coding-system' for write
30765
1e5a486b8b25 punctuation fixes in doc strings
Sam Steingold <sds@gnu.org>
parents: 30126
diff changeset
662 eol-type of `default-process-coding-system'"
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
663 (interactive)
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
664 (let* ((proc (get-buffer-process (current-buffer)))
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
665 (process-coding-systems (if proc (process-coding-system proc))))
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
666 (message
24865
a4b8bb7bed21 (describe-current-coding-system-briefly): Fix format string.
Kenichi Handa <handa@m17n.org>
parents: 24724
diff changeset
667 "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
668 (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
669 (coding-system-eol-type-mnemonic buffer-file-coding-system)
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
670 (coding-system-mnemonic (keyboard-coding-system))
18199
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
671 (coding-system-eol-type-mnemonic (keyboard-coding-system))
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
672 (coding-system-mnemonic (terminal-coding-system))
18199
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
673 (coding-system-eol-type-mnemonic (terminal-coding-system))
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
674 (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
675 (coding-system-eol-type-mnemonic (car process-coding-systems))
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
676 (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
677 (coding-system-eol-type-mnemonic (cdr process-coding-systems))
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
678 (coding-system-mnemonic default-buffer-file-coding-system)
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
679 (coding-system-eol-type-mnemonic default-buffer-file-coding-system)
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
680 (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
681 (coding-system-eol-type-mnemonic (car default-process-coding-system))
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
682 (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
683 (coding-system-eol-type-mnemonic (cdr default-process-coding-system))
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
684 )))
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
685
18300
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
686 (defun print-coding-system-briefly (coding-system &optional doc-string)
88534
27fb0f57ffe3 Doc fixes.
Dave Love <fx@gnu.org>
parents: 88412
diff changeset
687 "Print symbol name and mnemonic letter of CODING-SYSTEM with `princ'."
18199
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
688 (if (not coding-system)
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
689 (princ "nil\n")
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
690 (princ (format "%c -- %s"
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
691 (coding-system-mnemonic coding-system)
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
692 coding-system))
88655
ea446bb886ad (print-coding-system-briefly): Fix
Dave Love <fx@gnu.org>
parents: 88648
diff changeset
693 (let ((aliases (coding-system-aliases coding-system)))
20114
cbf191888430 (describe-coding-system): Print
Kenichi Handa <handa@m17n.org>
parents: 20092
diff changeset
694 (if (eq coding-system (car aliases))
cbf191888430 (describe-coding-system): Print
Kenichi Handa <handa@m17n.org>
parents: 20092
diff changeset
695 (if (cdr aliases)
cbf191888430 (describe-coding-system): Print
Kenichi Handa <handa@m17n.org>
parents: 20092
diff changeset
696 (princ (format " %S" (cons 'alias: (cdr aliases)))))
cbf191888430 (describe-coding-system): Print
Kenichi Handa <handa@m17n.org>
parents: 20092
diff changeset
697 (if (memq coding-system aliases)
cbf191888430 (describe-coding-system): Print
Kenichi Handa <handa@m17n.org>
parents: 20092
diff changeset
698 (princ (format " (alias of %s)" (car aliases))))))
42209
2c4fb0cccd48 (describe-coding-system, print-coding-system-briefly): Make printed output have a similar
Werner LEMBERG <wl@gnu.org>
parents: 42163
diff changeset
699 (princ "\n\n")
18199
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
700 (if (and doc-string
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
701 (setq doc-string (coding-system-doc-string coding-system)))
42209
2c4fb0cccd48 (describe-coding-system, print-coding-system-briefly): Make printed output have a similar
Werner LEMBERG <wl@gnu.org>
parents: 42163
diff changeset
702 (princ (format "%s\n" doc-string)))))
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
703
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
704 ;;;###autoload
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
705 (defun describe-current-coding-system ()
22306
6819832df39b Many doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 22290
diff changeset
706 "Display coding systems currently used, in detail."
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
707 (interactive)
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
708 (with-output-to-temp-buffer "*Help*"
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
709 (let* ((proc (get-buffer-process (current-buffer)))
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
710 (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
711 (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
712 (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
713 (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
714 (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
715 (princ "Default coding system (for new files):\n ")
18199
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
716 (print-coding-system-briefly default-buffer-file-coding-system)
19081
f33df9d64fe8 (describe-current-coding-system): Clean up output format.
Richard M. Stallman <rms@gnu.org>
parents: 18799
diff changeset
717 (princ "Coding system for keyboard input:\n ")
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
718 (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
719 (princ "Coding system for terminal output:\n ")
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
720 (print-coding-system-briefly (terminal-coding-system))
88705
80a9a0f0e995 (describe-current-coding-system):
Dave Love <fx@gnu.org>
parents: 88701
diff changeset
721 (princ "Coding system for inter-client cut and paste:\n ")
80a9a0f0e995 (describe-current-coding-system):
Dave Love <fx@gnu.org>
parents: 88701
diff changeset
722 (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
723 (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
724 (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
725 (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
726 (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
727 (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
728 (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
729 (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
730 (princ " decoding: ")
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
731 (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
732 (princ " encoding: ")
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
733 (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
734
40664
4e5f8e42b8d1 (list-character-sets, sort-listed-character-sets, describe-character-set)
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 40639
diff changeset
735 (with-current-buffer standard-output
18300
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
736
43231
06e0fbd07e17 Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents: 42362
diff changeset
737 (princ "
06e0fbd07e17 Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents: 42362
diff changeset
738 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
739 (let ((i 1))
524f9b5b2ac5 (print-designation): Arguments changed.
Kenichi Handa <handa@m17n.org>
parents: 43292
diff changeset
740 (dolist (elt (coding-system-priority-list))
524f9b5b2ac5 (print-designation): Arguments changed.
Kenichi Handa <handa@m17n.org>
parents: 43292
diff changeset
741 (princ (format " %d. %s " i elt))
524f9b5b2ac5 (print-designation): Arguments changed.
Kenichi Handa <handa@m17n.org>
parents: 43292
diff changeset
742 (let ((aliases (coding-system-aliases elt)))
524f9b5b2ac5 (print-designation): Arguments changed.
Kenichi Handa <handa@m17n.org>
parents: 43292
diff changeset
743 (if (eq elt (car aliases))
20114
cbf191888430 (describe-coding-system): Print
Kenichi Handa <handa@m17n.org>
parents: 20092
diff changeset
744 (if (cdr aliases)
88648
dd88ab5e7207 (describe-current-coding-system): Fix
Dave Love <fx@gnu.org>
parents: 88637
diff changeset
745 (princ (cons 'alias: (cdr aliases))))
88412
524f9b5b2ac5 (print-designation): Arguments changed.
Kenichi Handa <handa@m17n.org>
parents: 43292
diff changeset
746 (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
747 (terpri)
88412
524f9b5b2ac5 (print-designation): Arguments changed.
Kenichi Handa <handa@m17n.org>
parents: 43292
diff changeset
748 (setq i (1+ i)))))
20114
cbf191888430 (describe-coding-system): Print
Kenichi Handa <handa@m17n.org>
parents: 20092
diff changeset
749
18300
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
750 (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
751 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
752 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
753
88655
ea446bb886ad (print-coding-system-briefly): Fix
Dave Love <fx@gnu.org>
parents: 88648
diff changeset
754 ;; Fixme: should this be replaced or junked?
88412
524f9b5b2ac5 (print-designation): Arguments changed.
Kenichi Handa <handa@m17n.org>
parents: 43292
diff changeset
755 (if nil
18799
6c0d648d2cf8 (describe-current-coding-system): Use coding-category-iso-7-else
Kenichi Handa <handa@m17n.org>
parents: 18696
diff changeset
756 (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
757 coding-system codings)
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
758 (while categories
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
759 (setq coding-system (symbol-value (car categories)))
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
760 (mapcar
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
761 (function
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
762 (lambda (x)
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
763 (if (and (not (eq x coding-system))
88637
10c911c19787 (print-coding-system): (Incomplete)
Dave Love <fx@gnu.org>
parents: 88566
diff changeset
764 (let ((flags (coding-system-get :flags)))
10c911c19787 (print-coding-system): (Incomplete)
Dave Love <fx@gnu.org>
parents: 88566
diff changeset
765 (not (or (memq 'use-roman flags)
10c911c19787 (print-coding-system): (Incomplete)
Dave Love <fx@gnu.org>
parents: 88566
diff changeset
766 (memq 'use-oldjis flags)))))
18300
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
767 (setq codings (cons x codings)))))
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
768 (get (car categories) 'coding-systems))
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
769 (if codings
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
770 (let ((max-col (frame-width))
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
771 pos)
43231
06e0fbd07e17 Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents: 42362
diff changeset
772 (princ (format "\
06e0fbd07e17 Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents: 42362
diff changeset
773 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
774 coding-system))
18300
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
775 (while codings
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
776 (setq pos (point))
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
777 (insert (format " %s" (car codings)))
18559
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
778 (when (> (current-column) max-col)
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
779 (goto-char pos)
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
780 (insert "\n ")
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
781 (goto-char (point-max)))
18300
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
782 (setq codings (cdr codings)))
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
783 (insert "\n\n")))
88412
524f9b5b2ac5 (print-designation): Arguments changed.
Kenichi Handa <handa@m17n.org>
parents: 43292
diff changeset
784 (setq categories (cdr categories)))))
18300
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
785
19081
f33df9d64fe8 (describe-current-coding-system): Clean up output format.
Richard M. Stallman <rms@gnu.org>
parents: 18799
diff changeset
786 (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
787 (terpri)
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
788 (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
789 (princ " ---------\t--------------\t\t----------------\n")
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
790 (let ((func (lambda (operation alist)
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
791 (princ " ")
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
792 (princ operation)
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
793 (if (not alist)
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
794 (princ "\tnothing specified\n")
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
795 (while alist
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
796 (indent-to 16)
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
797 (prin1 (car (car alist)))
20114
cbf191888430 (describe-coding-system): Print
Kenichi Handa <handa@m17n.org>
parents: 20092
diff changeset
798 (if (>= (current-column) 40)
cbf191888430 (describe-coding-system): Print
Kenichi Handa <handa@m17n.org>
parents: 20092
diff changeset
799 (newline))
18300
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
800 (indent-to 40)
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
801 (princ (cdr (car alist)))
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
802 (princ "\n")
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
803 (setq alist (cdr alist)))))))
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
804 (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
805 (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
806 (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
807 (help-mode))))
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
808
20114
cbf191888430 (describe-coding-system): Print
Kenichi Handa <handa@m17n.org>
parents: 20092
diff changeset
809 (defun print-coding-system (coding-system)
88534
27fb0f57ffe3 Doc fixes.
Dave Love <fx@gnu.org>
parents: 88412
diff changeset
810 "Print detailed information on CODING-SYSTEM."
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
811 (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
812 (eol-type (coding-system-eol-type coding-system))
88637
10c911c19787 (print-coding-system): (Incomplete)
Dave Love <fx@gnu.org>
parents: 88566
diff changeset
813 (flags (coding-system-get coding-system :flags))
88655
ea446bb886ad (print-coding-system-briefly): Fix
Dave Love <fx@gnu.org>
parents: 88648
diff changeset
814 (aliases (coding-system-aliases coding-system)))
20114
cbf191888430 (describe-coding-system): Print
Kenichi Handa <handa@m17n.org>
parents: 20092
diff changeset
815 (if (not (eq (car aliases) coding-system))
cbf191888430 (describe-coding-system): Print
Kenichi Handa <handa@m17n.org>
parents: 20092
diff changeset
816 (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
817 (princ coding-system)
20114
cbf191888430 (describe-coding-system): Print
Kenichi Handa <handa@m17n.org>
parents: 20092
diff changeset
818 (setq aliases (cdr aliases))
18199
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
819 (while aliases
18559
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
820 (princ ",")
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
821 (princ (car aliases))
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
822 (setq aliases (cdr aliases)))
18199
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
823 (princ (format ":%s:%c:%d:"
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
824 type
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
825 (coding-system-mnemonic coding-system)
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
826 (if (integerp eol-type) eol-type 3)))
88637
10c911c19787 (print-coding-system): (Incomplete)
Dave Love <fx@gnu.org>
parents: 88566
diff changeset
827 (cond ((eq type 'iso2022)
18199
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
828 (let ((idx 0)
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
829 charset)
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
830 (while (< idx 4)
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
831 (setq charset (aref flags idx))
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
832 (cond ((null charset)
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
833 (princ -1))
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
834 ((eq charset t)
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
835 (princ -2))
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
836 ((charsetp charset)
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
837 (princ charset))
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
838 ((listp charset)
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
839 (princ "(")
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
840 (princ (car charset))
18199
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
841 (setq charset (cdr charset))
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
842 (while charset
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
843 (princ ",")
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
844 (princ (car charset))
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
845 (setq charset (cdr charset)))
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
846 (princ ")")))
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
847 (princ ",")
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
848 (setq idx (1+ idx)))
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
849 (while (< idx 12)
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
850 (princ (if (aref flags idx) 1 0))
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
851 (princ ",")
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
852 (setq idx (1+ idx)))
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
853 (princ (if (aref flags idx) 1 0))))
88637
10c911c19787 (print-coding-system): (Incomplete)
Dave Love <fx@gnu.org>
parents: 88566
diff changeset
854 ((eq type 'ccl)
18199
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
855 (let (i len)
21967
9f92d6a5254f (print-coding-system):
Richard M. Stallman <rms@gnu.org>
parents: 21469
diff changeset
856 (if (symbolp (car flags))
9f92d6a5254f (print-coding-system):
Richard M. Stallman <rms@gnu.org>
parents: 21469
diff changeset
857 (princ (format " %s" (car flags)))
9f92d6a5254f (print-coding-system):
Richard M. Stallman <rms@gnu.org>
parents: 21469
diff changeset
858 (setq i 0 len (length (car flags)))
9f92d6a5254f (print-coding-system):
Richard M. Stallman <rms@gnu.org>
parents: 21469
diff changeset
859 (while (< i len)
9f92d6a5254f (print-coding-system):
Richard M. Stallman <rms@gnu.org>
parents: 21469
diff changeset
860 (princ (format " %x" (aref (car flags) i)))
9f92d6a5254f (print-coding-system):
Richard M. Stallman <rms@gnu.org>
parents: 21469
diff changeset
861 (setq i (1+ i))))
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
862 (princ ",")
21967
9f92d6a5254f (print-coding-system):
Richard M. Stallman <rms@gnu.org>
parents: 21469
diff changeset
863 (if (symbolp (cdr flags))
9f92d6a5254f (print-coding-system):
Richard M. Stallman <rms@gnu.org>
parents: 21469
diff changeset
864 (princ (format "%s" (cdr flags)))
9f92d6a5254f (print-coding-system):
Richard M. Stallman <rms@gnu.org>
parents: 21469
diff changeset
865 (setq i 0 len (length (cdr flags)))
9f92d6a5254f (print-coding-system):
Richard M. Stallman <rms@gnu.org>
parents: 21469
diff changeset
866 (while (< i len)
9f92d6a5254f (print-coding-system):
Richard M. Stallman <rms@gnu.org>
parents: 21469
diff changeset
867 (princ (format " %x" (aref (cdr flags) i)))
9f92d6a5254f (print-coding-system):
Richard M. Stallman <rms@gnu.org>
parents: 21469
diff changeset
868 (setq i (1+ i))))))
18199
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
869 (t (princ 0)))
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
870 (princ ":")
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
871 (princ (coding-system-doc-string coding-system))
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
872 (princ "\n"))))
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
873
18199
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
874 ;;;###autoload
18559
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
875 (defun list-coding-systems (&optional arg)
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
876 "Display a list of all coding systems.
22306
6819832df39b Many doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 22290
diff changeset
877 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
878
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
879 With prefix arg, the output format gets more cryptic,
22306
6819832df39b Many doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 22290
diff changeset
880 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
881 (interactive "P")
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
882 (with-output-to-temp-buffer "*Help*"
22339
69de59462e22 (list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents: 22306
diff changeset
883 (list-coding-systems-1 arg)))
69de59462e22 (list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents: 22306
diff changeset
884
69de59462e22 (list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents: 22306
diff changeset
885 (defun list-coding-systems-1 (arg)
69de59462e22 (list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents: 22306
diff changeset
886 (if (null arg)
69de59462e22 (list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents: 22306
diff changeset
887 (princ "\
18199
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
888 ###############################################
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
889 # 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
890 # MNEMONIC-LETTER -- CODING-SYSTEM-NAME
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
891 # DOC-STRING
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
892 ")
22339
69de59462e22 (list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents: 22306
diff changeset
893 (princ "\
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
894 #########################
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
895 ## LIST OF CODING SYSTEMS
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
896 ## Each line corresponds to one coding system
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
897 ## Format of a line is:
18199
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
898 ## 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
899 ## :PRE-WRITE-CONVERSION:DOC-STRING,
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
900 ## where
18199
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
901 ## NAME = coding system name
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
902 ## ALIAS = alias of the coding system
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
903 ## 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
904 ## 0 (EMACS-MULE), 1 (SJIS), 2 (ISO2022), 3 (BIG5), or 4 (CCL)
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
905 ## EOL = 0 (LF), 1 (CRLF), 2 (CR), or 3 (Automatic detection)
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
906 ## FLAGS =
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
907 ## if TYPE = 2 then
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
908 ## comma (`,') separated data of the followings:
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
909 ## G0, G1, G2, G3, SHORT-FORM, ASCII-EOL, ASCII-CNTL, SEVEN,
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
910 ## LOCKING-SHIFT, SINGLE-SHIFT, USE-ROMAN, USE-OLDJIS, NO-ISO6429
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
911 ## else if TYPE = 4 then
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
912 ## comma (`,') separated CCL programs for read and write
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
913 ## else
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
914 ## 0
18199
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
915 ## POST-READ-CONVERSION, PRE-WRITE-CONVERSION = function name to be called
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
916 ##
18199
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
917 "))
22339
69de59462e22 (list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents: 22306
diff changeset
918 (let ((bases (coding-system-list 'base-only))
69de59462e22 (list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents: 22306
diff changeset
919 coding-system)
69de59462e22 (list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents: 22306
diff changeset
920 (while bases
69de59462e22 (list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents: 22306
diff changeset
921 (setq coding-system (car bases))
69de59462e22 (list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents: 22306
diff changeset
922 (if (null arg)
69de59462e22 (list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents: 22306
diff changeset
923 (print-coding-system-briefly coding-system 'doc-string)
69de59462e22 (list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents: 22306
diff changeset
924 (print-coding-system coding-system))
69de59462e22 (list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents: 22306
diff changeset
925 (setq bases (cdr bases)))))
18559
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
926
88655
ea446bb886ad (print-coding-system-briefly): Fix
Dave Love <fx@gnu.org>
parents: 88648
diff changeset
927 ;; Fixme: delete?
26688
1830bc1903fb (list-coding-categories): Fix typo;
Gerd Moellmann <gerd@gnu.org>
parents: 26189
diff changeset
928 ;;;###autoload
18559
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
929 (defun list-coding-categories ()
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
930 "Display a list of all coding categories."
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
931 (with-output-to-temp-buffer "*Help*"
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
932 (princ "\
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
933 ############################
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
934 ## LIST OF CODING CATEGORIES (ordered by priority)
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
935 ## CATEGORY:CODING-SYSTEM
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
936 ##
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
937 ")
18559
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
938 (let ((l coding-category-list))
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
939 (while l
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
940 (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
941 (setq l (cdr l))))))
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
942
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
943 ;;; FONT
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
944
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
945 (defun describe-font-internal (font-info &optional verbose)
88534
27fb0f57ffe3 Doc fixes.
Dave Love <fx@gnu.org>
parents: 88412
diff changeset
946 "Print information about a font in FONT-INFO."
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
947 (print-list "name (opened by):" (aref font-info 0))
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
948 (print-list " full name:" (aref font-info 1))
28899
133a92b8094d (syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents: 28216
diff changeset
949 (print-list " size:" (format "%2d" (aref font-info 2)))
133a92b8094d (syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents: 28216
diff changeset
950 (print-list " height:" (format "%2d" (aref font-info 3)))
133a92b8094d (syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents: 28216
diff changeset
951 (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
952 (print-list "relative-compose:" (format "%2d" (aref font-info 5))))
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
953
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
954 ;;;###autoload
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
955 (defun describe-font (fontname)
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
956 "Display information about fonts which partially match FONTNAME."
20092
2b49d1c59b83 (describe-font): Fix prompt.
Karl Heuer <kwzh@gnu.org>
parents: 19876
diff changeset
957 (interactive "sFontname (default, current choice for ASCII chars): ")
28216
cad26a9da36b (describe-font): Don't refer to
Kenichi Handa <handa@m17n.org>
parents: 27973
diff changeset
958 (or (and window-system (fboundp 'fontset-list))
21469
ea652c41eec6 (list-input-methods): Fix doc string.
Karl Heuer <kwzh@gnu.org>
parents: 20731
diff changeset
959 (error "No fontsets being used"))
18696
1caf720e4f55 (print-fontset): Output format improved.
Kenichi Handa <handa@m17n.org>
parents: 18643
diff changeset
960 (when (or (not fontname) (= (length fontname) 0))
1caf720e4f55 (print-fontset): Output format improved.
Kenichi Handa <handa@m17n.org>
parents: 18643
diff changeset
961 (setq fontname (cdr (assq 'font (frame-parameters))))
1caf720e4f55 (print-fontset): Output format improved.
Kenichi Handa <handa@m17n.org>
parents: 18643
diff changeset
962 (if (query-fontset fontname)
1caf720e4f55 (print-fontset): Output format improved.
Kenichi Handa <handa@m17n.org>
parents: 18643
diff changeset
963 (setq fontname
30126
f5fd9fcdaeb2 (describe-font): Adjusted for the chnage of fontset-info.
Kenichi Handa <handa@m17n.org>
parents: 29454
diff changeset
964 (nth 1 (assq 'ascii (aref (fontset-info fontname) 2))))))
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
965 (let ((font-info (font-info fontname)))
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
966 (if (null font-info)
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
967 (message "No matching font")
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
968 (with-output-to-temp-buffer "*Help*"
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
969 (describe-font-internal font-info 'verbose)))))
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
970
18559
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
971 (defun print-fontset (fontset &optional print-fonts)
43231
06e0fbd07e17 Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents: 42362
diff changeset
972 "Print information about FONTSET.
06e0fbd07e17 Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents: 42362
diff changeset
973 If optional arg PRINT-FONTS is non-nil, also print names of all opened
06e0fbd07e17 Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents: 42362
diff changeset
974 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
975 the current buffer."
30126
f5fd9fcdaeb2 (describe-font): Adjusted for the chnage of fontset-info.
Kenichi Handa <handa@m17n.org>
parents: 29454
diff changeset
976 (let ((tail (aref (fontset-info fontset) 2))
28899
133a92b8094d (syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents: 28216
diff changeset
977 elt chars font-spec opened prev-charset charset from to)
18559
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
978 (beginning-of-line)
28899
133a92b8094d (syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents: 28216
diff changeset
979 (insert "Fontset: " fontset "\n")
133a92b8094d (syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents: 28216
diff changeset
980 (insert "CHARSET or CHAR RANGE")
34931
debb78d4e934 (print-fontset): Indent font name by 24 columns, not 25.
Kenichi Handa <handa@m17n.org>
parents: 34764
diff changeset
981 (indent-to 24)
28899
133a92b8094d (syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents: 28216
diff changeset
982 (insert "FONT NAME\n")
133a92b8094d (syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents: 28216
diff changeset
983 (insert "---------------------")
34931
debb78d4e934 (print-fontset): Indent font name by 24 columns, not 25.
Kenichi Handa <handa@m17n.org>
parents: 34764
diff changeset
984 (indent-to 24)
28899
133a92b8094d (syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents: 28216
diff changeset
985 (insert "---------")
133a92b8094d (syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents: 28216
diff changeset
986 (insert "\n")
133a92b8094d (syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents: 28216
diff changeset
987 (while tail
133a92b8094d (syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents: 28216
diff changeset
988 (setq elt (car tail) tail (cdr tail))
133a92b8094d (syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents: 28216
diff changeset
989 (setq chars (car elt) font-spec (car (cdr elt)) opened (cdr (cdr elt)))
133a92b8094d (syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents: 28216
diff changeset
990 (if (symbolp chars)
133a92b8094d (syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents: 28216
diff changeset
991 (setq charset chars from nil to nil)
133a92b8094d (syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents: 28216
diff changeset
992 (if (integerp chars)
133a92b8094d (syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents: 28216
diff changeset
993 (setq charset (char-charset chars) from chars to chars)
133a92b8094d (syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents: 28216
diff changeset
994 (setq charset (char-charset (car chars))
133a92b8094d (syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents: 28216
diff changeset
995 from (car chars) to (cdr chars))))
133a92b8094d (syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents: 28216
diff changeset
996 (unless (eq charset prev-charset)
133a92b8094d (syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents: 28216
diff changeset
997 (insert (symbol-name charset))
133a92b8094d (syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents: 28216
diff changeset
998 (if from
133a92b8094d (syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents: 28216
diff changeset
999 (insert "\n")))
133a92b8094d (syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents: 28216
diff changeset
1000 (when from
133a92b8094d (syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents: 28216
diff changeset
1001 (let ((split (split-char from)))
133a92b8094d (syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents: 28216
diff changeset
1002 (if (and (= (charset-dimension charset) 2)
133a92b8094d (syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents: 28216
diff changeset
1003 (= (nth 2 split) 0))
133a92b8094d (syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents: 28216
diff changeset
1004 (setq from
133a92b8094d (syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents: 28216
diff changeset
1005 (make-char charset (nth 1 split)
133a92b8094d (syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents: 28216
diff changeset
1006 (if (= (charset-chars charset) 94) 33 32))))
133a92b8094d (syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents: 28216
diff changeset
1007 (insert " " from))
133a92b8094d (syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents: 28216
diff changeset
1008 (when (/= from to)
133a92b8094d (syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents: 28216
diff changeset
1009 (insert "-")
133a92b8094d (syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents: 28216
diff changeset
1010 (let ((split (split-char to)))
133a92b8094d (syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents: 28216
diff changeset
1011 (if (and (= (charset-dimension charset) 2)
133a92b8094d (syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents: 28216
diff changeset
1012 (= (nth 2 split) 0))
133a92b8094d (syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents: 28216
diff changeset
1013 (setq to
133a92b8094d (syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents: 28216
diff changeset
1014 (make-char charset (nth 1 split)
133a92b8094d (syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents: 28216
diff changeset
1015 (if (= (charset-chars charset) 94) 126 127))))
133a92b8094d (syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents: 28216
diff changeset
1016 (insert to))))
34931
debb78d4e934 (print-fontset): Indent font name by 24 columns, not 25.
Kenichi Handa <handa@m17n.org>
parents: 34764
diff changeset
1017 (indent-to 24)
88637
10c911c19787 (print-coding-system): (Incomplete)
Dave Love <fx@gnu.org>
parents: 88566
diff changeset
1018 (cond ((stringp font-spec)
10c911c19787 (print-coding-system): (Incomplete)
Dave Love <fx@gnu.org>
parents: 88566
diff changeset
1019 (insert font-spec))
10c911c19787 (print-coding-system): (Incomplete)
Dave Love <fx@gnu.org>
parents: 88566
diff changeset
1020 ((vectorp font-spec)
10c911c19787 (print-coding-system): (Incomplete)
Dave Love <fx@gnu.org>
parents: 88566
diff changeset
1021 (insert "*-" (or (aref font-spec 0) ?*) ; family
10c911c19787 (print-coding-system): (Incomplete)
Dave Love <fx@gnu.org>
parents: 88566
diff changeset
1022 ?- (or (aref font-spec 1) ?*) ; weight
10c911c19787 (print-coding-system): (Incomplete)
Dave Love <fx@gnu.org>
parents: 88566
diff changeset
1023 ?- (or (aref font-spec 2) ?*) ; slant
10c911c19787 (print-coding-system): (Incomplete)
Dave Love <fx@gnu.org>
parents: 88566
diff changeset
1024 "-*-" (or (aref font-spec 3) ?*) ; width
10c911c19787 (print-coding-system): (Incomplete)
Dave Love <fx@gnu.org>
parents: 88566
diff changeset
1025 "-*-" (or (aref font-spec 4) ?*) ; adstyle
10c911c19787 (print-coding-system): (Incomplete)
Dave Love <fx@gnu.org>
parents: 88566
diff changeset
1026 "-*-*-*-*-*-*-" (aref font-spec 5))) ; registry
10c911c19787 (print-coding-system): (Incomplete)
Dave Love <fx@gnu.org>
parents: 88566
diff changeset
1027 (t
10c911c19787 (print-coding-system): (Incomplete)
Dave Love <fx@gnu.org>
parents: 88566
diff changeset
1028 (if (car font-spec)
10c911c19787 (print-coding-system): (Incomplete)
Dave Love <fx@gnu.org>
parents: 88566
diff changeset
1029 (if (string-match "-" (car font-spec))
10c911c19787 (print-coding-system): (Incomplete)
Dave Love <fx@gnu.org>
parents: 88566
diff changeset
1030 (insert "-" (car font-spec) "-*-")
10c911c19787 (print-coding-system): (Incomplete)
Dave Love <fx@gnu.org>
parents: 88566
diff changeset
1031 (insert "-*-" (car font-spec) "-*-"))
10c911c19787 (print-coding-system): (Incomplete)
Dave Love <fx@gnu.org>
parents: 88566
diff changeset
1032 (insert "-*-"))
10c911c19787 (print-coding-system): (Incomplete)
Dave Love <fx@gnu.org>
parents: 88566
diff changeset
1033 (if (cdr font-spec)
10c911c19787 (print-coding-system): (Incomplete)
Dave Love <fx@gnu.org>
parents: 88566
diff changeset
1034 (if (string-match "-" (cdr font-spec))
10c911c19787 (print-coding-system): (Incomplete)
Dave Love <fx@gnu.org>
parents: 88566
diff changeset
1035 (insert (cdr font-spec))
10c911c19787 (print-coding-system): (Incomplete)
Dave Love <fx@gnu.org>
parents: 88566
diff changeset
1036 (insert (cdr font-spec) "-*"))
10c911c19787 (print-coding-system): (Incomplete)
Dave Love <fx@gnu.org>
parents: 88566
diff changeset
1037 (insert "*"))))
28899
133a92b8094d (syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents: 28216
diff changeset
1038 (insert "\n")
133a92b8094d (syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents: 28216
diff changeset
1039 (when print-fonts
133a92b8094d (syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents: 28216
diff changeset
1040 (while opened
133a92b8094d (syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents: 28216
diff changeset
1041 (indent-to 5)
133a92b8094d (syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents: 28216
diff changeset
1042 (insert "[" (car opened) "]\n")
133a92b8094d (syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents: 28216
diff changeset
1043 (setq opened (cdr opened))))
133a92b8094d (syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents: 28216
diff changeset
1044 (setq prev-charset charset)
133a92b8094d (syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents: 28216
diff changeset
1045 )))
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1046
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1047 ;;;###autoload
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1048 (defun describe-fontset (fontset)
43231
06e0fbd07e17 Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents: 42362
diff changeset
1049 "Display information about FONTSET.
28899
133a92b8094d (syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents: 28216
diff changeset
1050 This shows which font is used for which character(s)."
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1051 (interactive
28216
cad26a9da36b (describe-font): Don't refer to
Kenichi Handa <handa@m17n.org>
parents: 27973
diff changeset
1052 (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
1053 (error "No fontsets being used")
35585
a185af43bdf4 (describe-char-after): Doc fix.
Dave Love <fx@gnu.org>
parents: 34931
diff changeset
1054 (let ((fontset-list (nconc
29057
9b29679df993 (list-non-iso-charset-chars, describe-fontset): Remove redundant
Dave Love <fx@gnu.org>
parents: 29026
diff changeset
1055 (mapcar 'list (fontset-list))
9b29679df993 (list-non-iso-charset-chars, describe-fontset): Remove redundant
Dave Love <fx@gnu.org>
parents: 29026
diff changeset
1056 (mapcar (lambda (x) (list (cdr x)))
28899
133a92b8094d (syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents: 28216
diff changeset
1057 fontset-alias-alist)))
18559
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
1058 (completion-ignore-case t))
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
1059 (list (completing-read
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
1060 "Fontset (default, used by the current frame): "
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
1061 fontset-list nil t)))))
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
1062 (if (= (length fontset) 0)
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
1063 (setq fontset (cdr (assq 'font (frame-parameters)))))
28899
133a92b8094d (syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents: 28216
diff changeset
1064 (if (not (setq fontset (query-fontset fontset)))
18559
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
1065 (error "Current frame is using font, not fontset"))
40664
4e5f8e42b8d1 (list-character-sets, sort-listed-character-sets, describe-character-set)
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 40639
diff changeset
1066 (help-setup-xref (list #'describe-fontset fontset) (interactive-p))
4e5f8e42b8d1 (list-character-sets, sort-listed-character-sets, describe-character-set)
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 40639
diff changeset
1067 (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
1068 (with-current-buffer standard-output
28899
133a92b8094d (syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents: 28216
diff changeset
1069 (print-fontset fontset t))))
18559
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
1070
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
1071 ;;;###autoload
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
1072 (defun list-fontsets (arg)
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
1073 "Display a list of all fontsets.
22306
6819832df39b Many doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 22290
diff changeset
1074 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
1075 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
1076 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
1077 (interactive "P")
28216
cad26a9da36b (describe-font): Don't refer to
Kenichi Handa <handa@m17n.org>
parents: 27973
diff changeset
1078 (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
1079 (error "No fontsets being used")
40664
4e5f8e42b8d1 (list-character-sets, sort-listed-character-sets, describe-character-set)
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 40639
diff changeset
1080 (help-setup-xref (list #'list-fontsets arg) (interactive-p))
4e5f8e42b8d1 (list-character-sets, sort-listed-character-sets, describe-character-set)
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 40639
diff changeset
1081 (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
1082 (with-current-buffer standard-output
22339
69de59462e22 (list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents: 22306
diff changeset
1083 ;; 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
1084 (let ((fontsets
782215de9b98 (list-fontsets): Sort fontsets by plain names.
Kenichi Handa <handa@m17n.org>
parents: 23582
diff changeset
1085 (sort (fontset-list)
782215de9b98 (list-fontsets): Sort fontsets by plain names.
Kenichi Handa <handa@m17n.org>
parents: 23582
diff changeset
1086 (function (lambda (x y)
782215de9b98 (list-fontsets): Sort fontsets by plain names.
Kenichi Handa <handa@m17n.org>
parents: 23582
diff changeset
1087 (string< (fontset-plain-name x)
782215de9b98 (list-fontsets): Sort fontsets by plain names.
Kenichi Handa <handa@m17n.org>
parents: 23582
diff changeset
1088 (fontset-plain-name y)))))))
21469
ea652c41eec6 (list-input-methods): Fix doc string.
Karl Heuer <kwzh@gnu.org>
parents: 20731
diff changeset
1089 (while fontsets
28899
133a92b8094d (syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents: 28216
diff changeset
1090 (if arg
133a92b8094d (syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents: 28216
diff changeset
1091 (print-fontset (car fontsets) nil)
133a92b8094d (syntax-description-table): New variable.
Kenichi Handa <handa@m17n.org>
parents: 28216
diff changeset
1092 (insert "Fontset: " (car fontsets) "\n"))
21469
ea652c41eec6 (list-input-methods): Fix doc string.
Karl Heuer <kwzh@gnu.org>
parents: 20731
diff changeset
1093 (setq fontsets (cdr fontsets))))))))
18300
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
1094
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
1095 ;;;###autoload
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
1096 (defun list-input-methods ()
22306
6819832df39b Many doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 22290
diff changeset
1097 "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
1098 (interactive)
0436624abece (list-character-sets): Set major mode of *Help*
Kenichi Handa <handa@m17n.org>
parents: 18199
diff changeset
1099 (with-output-to-temp-buffer "*Help*"
43231
06e0fbd07e17 Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents: 42362
diff changeset
1100 (list-input-methods-1)
06e0fbd07e17 Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents: 42362
diff changeset
1101 (with-current-buffer standard-output
06e0fbd07e17 Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents: 42362
diff changeset
1102 (save-excursion
06e0fbd07e17 Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents: 42362
diff changeset
1103 (goto-char (point-min))
06e0fbd07e17 Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents: 42362
diff changeset
1104 (while (re-search-forward
06e0fbd07e17 Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents: 42362
diff changeset
1105 "^ \\([^ ]+\\) (`.*' in mode line)$" nil t)
43292
dfa162af3bbd (list-input-methods):
Richard M. Stallman <rms@gnu.org>
parents: 43231
diff changeset
1106 (help-xref-button 1 #'help-input-method
43231
06e0fbd07e17 Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents: 42362
diff changeset
1107 (match-string 1)
06e0fbd07e17 Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents: 42362
diff changeset
1108 "mouse-2: describe this method")))
06e0fbd07e17 Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents: 42362
diff changeset
1109 (help-setup-xref '(list-input-methods) (interactive-p)))))
22339
69de59462e22 (list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents: 22306
diff changeset
1110
69de59462e22 (list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents: 22306
diff changeset
1111 (defun list-input-methods-1 ()
69de59462e22 (list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents: 22306
diff changeset
1112 (if (not input-method-alist)
69de59462e22 (list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents: 22306
diff changeset
1113 (progn
69de59462e22 (list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents: 22306
diff changeset
1114 (princ "
21469
ea652c41eec6 (list-input-methods): Fix doc string.
Karl Heuer <kwzh@gnu.org>
parents: 20731
diff changeset
1115 No input method is available, perhaps because you have not yet
43231
06e0fbd07e17 Various doc and message fixes.
Pavel Janík <Pavel@Janik.cz>
parents: 42362
diff changeset
1116 installed LEIM (Libraries of Emacs Input Methods).
20163
5ff1329561b4 (list-input-methods): Handle the case
Kenichi Handa <handa@m17n.org>
parents: 20114
diff changeset
1117
21469
ea652c41eec6 (list-input-methods): Fix doc string.
Karl Heuer <kwzh@gnu.org>
parents: 20731
diff changeset
1118 LEIM is available from the same ftp directory as Emacs. For instance,
39475
4a1c429dd4e3 (list-input-methods-1): Output
Gerd Moellmann <gerd@gnu.org>
parents: 38414
diff changeset
1119 if there exists an archive file `emacs-M.N.tar.gz', there should also
4a1c429dd4e3 (list-input-methods-1): Output
Gerd Moellmann <gerd@gnu.org>
parents: 38414
diff changeset
1120 be a file `leim-M.N.tar.gz'. When you extract this file, LEIM files
4a1c429dd4e3 (list-input-methods-1): Output
Gerd Moellmann <gerd@gnu.org>
parents: 38414
diff changeset
1121 are put under the subdirectory `emacs-M.N/leim'. When you install
20163
5ff1329561b4 (list-input-methods): Handle the case
Kenichi Handa <handa@m17n.org>
parents: 20114
diff changeset
1122 Emacs again, you should be able to use various input methods."))
22339
69de59462e22 (list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents: 22306
diff changeset
1123 (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
1124 (princ " SHORT-DESCRIPTION\n------------------------------\n")
69de59462e22 (list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents: 22306
diff changeset
1125 (setq input-method-alist
69de59462e22 (list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents: 22306
diff changeset
1126 (sort input-method-alist
69de59462e22 (list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents: 22306
diff changeset
1127 (function (lambda (x y) (string< (nth 1 x) (nth 1 y))))))
69de59462e22 (list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents: 22306
diff changeset
1128 (let ((l input-method-alist)
69de59462e22 (list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents: 22306
diff changeset
1129 language elt)
69de59462e22 (list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents: 22306
diff changeset
1130 (while l
69de59462e22 (list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents: 22306
diff changeset
1131 (setq elt (car l) l (cdr l))
69de59462e22 (list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents: 22306
diff changeset
1132 (when (not (equal language (nth 1 elt)))
69de59462e22 (list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents: 22306
diff changeset
1133 (setq language (nth 1 elt))
69de59462e22 (list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents: 22306
diff changeset
1134 (princ language)
69de59462e22 (list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents: 22306
diff changeset
1135 (terpri))
69de59462e22 (list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents: 22306
diff changeset
1136 (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
1137 (car elt)
69de59462e22 (list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents: 22306
diff changeset
1138 (let ((title (nth 3 elt)))
69de59462e22 (list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents: 22306
diff changeset
1139 (if (and (consp title) (stringp (car title)))
69de59462e22 (list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents: 22306
diff changeset
1140 (car title)
69de59462e22 (list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents: 22306
diff changeset
1141 title))
69de59462e22 (list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents: 22306
diff changeset
1142 (let ((description (nth 4 elt)))
69de59462e22 (list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents: 22306
diff changeset
1143 (string-match ".*" description)
69de59462e22 (list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents: 22306
diff changeset
1144 (match-string 0 description))))))))
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1145
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1146 ;;; DIAGNOSIS
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1147
18559
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
1148 ;; 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
1149 (defun insert-section (section-number title)
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1150 (insert "########################################\n"
18559
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
1151 "# Section " (format "%d" section-number) ". " title "\n"
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1152 "########################################\n\n"))
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1153
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1154 ;;;###autoload
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1155 (defun mule-diag ()
24724
df2a95fa1429 (mule-diag): Change MULE to Mule in docstring.
Kenichi Handa <handa@m17n.org>
parents: 24691
diff changeset
1156 "Display diagnosis of the multilingual environment (Mule).
18559
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
1157
22306
6819832df39b Many doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 22290
diff changeset
1158 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
1159 environment, including lists of input methods, coding systems,
22306
6819832df39b Many doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 22290
diff changeset
1160 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
1161 system which uses fontsets)."
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1162 (interactive)
18559
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
1163 (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
1164 (with-current-buffer standard-output
22339
69de59462e22 (list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents: 22306
diff changeset
1165 (insert "###############################################\n"
69de59462e22 (list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents: 22306
diff changeset
1166 "### Current Status of Multilingual Features ###\n"
69de59462e22 (list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents: 22306
diff changeset
1167 "###############################################\n\n"
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1168 "CONTENTS: Section 1. General Information\n"
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1169 " Section 2. Display\n"
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1170 " Section 3. Input methods\n"
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1171 " Section 4. Coding systems\n"
18559
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
1172 " Section 5. Character sets\n")
28216
cad26a9da36b (describe-font): Don't refer to
Kenichi Handa <handa@m17n.org>
parents: 27973
diff changeset
1173 (if (and window-system (fboundp 'fontset-list))
18559
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
1174 (insert " Section 6. Fontsets\n"))
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1175 (insert "\n")
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1176
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1177 (insert-section 1 "General Information")
19425
572165bfff3e (mule-diag): Don't print primary-language.
Richard M. Stallman <rms@gnu.org>
parents: 19265
diff changeset
1178 (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
1179 (insert "Configuration options:\n " system-configuration-options "\n\n")
aeb6db8df2b9 (mule-diag): Insert information about
Kenichi Handa <handa@m17n.org>
parents: 34078
diff changeset
1180 (insert "Multibyte characters awareness:\n"
aeb6db8df2b9 (mule-diag): Insert information about
Kenichi Handa <handa@m17n.org>
parents: 34078
diff changeset
1181 (format " default: %S\n" default-enable-multibyte-characters)
aeb6db8df2b9 (mule-diag): Insert information about
Kenichi Handa <handa@m17n.org>
parents: 34078
diff changeset
1182 (format " current-buffer: %S\n\n" enable-multibyte-characters))
aeb6db8df2b9 (mule-diag): Insert information about
Kenichi Handa <handa@m17n.org>
parents: 34078
diff changeset
1183 (insert "Current language environment: " current-language-environment
aeb6db8df2b9 (mule-diag): Insert information about
Kenichi Handa <handa@m17n.org>
parents: 34078
diff changeset
1184 "\n\n")
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1185
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1186 (insert-section 2 "Display")
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1187 (if window-system
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1188 (insert "Window-system: "
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1189 (symbol-name window-system)
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1190 (format "%s" window-system-version))
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1191 (insert "Terminal: " (getenv "TERM")))
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1192 (insert "\n\n")
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1193
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1194 (if (eq window-system 'x)
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1195 (let ((font (cdr (assq 'font (frame-parameters)))))
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1196 (insert "The selected frame is using the "
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1197 (if (query-fontset font) "fontset" "font")
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1198 ":\n\t" font))
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1199 (insert "Coding system of the terminal: "
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1200 (symbol-name (terminal-coding-system))))
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1201 (insert "\n\n")
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1202
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1203 (insert-section 3 "Input methods")
22339
69de59462e22 (list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents: 22306
diff changeset
1204 (list-input-methods-1)
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1205 (insert "\n")
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1206 (if default-input-method
26189
88faf40281cd (mule-diag): Handle the case that
Kenichi Handa <handa@m17n.org>
parents: 24865
diff changeset
1207 (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
1208 (insert "No default input method is specified\n"))
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1209
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1210 (insert-section 4 "Coding systems")
22339
69de59462e22 (list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents: 22306
diff changeset
1211 (list-coding-systems-1 t)
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1212 (insert "\n")
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1213
18559
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
1214 (insert-section 5 "Character sets")
27912
ed26ed5b0afc (list-character-sets): Completely
Kenichi Handa <handa@m17n.org>
parents: 26688
diff changeset
1215 (list-character-sets-2)
18559
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
1216 (insert "\n")
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1217
28216
cad26a9da36b (describe-font): Don't refer to
Kenichi Handa <handa@m17n.org>
parents: 27973
diff changeset
1218 (when (and window-system (fboundp 'fontset-list))
22339
69de59462e22 (list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents: 22306
diff changeset
1219 ;; This code duplicates most of list-fontsets.
18559
20369fbd0f91 (print-list): Use macro when.
Kenichi Handa <handa@m17n.org>
parents: 18377
diff changeset
1220 (insert-section 6 "Fontsets")
22339
69de59462e22 (list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents: 22306
diff changeset
1221 (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
1222 (insert "------------\t\t\t\t\t\t ----- -----\n")
69de59462e22 (list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents: 22306
diff changeset
1223 (let ((fontsets (fontset-list)))
69de59462e22 (list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents: 22306
diff changeset
1224 (while fontsets
69de59462e22 (list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents: 22306
diff changeset
1225 (print-fontset (car fontsets) t)
69de59462e22 (list-character-sets-1): New subroutine.
Karl Heuer <kwzh@gnu.org>
parents: 22306
diff changeset
1226 (setq fontsets (cdr fontsets)))))
22290
31291d62195e (mule-diag): Don't call help-mode.
Karl Heuer <kwzh@gnu.org>
parents: 21979
diff changeset
1227 (print-help-return-message))))
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1228
88818
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1229 (defcustom unicodedata-file nil
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1230 "Location of UnicodeData file.
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1231 This is the UnicodeData.txt file from the Unicode consortium, used for
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1232 diagnostics. If it is non-nil `describe-char-after' will print data
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1233 looked up from it."
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1234 :group 'mule
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1235 :type '(choice (const :tag "None" nil)
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1236 file))
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1237
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1238 ;; We could convert the unidata file into a Lispy form once-for-all
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1239 ;; and distribute it for loading on demand. It might be made more
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1240 ;; space-efficient by splitting strings word-wise and replacing them
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1241 ;; with lists of symbols interned in a private obarray, e.g.
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1242 ;; "LATIN SMALL LETTER A" => '(LATIN SMALL LETTER A).
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1243 (defun unicode-data (char)
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1244 "Return a list of Unicode data for unicode CHAR.
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1245 Each element is a list of a property description and the property value.
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1246 The list is null if CHAR isn't found in `unicodedata-file'."
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1247 (if unicodedata-file
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1248 (save-excursion
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1249 (set-buffer (find-file-noselect unicodedata-file))
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1250 (goto-char (point-min))
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1251 (let ((hex (format "%04X" char))
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1252 found first last)
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1253 (if (re-search-forward (concat "^" hex) nil t)
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1254 (setq found t)
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1255 ;; It's not listed explicitly. Look for ranges, e.g. CJK
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1256 ;; ideographs, and check whether it's in one of them.
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1257 (while (and (re-search-forward "^\\([^;]+\\);[^;]+First>;" nil t)
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1258 (>= char (setq first
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1259 (string-to-number (match-string 1) 16)))
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1260 (progn
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1261 (forward-line 1)
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1262 (looking-at "^\\([^;]+\\);[^;]+Last>;")
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1263 (> char
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1264 (setq last
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1265 (string-to-number (match-string 1) 16))))))
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1266 (if (and (>= char first)
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1267 (<= char last))
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1268 (setq found t)))
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1269 (if found
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1270 (let ((fields (mapcar (lambda (elt)
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1271 (if (> (length elt) 0)
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1272 elt))
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1273 (cdr (split-string
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1274 (buffer-substring
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1275 (line-beginning-position)
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1276 (line-end-position))
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1277 ";")))))
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1278 ;; The length depends on whether the last field was empty.
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1279 (unless (or (= 13 (length fields))
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1280 (= 14 (length fields)))
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1281 (error "Invalid contents in %s" unicodedata-file))
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1282 ;; The field names and values lists are slightly
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1283 ;; modified from Mule-UCS unidata.el.
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1284 (list
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1285 (list "Name" (let ((name (nth 0 fields)))
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1286 ;; Check for <..., First>, <..., Last>
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1287 (if (string-match "\\`\\(<[^,]+\\)," name)
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1288 (concat (match-string 1 name) ">")
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1289 name)))
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1290 (list "Category"
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1291 (cdr (assoc
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1292 (nth 1 fields)
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1293 '(("Lu" . "uppercase letter")
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1294 ("Ll" . "lowercase letter")
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1295 ("Lt" . "titlecase letter")
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1296 ("Mn" . "non-spacing mark")
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1297 ("Mc" . "spacing-combining mark")
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1298 ("Me" . "enclosing mark")
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1299 ("Nd" . "decimal digit")
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1300 ("Nl" . "letter number")
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1301 ("No" . "other number")
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1302 ("Zs" . "space separator")
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1303 ("Zl" . "line separator")
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1304 ("Zp" . "paragraph separator")
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1305 ("Cc" . "other control")
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1306 ("Cf" . "other format")
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1307 ("Cs" . "surrogate")
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1308 ("Co" . "private use")
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1309 ("Cn" . "not assigned")
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1310 ("Lm" . "modifier letter")
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1311 ("Lo" . "other letter")
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1312 ("Pc" . "connector punctuation")
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1313 ("Pd" . "dash punctuation")
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1314 ("Ps" . "open punctuation")
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1315 ("Pe" . "close punctuation")
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1316 ("Pi" . "initial-quotation punctuation")
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1317 ("Pf" . "final-quotation punctuation")
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1318 ("Po" . "other punctuation")
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1319 ("Sm" . "math symbol")
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1320 ("Sc" . "currency symbol")
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1321 ("Sk" . "modifier symbol")
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1322 ("So" . "other symbol")))))
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1323 (list "Combining class"
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1324 (cdr (assoc
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1325 (string-to-number (nth 2 fields))
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1326 '((0 . "Spacing")
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1327 (1 . "Overlays and interior")
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1328 (7 . "Nuktas")
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1329 (8 . "Hiragana/Katakana voicing marks")
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1330 (9 . "Viramas")
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1331 (10 . "Start of fixed position classes")
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1332 (199 . "End of fixed position classes")
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1333 (200 . "Below left attached")
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1334 (202 . "Below attached")
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1335 (204 . "Below right attached")
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1336 (208 . "Left attached (reordrant around \
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1337 single base character)")
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1338 (210 . "Right attached")
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1339 (212 . "Above left attached")
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1340 (214 . "Above attached")
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1341 (216 . "Above right attached")
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1342 (218 . "Below left")
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1343 (220 . "Below")
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1344 (222 . "Below right")
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1345 (224 . "Left (reordrant around single base \
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1346 character)")
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1347 (226 . "Right")
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1348 (228 . "Above left")
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1349 (230 . "Above")
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1350 (232 . "Above right")
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1351 (233 . "Double below")
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1352 (234 . "Double above")
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1353 (240 . "Below (iota subscript)")))))
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1354 (list "Bidi category"
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1355 (cdr (assoc
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1356 (nth 3 fields)
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1357 '(("L" . "Left-to-Right")
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1358 ("LRE" . "Left-to-Right Embedding")
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1359 ("LRO" . "Left-to-Right Override")
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1360 ("R" . "Right-to-Left")
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1361 ("AL" . "Right-to-Left Arabic")
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1362 ("RLE" . "Right-to-Left Embedding")
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1363 ("RLO" . "Right-to-Left Override")
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1364 ("PDF" . "Pop Directional Format")
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1365 ("EN" . "European Number")
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1366 ("ES" . "European Number Separator")
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1367 ("ET" . "European Number Terminator")
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1368 ("AN" . "Arabic Number")
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1369 ("CS" . "Common Number Separator")
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1370 ("NSM" . "Non-Spacing Mark")
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1371 ("BN" . "Boundary Neutral")
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1372 ("B" . "Paragraph Separator")
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1373 ("S" . "Segment Separator")
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1374 ("WS" . "Whitespace")
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1375 ("ON" . "Other Neutrals")))))
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1376 (list "Decomposition"
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1377 (if (nth 4 fields)
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1378 (let* ((parts (split-string (nth 4 fields)))
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1379 (info (car parts)))
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1380 (if (string-match "\\`<\\(.+\\)>\\'" info)
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1381 (setq info (match-string 1 info))
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1382 (setq info nil))
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1383 (if info (setq parts (cdr parts)))
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1384 (setq parts (mapconcat
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1385 (lambda (arg)
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1386 (string (string-to-number arg 16)))
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1387 parts " "))
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1388 (concat info parts))))
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1389 (list "Decimal digit value"
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1390 (if (nth 5 fields)
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1391 (string-to-number (nth 5 fields))))
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1392 (list "Digit value"
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1393 (if (nth 6 fields)
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1394 (string-to-number (nth 6 fields))))
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1395 (list "Numeric value"
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1396 (if (nth 7 fields)
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1397 (string-to-number (nth 6 fields))))
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1398 (list "Mirrored"
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1399 (if (equal "Y" (nth 8 fields))
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1400 "yes"))
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1401 (list "Old name" (nth 9 fields))
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1402 (list "ISO 10646 comment" (nth 10 fields))
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1403 (list "Uppercase" (and (nth 11 fields)
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1404 (string (string-to-number
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1405 (nth 11 fields) 16))))
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1406 (list "Lowercase" (and (nth 12 fields)
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1407 (string (string-to-number
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1408 (nth 12 fields) 16))))
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1409 (list "Titlecase" (and (nth 13 fields)
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1410 (string (string-to-number
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1411 (nth 13 fields) 16)))))))))))
9ae3a7ed0b93 (describe-char-after): Modify display
Dave Love <fx@gnu.org>
parents: 88705
diff changeset
1412
18199
15177bdb2fcf (describe-coding-system): Change format of output.
Kenichi Handa <handa@m17n.org>
parents: 17315
diff changeset
1413 ;;; mule-diag.el ends here