annotate lisp/tl/char-table.el @ 86:364816949b59 r20-0b93

Import from CVS: tag r20-0b93
author cvs
date Mon, 13 Aug 2007 09:09:02 +0200
parents
children 0d2f883870bc
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>
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
6 ;; Version: $Id: char-table.el,v 1.1 1997/01/30 02:27:29 steve Exp $
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 (require 'char-util)
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
29
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
30 (defun char-position-to-string (charset r l &optional plane)
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
31 (char-to-string
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
32 (if plane
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
33 (make-character charset plane (row-line-to-char r l))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
34 (make-character charset (row-line-to-char r l))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
35 )))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
36
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
37 (defun char-table-1 (charset r l plane)
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
38 (let ((str (char-position-to-string charset r l plane)))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
39 (concat
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
40 (let ((i 0)
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
41 (len (- 3 (string-columns str)))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
42 (dest ""))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
43 (while (< i len)
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
44 (setq dest (concat dest " "))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
45 (setq i (1+ i))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
46 )
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
47 dest) str)))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
48
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
49 (defun show-94-table (charset &optional plane ofs)
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
50 (if (null ofs)
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
51 (setq ofs 0)
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
52 )
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
53 (princ "======================================================\n")
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
54 (princ (format
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
55 "[%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
56 (or plane 0)))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
57 (princ "-----+------------------------------------------------\n")
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
58 (let ((j 2))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
59 (princ (format "%2x%x : " (or plane 0) (* (+ j ofs) 16)))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
60 (let ((k 1))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
61 (while (< k 16)
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
62 (princ (char-table-1 charset j k plane))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
63 (setq k (+ k 1))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
64 )
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
65 (princ "\n")
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
66 )
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
67 (setq j 3)
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
68 (while (< j 7)
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
69 (princ (format "%2x%x :" (or plane 0) (* (+ j ofs) 16)))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
70 (let ((k 0))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
71 (while (< k 16)
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
72 (princ (char-table-1 charset j k plane))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
73 (setq k (+ k 1))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
74 )
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
75 (princ "\n")
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
76 )
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
77 (setq j (+ j 1))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
78 )
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
79 (princ (format "%2x%x :" (or plane 0) (* (+ j ofs) 16)))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
80 (let ((k 0))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
81 (while (< k 15)
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
82 (princ (char-table-1 charset j k plane))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
83 (setq k (+ k 1))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
84 )
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
85 (princ "\n")
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
86 )
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
87 ))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
88
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
89 (defun show-96-table (charset &optional plane ofs)
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
90 (if (null ofs)
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
91 (setq ofs 0)
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
92 )
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
93 (princ "======================================================\n")
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
94 (princ (format
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
95 "[%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
96 (or plane 0)))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
97 (princ "-----+------------------------------------------------\n")
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
98 (let ((j 2))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
99 (while (< j 8)
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
100 (princ (format "%2x%x :" (or plane 0) (* (+ j ofs) 16)))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
101 (let ((k 0))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
102 (while (< k 16)
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
103 (princ (char-table-1 charset j k plane))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
104 (setq k (+ k 1))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
105 )
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
106 (princ "\n")
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
107 )
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
108 (setq j (1+ j))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
109 )))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
110
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
111 (defun show-94x94-table (charset)
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
112 (let ((i 33))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
113 (while (< i 127)
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
114 (show-94-table charset i)
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
115 (setq i (1+ i))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
116 )))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
117
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
118 (defun show-96x96-table (charset)
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
119 (let ((i 32))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
120 (while (< i 128)
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
121 (show-96-table charset i)
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
122 (setq i (1+ i))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
123 )))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
124
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
125 (defun show-char-table (charset)
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
126 (let ((cc (charset-chars charset))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
127 (cd (charset-dimension charset))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
128 )
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
129 (cond ((= cd 1)
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
130 (cond ((= cc 94)
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
131 (show-94-table charset)
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
132 )
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
133 ((= cc 96)
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
134 (show-96-table charset)
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
135 ))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
136 )
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
137 ((= cd 2)
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
138 (cond ((= cc 94)
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
139 (show-94x94-table charset)
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
140 )
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
141 ((= cc 96)
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
142 (show-96x96-table charset)
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
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
146
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
147 ;;; @ end
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
148 ;;;
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
149
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
150 (provide 'char-table)
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
151
364816949b59 Import from CVS: tag r20-0b93
cvs
parents:
diff changeset
152 ;;; char-table.el ends here