annotate lisp/tl/char-table.el @ 164:4e0740e5aab2

Added tag r20-3b8 for changeset 0132846995bd
author cvs
date Mon, 13 Aug 2007 09:43:39 +0200
parents 0d2f883870bc
children 85ec50267440
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
86
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
1 ;;; char-table.el --- display table of charset
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
2
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
3 ;; Copyright (C) 1996,1997 MORIOKA Tomohiko
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
4
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
5 ;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 86
diff changeset
6 ;; Version: $Id: char-table.el,v 1.2 1997/02/15 22:21:24 steve Exp $
86
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
7 ;; Keywords: character, Emacs/mule
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
8
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
9 ;; This file is not part of tl (Tiny Library).
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
10
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
11 ;; This program is free software; you can redistribute it and/or
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
12 ;; modify it under the terms of the GNU General Public License as
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
13 ;; published by the Free Software Foundation; either version 2, or (at
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
14 ;; your option) any later version.
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
15
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
16 ;; This program is distributed in the hope that it will be useful, but
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
17 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
19 ;; General Public License for more details.
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
20
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
21 ;; You should have received a copy of the GNU General Public License
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
22 ;; along with GNU Emacs; see the file COPYING. If not, write to the
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
23 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
24 ;; Boston, MA 02111-1307, USA.
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
25
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
26 ;;; Code:
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
27
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
28 (defun char-position-to-string (charset r l &optional plane)
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
29 (char-to-string
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
30 (if plane
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 86
diff changeset
31 (make-char charset plane (+ (* r 16) l))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 86
diff changeset
32 (make-char charset (+ (* r 16) l))
86
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
33 )))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
34
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
35 (defun char-table-1 (charset r l plane)
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
36 (let ((str (char-position-to-string charset r l plane)))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
37 (concat
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
38 (let ((i 0)
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
39 (len (- 3 (string-columns str)))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
40 (dest ""))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
41 (while (< i len)
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
42 (setq dest (concat dest " "))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
43 (setq i (1+ i))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
44 )
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
45 dest) str)))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
46
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
47 (defun show-94-table (charset &optional plane ofs)
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
48 (if (null ofs)
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
49 (setq ofs 0)
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
50 )
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
51 (princ "======================================================\n")
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
52 (princ (format
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
53 "[%3x]: 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F\n"
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
54 (or plane 0)))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
55 (princ "-----+------------------------------------------------\n")
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
56 (let ((j 2))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
57 (princ (format "%2x%x : " (or plane 0) (* (+ j ofs) 16)))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
58 (let ((k 1))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
59 (while (< k 16)
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
60 (princ (char-table-1 charset j k plane))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
61 (setq k (+ k 1))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
62 )
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
63 (princ "\n")
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
64 )
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
65 (setq j 3)
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
66 (while (< j 7)
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
67 (princ (format "%2x%x :" (or plane 0) (* (+ j ofs) 16)))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
68 (let ((k 0))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
69 (while (< k 16)
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
70 (princ (char-table-1 charset j k plane))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
71 (setq k (+ k 1))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
72 )
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
73 (princ "\n")
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
74 )
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
75 (setq j (+ j 1))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
76 )
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
77 (princ (format "%2x%x :" (or plane 0) (* (+ j ofs) 16)))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
78 (let ((k 0))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
79 (while (< k 15)
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
80 (princ (char-table-1 charset j k plane))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
81 (setq k (+ k 1))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
82 )
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
83 (princ "\n")
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
84 )
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
85 ))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
86
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
87 (defun show-96-table (charset &optional plane ofs)
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
88 (if (null ofs)
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
89 (setq ofs 0)
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
90 )
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
91 (princ "======================================================\n")
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
92 (princ (format
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
93 "[%3x]: 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F\n"
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
94 (or plane 0)))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
95 (princ "-----+------------------------------------------------\n")
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
96 (let ((j 2))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
97 (while (< j 8)
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
98 (princ (format "%2x%x :" (or plane 0) (* (+ j ofs) 16)))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
99 (let ((k 0))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
100 (while (< k 16)
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
101 (princ (char-table-1 charset j k plane))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
102 (setq k (+ k 1))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
103 )
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
104 (princ "\n")
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
105 )
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
106 (setq j (1+ j))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
107 )))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
108
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
109 (defun show-94x94-table (charset)
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
110 (let ((i 33))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
111 (while (< i 127)
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
112 (show-94-table charset i)
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
113 (setq i (1+ i))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
114 )))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
115
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
116 (defun show-96x96-table (charset)
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
117 (let ((i 32))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
118 (while (< i 128)
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
119 (show-96-table charset i)
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
120 (setq i (1+ i))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
121 )))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
122
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
123 (defun show-char-table (charset)
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
124 (let ((cc (charset-chars charset))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
125 (cd (charset-dimension charset))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
126 )
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
127 (cond ((= cd 1)
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
128 (cond ((= cc 94)
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
129 (show-94-table charset)
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
130 )
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
131 ((= cc 96)
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
132 (show-96-table charset)
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
133 ))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
134 )
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
135 ((= cd 2)
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
136 (cond ((= cc 94)
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
137 (show-94x94-table charset)
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
138 )
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
139 ((= cc 96)
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
140 (show-96x96-table charset)
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
141 ))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
142 ))))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
143
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
144
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
145 ;;; @ end
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
146 ;;;
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
147
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
148 (provide 'char-table)
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
149
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
150 ;;; char-table.el ends here