1 ;;; char-db-util.el --- Character Database utility
3 ;; Copyright (C) 1998,1999,2000,2001 MORIOKA Tomohiko.
5 ;; Author: MORIOKA Tomohiko <tomo@kanji.zinbun.kyoto-u.ac.jp>
6 ;; Keywords: UTF-2000, ISO/IEC 10646, Unicode, UCS-4, MULE.
8 ;; This file is part of XEmacs UTF-2000.
10 ;; XEmacs UTF-2000 is free software; you can redistribute it and/or
11 ;; modify it under the terms of the GNU General Public License as
12 ;; published by the Free Software Foundation; either version 2, or (at
13 ;; your option) any later version.
15 ;; XEmacs UTF-2000 is distributed in the hope that it will be useful,
16 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 ;; General Public License for more details.
20 ;; You should have received a copy of the GNU General Public License
21 ;; along with XEmacs UTF-2000; see the file COPYING. If not, write to
22 ;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
23 ;; Boston, MA 02111-1307, USA.
29 (defconst unidata-normative-category-alist
30 '(("Lu" letter uppercase)
31 ("Ll" letter lowercase)
32 ("Lt" letter titlecase)
33 ("Mn" mark non-spacing)
34 ("Mc" mark spacing-combining)
36 ("Nd" number decimal-digit)
39 ("Zs" separator space)
41 ("Zp" separator paragraph)
44 ("Cs" other surrogate)
45 ("Co" other private-use)
46 ("Cn" other not-assigned)))
48 (defconst unidata-informative-category-alist
49 '(("Lm" letter modifier)
51 ("Pc" punctuation connector)
52 ("Pd" punctuation dash)
53 ("Ps" punctuation open)
54 ("Pe" punctuation close)
55 ("Pi" punctuation initial-quote)
56 ("Pf" punctuation final-quote)
57 ("Po" punctuation other)
59 ("Sc" symbol currency)
60 ("Sk" symbol modifier)
64 (defconst ideographic-radicals
65 (let ((v (make-vector 215 nil))
68 (aset v i (int-char (+ #x2EFF i)))
70 (if (< (charset-iso-final-char (car (split-char (aref v 34)))) ?0)
71 (aset v 34 (make-char 'chinese-gb2312 #x62 #x3A)))
74 (defun char-attribute-name< (ka kb)
80 ((= (charset-dimension ka)
81 (charset-dimension kb))
82 (cond ((= (charset-chars ka)(charset-chars kb))
84 ((>= (charset-iso-final-char ka) ?@)
85 (if (>= (charset-iso-final-char kb) ?@)
86 (< (charset-iso-final-char ka)
87 (charset-iso-final-char kb))
89 ((>= (charset-iso-final-char ka) ?0)
91 ((>= (charset-iso-final-char kb) ?@)
93 ((>= (charset-iso-final-char kb) ?0)
94 (< (charset-iso-final-char ka)
95 (charset-iso-final-char kb)))
97 (t (if (>= (charset-iso-final-char kb) ?0)
99 (> (charset-id ka)(charset-id kb))))))
100 ((<= (charset-chars ka)(charset-chars kb)))))
102 (< (charset-dimension ka)
103 (charset-dimension kb))
113 (string< (symbol-name ka)
119 (defvar char-db-coded-charset-priority-list
120 (let ((rest default-coded-charset-priority-list)
123 (when (symbolp (car rest))
124 (cond ((memq (car rest)
133 ((string-match "^ideograph-gt-pj-" (symbol-name (car rest)))
134 (unless (memq 'ideograph-gt dest)
135 (setq dest (cons 'ideograph-gt dest))))
137 (setq dest (cons (car rest) dest)))))
138 (setq rest (cdr rest)))
139 (sort dest #'char-attribute-name<)))
141 (defun char-db-insert-char-spec (char &optional readable column)
143 (setq column (current-column)))
144 (let (char-spec ret al cal key temp-char)
145 (cond ((characterp char)
146 (cond ((and (setq ret (get-char-attribute char 'ucs))
147 (not (and (<= #xE000 ret)(<= ret #xF8FF))))
148 (setq char-spec (list (cons 'ucs ret)))
149 (if (setq ret (get-char-attribute char 'name))
150 (setq char-spec (cons (cons 'name ret) char-spec)))
153 (let ((default-coded-charset-priority-list
154 char-db-coded-charset-priority-list))
156 (setq char-spec (list ret))
157 (dolist (ccs (delq (car ret) (charset-list)))
158 (if (or (and (>= (charset-iso-final-char ccs) ?0)
159 (setq ret (get-char-attribute char ccs)))
160 (eq ccs 'ideograph-daikanwa))
161 (setq char-spec (cons (cons ccs ret) char-spec))))
163 (setq char-spec (split-char char)))
164 (if (setq ret (get-char-attribute char 'name))
165 (setq char-spec (cons (cons 'name ret) char-spec)))
168 (setq char-spec char)
172 (setq char (find-char char-spec))
174 ;; define temporary character
175 ;; Current implementation is dirty.
176 (setq temp-char (define-char (cons '(ideograph-daikanwa . 0)
178 (remove-char-attribute temp-char 'ideograph-daikanwa)
179 (setq char temp-char))
183 (setq key (car (car char-spec)))
184 (if (find-charset key)
185 (setq cal (cons key cal))
186 (setq al (cons key al)))
187 (setq char-spec (cdr char-spec)))
188 (insert-char-attributes char
192 ;; undefine temporary character
193 ;; Current implementation is dirty.
194 (setq char-spec (char-attribute-alist temp-char))
196 (remove-char-attribute temp-char (car (car char-spec)))
197 (setq char-spec (cdr char-spec))))))
199 (defun char-db-insert-alist (alist &optional readable column)
201 (setq column (current-column)))
203 (concat "\n" (make-string (1+ column) ?\ )))
206 lbs cell rest separator)
209 (setq name (car (car alist))
210 value (cdr (car alist)))
211 (cond ((eq name 'char)
213 (if (setq ret (condition-case nil
220 (setq key (car (car value)))
221 (if (find-charset key)
222 (setq cal (cons key cal))
223 (setq al (cons key al)))
224 (setq value (cdr value)))
225 (insert-char-attributes ret
228 (insert (prin1-to-string value)))
230 (insert line-breaking))
232 (insert (format "(%-18s " name))
233 (setq lbs (concat "\n" (make-string (current-column) ?\ )))
235 (setq cell (car value))
236 (if (and (consp cell)
238 (setq ret (condition-case nil
247 (setq key (car (car rest)))
248 (if (find-charset key)
249 (setq cal (cons key cal))
250 (setq al (cons key al)))
251 (setq rest (cdr rest)))
254 (insert-char-attributes ret
257 (setq separator lbs))
260 (insert (prin1-to-string cell))
261 (setq separator " "))
262 (setq value (cdr value)))
264 (insert line-breaking))
266 (insert (format "(%-18s . %S)%s"
269 (setq alist (cdr alist))))
272 (defun char-db-insert-char-reference (plist &optional readable column)
274 (setq column (current-column)))
276 (concat "\n" (make-string (1+ column) ?\ )))
280 (setq name (pop plist))
281 (setq value (pop plist))
282 (cond ((eq name :char)
284 (cond ((numberp value)
285 (setq value (decode-char 'ucs value)))
287 ;; (setq value (or (find-char value)
290 (char-db-insert-char-spec value readable)
291 (insert line-breaking))
293 (insert (format "%s\t%S%s"
299 (defun char-db-decode-isolated-char (ccs code-point)
302 (cond ((eq ccs 'arabic-iso8859-6)
303 (decode-char ccs code-point))
304 ((and (memq ccs '(ideograph-gt-pj-1
315 (setq ret (decode-char ccs code-point))
316 (setq ret (get-char-attribute ret 'ideograph-gt)))
317 (decode-builtin-char 'ideograph-gt ret))
319 (decode-builtin-char ccs code-point))))
320 (cond ((and (<= 0 (char-int ret))
321 (<= (char-int ret) #x1F))
322 (decode-char 'ucs (+ #x2400 (char-int ret))))
323 ((= (char-int ret) #x7F)
327 (defvar char-db-convert-obsolete-format t)
329 (defun insert-char-attributes (char &optional readable
330 attributes ccs-attributes
334 (if (consp attributes)
335 (copy-sequence attributes))
336 (char-attribute-list))
337 #'char-attribute-name<))
339 (sort (if ccs-attributes
340 (copy-sequence ccs-attributes)
342 #'char-attribute-name<))
344 (setq column (current-column)))
345 (let (name value has-long-ccs-name rest
348 (concat "\n" (make-string (1+ column) ?\ )))
349 lbs cell separator ret
352 (when (and (memq 'name attributes)
353 (setq value (get-char-attribute char 'name)))
355 (if (> (+ (current-column) (length value)) 48)
358 value line-breaking))
359 (setq attributes (delq 'name attributes))
361 (when (and (memq 'script attributes)
362 (setq value (get-char-attribute char 'script)))
363 (insert (format "(script\t\t%s)%s"
364 (mapconcat (function prin1-to-string)
367 (setq attributes (delq 'script attributes))
369 (when (and (memq '=>ucs attributes)
370 (setq value (get-char-attribute char '=>ucs)))
371 (insert (format "(=>ucs\t\t. #x%04X)\t; %c%s"
372 value (decode-char 'ucs value)
374 (setq attributes (delq '=>ucs attributes))
376 (when (and (memq '->ucs attributes)
377 (setq value (get-char-attribute char '->ucs)))
378 (insert (format (if char-db-convert-obsolete-format
379 "(=>ucs\t\t. #x%04X)\t; %c%s"
380 "(->ucs\t\t. #x%04X)\t; %c%s")
381 value (decode-char 'ucs value)
383 (setq attributes (delq '->ucs attributes))
385 (when (and (memq 'general-category attributes)
386 (setq value (get-char-attribute char 'general-category)))
388 "(general-category\t%s) ; %s%s"
389 (mapconcat (lambda (cell)
392 (cond ((rassoc value unidata-normative-category-alist)
393 "Normative Category")
394 ((rassoc value unidata-informative-category-alist)
395 "Informative Category")
399 (setq attributes (delq 'general-category attributes))
401 (when (and (memq 'bidi-category attributes)
402 (setq value (get-char-attribute char 'bidi-category)))
403 (insert (format "(bidi-category\t. %S)%s"
406 (setq attributes (delq 'bidi-category attributes))
408 (unless (or (not (memq 'mirrored attributes))
409 (eq (setq value (get-char-attribute char 'mirrored 'empty))
411 (insert (format "(mirrored\t\t. %S)%s"
414 (setq attributes (delq 'mirrored attributes))
417 ((and (memq 'decimal-digit-value attributes)
418 (setq value (get-char-attribute char 'decimal-digit-value)))
419 (insert (format "(decimal-digit-value . %S)%s"
422 (setq attributes (delq 'decimal-digit-value attributes))
423 (when (and (memq 'digit-value attributes)
424 (setq value (get-char-attribute char 'digit-value)))
425 (insert (format "(digit-value\t . %S)%s"
428 (setq attributes (delq 'digit-value attributes))
430 (when (and (memq 'numeric-value attributes)
431 (setq value (get-char-attribute char 'numeric-value)))
432 (insert (format "(numeric-value\t . %S)%s"
435 (setq attributes (delq 'numeric-value attributes))
439 (when (and (memq 'digit-value attributes)
440 (setq value (get-char-attribute char 'digit-value)))
441 (insert (format "(digit-value\t. %S)%s"
444 (setq attributes (delq 'digit-value attributes))
446 (when (and (memq 'numeric-value attributes)
447 (setq value (get-char-attribute char 'numeric-value)))
448 (insert (format "(numeric-value\t. %S)%s"
451 (setq attributes (delq 'numeric-value attributes))
453 (when (and (memq 'iso-10646-comment attributes)
454 (setq value (get-char-attribute char 'iso-10646-comment)))
455 (insert (format "(iso-10646-comment\t. %S)%s"
458 (setq attributes (delq 'iso-10646-comment attributes))
460 (when (and (memq 'morohashi-daikanwa attributes)
461 (setq value (get-char-attribute char 'morohashi-daikanwa)))
462 (insert (format "(morohashi-daikanwa\t%s)%s"
463 (mapconcat (function prin1-to-string) value " ")
465 (setq attributes (delq 'morohashi-daikanwa attributes))
469 (when (and (memq 'ideographic-radical attributes)
470 (setq value (get-char-attribute char 'ideographic-radical)))
472 (insert (format "(ideographic-radical . %S)\t; %c%s"
474 (aref ideographic-radicals radical)
476 (setq attributes (delq 'ideographic-radical attributes))
478 (when (and (memq 'ideographic-strokes attributes)
479 (setq value (get-char-attribute char 'ideographic-strokes)))
481 (insert (format "(ideographic-strokes . %S)%s"
484 (setq attributes (delq 'ideographic-strokes attributes))
486 (when (and (memq 'kangxi-radical attributes)
487 (setq value (get-char-attribute char 'kangxi-radical)))
488 (unless (eq value radical)
489 (insert (format "(kangxi-radical\t . %S)\t; %c%s"
491 (aref ideographic-radicals value)
494 (setq radical value)))
495 (setq attributes (delq 'kangxi-radical attributes))
497 (when (and (memq 'kangxi-strokes attributes)
498 (setq value (get-char-attribute char 'kangxi-strokes)))
499 (unless (eq value strokes)
500 (insert (format "(kangxi-strokes\t . %S)%s"
504 (setq strokes value)))
505 (setq attributes (delq 'kangxi-strokes attributes))
507 (when (and (memq 'japanese-radical attributes)
508 (setq value (get-char-attribute char 'japanese-radical)))
509 (unless (eq value radical)
510 (insert (format "(japanese-radical\t . %S)\t; %c%s"
512 (aref ideographic-radicals value)
515 (setq radical value)))
516 (setq attributes (delq 'japanese-radical attributes))
518 (when (and (memq 'japanese-strokes attributes)
519 (setq value (get-char-attribute char 'japanese-strokes)))
520 (unless (eq value strokes)
521 (insert (format "(japanese-strokes\t . %S)%s"
525 (setq strokes value)))
526 (setq attributes (delq 'japanese-strokes attributes))
528 (when (and (memq 'cns-radical attributes)
529 (setq value (get-char-attribute char 'cns-radical)))
530 (insert (format "(cns-radical\t . %S)\t; %c%s"
532 (aref ideographic-radicals value)
534 (setq attributes (delq 'cns-radical attributes))
536 (when (and (memq 'cns-strokes attributes)
537 (setq value (get-char-attribute char 'cns-strokes)))
538 (unless (eq value strokes)
539 (insert (format "(cns-strokes\t . %S)%s"
543 (setq strokes value)))
544 (setq attributes (delq 'cns-strokes attributes))
546 (when (and (memq 'shinjigen-1-radical attributes)
547 (setq value (get-char-attribute char 'shinjigen-1-radical)))
548 (unless (eq value radical)
549 (insert (format "(shinjigen-1-radical . %S)\t; %c%s"
551 (aref ideographic-radicals value)
554 (setq radical value)))
555 (setq attributes (delq 'shinjigen-1-radical attributes))
557 (when (and (memq 'total-strokes attributes)
558 (setq value (get-char-attribute char 'total-strokes)))
559 (insert (format "(total-strokes . %S)%s"
562 (setq attributes (delq 'total-strokes attributes))
564 (when (and (memq '->ideograph attributes)
565 (setq value (get-char-attribute char '->ideograph)))
566 (insert (format "(->ideograph\t%s)%s"
567 (mapconcat (lambda (code)
568 (cond ((symbolp code)
571 (format "#x%04X" code))
574 line-breaking code))))
577 (setq attributes (delq '->ideograph attributes))
579 (when (and (memq '->decomposition attributes)
580 (setq value (get-char-attribute char '->decomposition)))
581 (insert (format "(->decomposition\t%s)%s"
582 (mapconcat (lambda (code)
583 (cond ((symbolp code)
592 (format "#x%04X" code))
594 (format "%s%S" line-breaking code))))
597 (setq attributes (delq '->decomposition attributes))
599 (if (equal (get-char-attribute char '->titlecase)
600 (get-char-attribute char '->uppercase))
601 (setq attributes (delq '->titlecase attributes)))
602 (when (and (memq '->mojikyo attributes)
603 (setq value (get-char-attribute char '->mojikyo)))
604 (insert (format "(->mojikyo\t\t. %06d)\t; %c%s"
605 value (decode-char 'mojikyo value)
607 (setq attributes (delq '->mojikyo attributes))
609 (when (and (memq 'hanyu-dazidian-vol attributes)
610 (setq value (get-char-attribute char 'hanyu-dazidian-vol)))
611 (insert (format "(hanyu-dazidian-vol . %d)%s"
612 value line-breaking))
613 (setq attributes (delq 'hanyu-dazidian-vol attributes))
615 (when (and (memq 'hanyu-dazidian-page attributes)
616 (setq value (get-char-attribute char 'hanyu-dazidian-page)))
617 (insert (format "(hanyu-dazidian-page . %d)%s"
618 value line-breaking))
619 (setq attributes (delq 'hanyu-dazidian-page attributes))
621 (when (and (memq 'hanyu-dazidian-char attributes)
622 (setq value (get-char-attribute char 'hanyu-dazidian-char)))
623 (insert (format "(hanyu-dazidian-char . %d)%s"
624 value line-breaking))
625 (setq attributes (delq 'hanyu-dazidian-char attributes))
627 (setq rest ccs-attributes)
630 (setq value (get-char-attribute char (car rest)))
632 (if (>= (length (symbol-name (car rest))) 19)
634 (setq has-long-ccs-name t)
638 (setq rest (cdr rest)))
640 (setq name (car attributes))
641 (if (setq value (get-char-attribute char name))
642 (cond ((eq name 'jisx0208-1978/4X)
643 (insert (format "(%-18s . #x%04X)%s"
646 ((memq name '(->lowercase
647 ->uppercase ->titlecase
648 ->fullwidth <-fullwidth
650 ->vulgar-ideograph <-vulgar-ideograph
651 ->ancient-ideograph <-ancient-ideograph
652 ->original-ideograph <-original-ideograph
653 ->simplified-ideograph <-simplified-ideograph
654 ->wrong-ideograph <-wrong-ideograph
656 ->ideographic-variants
659 ->bopomofo <-bopomofo
660 ->ideographic <-ideographic
661 ideographic-structure))
662 (insert (format "(%-18s%s " name line-breaking))
663 (setq lbs (concat "\n" (make-string (current-column) ?\ ))
666 (setq cell (car value))
668 (setq cell (decode-char 'ucs cell)))
669 (cond ((characterp cell)
672 (char-db-insert-char-spec cell readable)
673 (setq separator lbs))
677 (if (consp (car cell))
678 (char-db-insert-char-spec cell readable)
679 (char-db-insert-char-reference cell readable))
680 (setq separator lbs))
684 (insert (prin1-to-string cell))
685 (setq separator " ")))
686 (setq value (cdr value)))
688 (insert line-breaking))
689 ((memq name '(ideograph=
690 original-ideograph-of
694 simplified-ideograph-of
696 ideographic-different-form-of))
697 (insert (format "(%-18s%s " name line-breaking))
698 (setq lbs (concat "\n" (make-string (current-column) ?\ ))
701 (setq cell (car value))
702 (if (and (consp cell)
707 (char-db-insert-alist cell readable)
708 (setq separator lbs))
711 (insert (prin1-to-string cell))
712 (setq separator " "))
713 (setq value (cdr value)))
715 (insert line-breaking))
716 ((string-match "^->" (symbol-name name))
718 (format "(%-18s %s)%s"
720 (mapconcat (lambda (code)
721 (cond ((symbolp code)
724 (format "#x%04X" code))
727 line-breaking code))))
731 (insert (format "(%-18s " name))
732 (setq lbs (concat "\n" (make-string (current-column) ?\ ))
735 (setq cell (car value))
736 (if (and (consp cell)
738 (setq ret (condition-case nil
746 (setq key (car (car rest)))
747 (if (find-charset key)
748 (setq cal (cons key cal))
749 (setq al (cons key al)))
750 (setq rest (cdr rest)))
753 (insert-char-attributes ret
756 (setq separator lbs))
759 (insert (prin1-to-string cell))
760 (setq separator " "))
761 (setq value (cdr value)))
763 (insert line-breaking))
765 (insert (format "(%-18s . %S)%s"
769 (setq attributes (cdr attributes)))
770 (while ccs-attributes
771 (setq name (car ccs-attributes))
772 (if (and (eq name (charset-name name))
773 (setq value (get-char-attribute char name)))
776 (cond ((memq name '(ideograph-daikanwa ideograph-gt
778 (if has-long-ccs-name
779 "(%-26s . %05d)\t; %c%s"
780 "(%-18s . %05d)\t; %c%s"))
782 (if has-long-ccs-name
783 "(%-26s . %06d)\t; %c%s"
784 "(%-18s . %06d)\t; %c%s"))
786 (if has-long-ccs-name
787 "(%-26s . #x%04X)\t; %c%s"
788 "(%-18s . #x%04X)\t; %c%s"))
790 (if has-long-ccs-name
791 "(%-26s . #x%02X)\t; %c%s"
792 "(%-18s . #x%02X)\t; %c%s")))
794 (if (= (charset-iso-graphic-plane name) 1)
796 (cond ((= (charset-dimension name) 1)
798 ((= (charset-dimension name) 2)
800 ((= (charset-dimension name) 3)
804 (char-db-decode-isolated-char name value)
806 (setq ccs-attributes (cdr ccs-attributes)))
809 (defun insert-char-data (char &optional readable
810 attributes ccs-attributes)
812 (narrow-to-region (point)(point))
813 (insert "(define-char
815 (insert-char-attributes char readable
816 attributes ccs-attributes)
818 (goto-char (point-min))
819 (while (re-search-forward "[ \t]+$" nil t)
821 (goto-char (point-max))
822 (tabify (point-min)(point-max))
826 (defun char-db-update-comment ()
829 (goto-char (point-min))
830 (let (cdef table char)
831 (while (re-search-forward "^[ \t]*\\(([^.()]+)\\)" nil t)
832 (goto-char (match-beginning 1))
833 (setq cdef (read (current-buffer)))
834 (when (find-charset (car cdef))
835 (goto-char (match-end 0))
838 (not (eq (car cdef) 'ideograph-daikanwa))
839 (or (memq (car cdef) '(ascii latin-viscii-upper
843 japanese-jisx0213-2))
844 (= (char-int (charset-iso-final-char (car cdef)))
846 (apply (function make-char) cdef)
847 (if (setq table (charset-mapping-table (car cdef)))
848 (set-charset-mapping-table (car cdef) nil))
850 (apply (function make-char) cdef)
852 (set-charset-mapping-table (car cdef) table)))))
853 (when (not (or (< (char-int char) 32)
854 (and (<= 128 (char-int char))
855 (< (char-int char) 160))))
856 (delete-region (point) (point-at-eol))
857 (insert (format "\t; %c" char)))
860 (defun insert-char-data-with-variant (char &optional printable
862 script excluded-script)
863 (insert-char-data char printable)
864 (let ((variants (or (char-variants char)
865 (let ((ucs (get-char-attribute char '->ucs)))
867 (delete char (char-variants (int-char ucs)))))))
869 (setq variants (sort variants #'<))
871 (setq variant (car variants))
872 (if (and (or (null script)
873 (null (setq vs (get-char-attribute variant 'script)))
875 (or (null excluded-script)
876 (null (setq vs (get-char-attribute variant 'script)))
877 (not (memq excluded-script vs))))
878 (or (and no-ucs-variant (get-char-attribute variant 'ucs))
879 (insert-char-data variant printable)))
880 (setq variants (cdr variants))
883 (defun insert-char-range-data (min max &optional script excluded-script)
887 (setq char (decode-char 'ucs code))
888 (if (get-char-attribute char 'ucs)
889 (insert-char-data-with-variant char nil 'no-ucs-variant
890 script excluded-script))
891 (setq code (1+ code))
894 (defun write-char-range-data-to-file (min max file
895 &optional script excluded-script)
896 (let ((coding-system-for-write 'utf-8))
898 (insert-char-range-data min max script excluded-script)
899 (write-region (point-min)(point-max) file))))
901 (defvar what-character-original-window-configuration)
904 (defun what-char-definition (char)
905 (interactive (list (char-after)))
906 (let ((buf (get-buffer-create "*Character Description*"))
907 (the-buf (current-buffer))
908 (win-conf (current-window-configuration)))
910 (make-local-variable 'what-character-original-window-configuration)
911 (setq what-character-original-window-configuration win-conf)
912 (setq buffer-read-only nil)
916 (insert-char-data-with-variant char 'printable)
917 ;; (char-db-update-comment)
918 (set-buffer-modified-p nil)
919 (view-mode the-buf (lambda (buf)
920 (set-window-configuration
921 what-character-original-window-configuration)
923 (goto-char (point-min)))
925 (set-window-configuration
926 what-character-original-window-configuration)
927 (signal (car err) (cdr err)))))))
929 (provide 'char-db-util)
931 ;;; char-db-util.el ends here