annotate lisp/mule/chartblxmas.el @ 219:262b8bb4a523 r20-4b8

Import from CVS: tag r20-4b8
author cvs
date Mon, 13 Aug 2007 10:09:35 +0200
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
219
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents:
diff changeset
1 ;;; chartblxmas.el --- display table of charset by pop-up menu
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents:
diff changeset
2
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents:
diff changeset
3 ;; Copyright (C) 1997 MORIOKA Tomohiko
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents:
diff changeset
4
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents:
diff changeset
5 ;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents:
diff changeset
6 ;; Version: $Id: chartblxmas.el,v 1.1 1997/11/29 18:44:03 steve Exp $
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents:
diff changeset
7 ;; Keywords: character, XEmacs/mule
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents:
diff changeset
8
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents:
diff changeset
9 ;; This file is part of XEmacs.
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents:
diff changeset
10
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents:
diff changeset
11 ;; XEmacs is free software; you can redistribute it and/or modify it
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents:
diff changeset
12 ;; under the terms of the GNU General Public License as published by
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents:
diff changeset
13 ;; the Free Software Foundation; either version 2, or (at your option)
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents:
diff changeset
14 ;; any later version.
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents:
diff changeset
15
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents:
diff changeset
16 ;; XEmacs is distributed in the hope that it will be useful, but
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents:
diff changeset
17 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents:
diff changeset
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents:
diff changeset
19 ;; General Public License for more details.
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents:
diff changeset
20
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents:
diff changeset
21 ;; You should have received a copy of the GNU General Public License
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents:
diff changeset
22 ;; along with XEmacs; see the file COPYING. If not, write to the Free
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents:
diff changeset
23 ;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents:
diff changeset
24 ;; 02111-1307, USA.
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents:
diff changeset
25
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents:
diff changeset
26 ;;; Code:
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents:
diff changeset
27
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents:
diff changeset
28 (require 'alist)
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents:
diff changeset
29 (require 'char-table)
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents:
diff changeset
30
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents:
diff changeset
31 (defun classify-charsets-by-dimension-and-chars (charset-list)
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents:
diff changeset
32 (let (dest)
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents:
diff changeset
33 (while charset-list
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents:
diff changeset
34 (let* ((charset (car charset-list))
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents:
diff changeset
35 (chars (charset-chars charset))
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents:
diff changeset
36 (dim (charset-dimension charset))
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents:
diff changeset
37 (dim-alist (cdr (assq dim dest)))
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents:
diff changeset
38 )
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents:
diff changeset
39 (setq dest
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents:
diff changeset
40 (put-alist dim
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents:
diff changeset
41 (put-alist chars
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents:
diff changeset
42 (cons charset
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents:
diff changeset
43 (cdr (assq chars dim-alist)))
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents:
diff changeset
44 dim-alist)
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents:
diff changeset
45 dest))
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents:
diff changeset
46 )
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents:
diff changeset
47 (setq charset-list (cdr charset-list))
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents:
diff changeset
48 )
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents:
diff changeset
49 dest))
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents:
diff changeset
50
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents:
diff changeset
51
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents:
diff changeset
52 ;;;###autoload
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents:
diff changeset
53 (defun view-charset-by-menu ()
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents:
diff changeset
54 "Display character table of CHARSET by pop-up menu."
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents:
diff changeset
55 (interactive)
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents:
diff changeset
56 (popup-menu
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents:
diff changeset
57 (cons
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents:
diff changeset
58 "Character set:"
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents:
diff changeset
59 (mapcar (function
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents:
diff changeset
60 (lambda (cat)
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents:
diff changeset
61 (cons (car cat)
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents:
diff changeset
62 (sort
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents:
diff changeset
63 (mapcar (function
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents:
diff changeset
64 (lambda (charset)
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents:
diff changeset
65 (vector (charset-doc-string charset)
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents:
diff changeset
66 `(view-charset ',charset)
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents:
diff changeset
67 t)
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents:
diff changeset
68 ))
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents:
diff changeset
69 (cdr cat))
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents:
diff changeset
70 (function
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents:
diff changeset
71 (lambda (a b)
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents:
diff changeset
72 (string< (aref a 0)(aref b 0))
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents:
diff changeset
73 ))))))
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents:
diff changeset
74 (sort
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents:
diff changeset
75 (let ((rest
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents:
diff changeset
76 (classify-charsets-by-dimension-and-chars (charset-list))
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents:
diff changeset
77 ))
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents:
diff changeset
78 (while rest
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents:
diff changeset
79 (let* ((r (car rest))
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents:
diff changeset
80 (d (car r)))
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents:
diff changeset
81 (setq r (cdr r))
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents:
diff changeset
82 (while r
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents:
diff changeset
83 (let* ((p (car r))
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents:
diff changeset
84 (n (int-to-string (car p)))
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents:
diff changeset
85 (s n)
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents:
diff changeset
86 (i 1))
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents:
diff changeset
87 (while (< i d)
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents:
diff changeset
88 (setq s (concat s " x " n))
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents:
diff changeset
89 (setq i (1+ i)))
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents:
diff changeset
90 (set-alist 'dest (concat s " character set") (cdr p)))
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents:
diff changeset
91 (setq r (cdr r))
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents:
diff changeset
92 ))
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents:
diff changeset
93 (setq rest (cdr rest)))
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents:
diff changeset
94 dest)
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents:
diff changeset
95 (function (lambda (a b)
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents:
diff changeset
96 (string< (car a)(car b))
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents:
diff changeset
97 )))
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents:
diff changeset
98 ))))
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents:
diff changeset
99
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents:
diff changeset
100 ;;; chartblxmas.el ends here