(char-db-dump-additional-idc): New function.
authorMORIOKA Tomohiko <tomo.git@chise.org>
Wed, 17 Apr 2019 06:58:14 +0000 (15:58 +0900)
committerMORIOKA Tomohiko <tomo.git@chise.org>
Fri, 8 Nov 2019 07:40:22 +0000 (16:40 +0900)
char-db-dump.el

index 2f717af..98a51bc 100644 (file)
                    (expand-file-name
                     "additional-precomposed.el" directory)))))
 
+;;;###autoload
+(defun char-db-dump-additional-idc (directory)
+  (interactive "DDump additional-precomposed : ")
+  (let ((coding-system-for-write char-db-file-coding-system)
+       chars i chr ret)
+    (with-temp-buffer
+      (insert (format ";; -*- coding: %s -*-\n"
+                     char-db-file-coding-system))
+      (setq i #x2FF0)
+      (while (<= i #x2ffB)
+       (setq chr (decode-char '=ucs i))
+       (dolist (f '(<-denotational <-denotational@component
+                                   <-denotational@arg-reversed))
+         (setq ret (get-char-attribute chr f))
+         (if (characterp ret)
+             (unless (memq ret chars)
+               (insert-char-data ret)
+               (setq chars (cons ret chars)))
+           (dolist (c (get-char-attribute chr f))
+             (unless (memq c chars)
+               (insert-char-data c)
+               (setq chars (cons c chars))))))
+       (dolist (ccs '(=ucs-var-001 =ucs-var-002 =ucs-var-003 =ucs-itaiji-001))
+         (when (setq chr (decode-char ccs i 'defined-only 'without-inheritance))
+           (unless (memq chr chars)
+             (insert-char-data chr)
+             (setq chars (cons chr chars)))))
+       (setq i (1+ i)))
+      (write-region (point-min)(point-max)
+                   (expand-file-name
+                    "additional-idc.el" directory)))))
+
 
 ;;;###autoload
 (defun char-db-dump (directory)