(insert-char-data): Add optional argument `readable'.
authortomo <tomo>
Fri, 16 Jun 2000 02:33:53 +0000 (02:33 +0000)
committertomo <tomo>
Fri, 16 Jun 2000 02:33:53 +0000 (02:33 +0000)
(insert-char-data-with-variant): Likewise.
(what-char-definition): Use `insert-char-data-with-variant' with
`readable' mode.

lisp/utf-2000/char-db-util.el

index 1e4604a..5469061 100644 (file)
    ((symbolp kb)
     nil)))
 
-(defun insert-char-data (char)
+(defun insert-char-data (char &optional readable)
   (let ((data (char-attribute-alist char))
        cell ret has-long-ccs-name rest
        radical strokes)
                                       (cond ((symbolp code)
                                              (symbol-name code))
                                             ((characterp code)
-                                             (format "%S" code))
+                                             (if readable
+                                                 (format "%S" code)
+                                               (format "#x%04X"
+                                                       (char-int code))
+                                               ))
                                             ((integerp code)
                                              (format "#x%04X" code))
                                             (t
            (insert (format "\t; %c" char)))
          )))))
 
-(defun insert-char-data-with-variant (char &optional script)
-  (insert-char-data char)
+(defun insert-char-data-with-variant (char &optional script printable)
+  (insert-char-data char printable)
   (let ((variants (or (char-variants char)
                      (let ((ucs (get-char-attribute char '->ucs)))
                        (if ucs
       (if (or (null script)
              (null (setq vs (get-char-attribute variant 'script)))
              (memq script vs))
-         (insert-char-data variant))
+         (insert-char-data variant printable))
       (setq variants (cdr variants))
       )))
 
     (erase-buffer)
     (condition-case err
        (progn
-         (insert-char-data-with-variant char)
+         (insert-char-data-with-variant char nil 'printable)
           ;; (char-db-update-comment)
          (set-buffer-modified-p nil)
          (view-mode the-buf (lambda (buf)