update.
[chise/ids.git] / install-ids.el
1 ;;; install-ids.el --- installer of IDS files.
2
3 ;;; Code:
4
5 (setq load-ids-simplify nil)
6
7 (defun install-ids-read-file (file simplify soft)
8   (princ "Loading ")
9   (princ file)
10   (princ "...")
11   (ids-read-file file simplify soft)
12   (princ "done.\n"))
13
14
15 ;; (mount-char-attribute-table 'ideographic-products)
16 ;; (map-char-attribute
17 ;;  (lambda (c v)
18 ;;    (remove-char-attribute c 'ideographic-products)
19 ;;    nil)
20 ;;  'ideographic-products)
21
22
23 (install-ids-read-file "IDS-JIS-X0208-1990.txt" load-ids-simplify t)
24
25 (install-ids-read-file "IDS-UCS-Basic.txt" load-ids-simplify t)
26
27 (install-ids-read-file "IDS-UCS-Ext-A.txt" load-ids-simplify t)
28 (let ((i 1))
29   (while (<= i 6)
30     (install-ids-read-file (format "IDS-UCS-Ext-B-%d.txt" i)
31                            load-ids-simplify t)
32     (setq i (1+ i))))
33
34 (let ((i 1))
35   (while (<= i 2)
36     (install-ids-read-file (format "IDS-CNS-%d.txt" i)
37                            load-ids-simplify t)
38     (setq i (1+ i))))
39
40 (let ((i 1))
41   (while (<= i 12)
42     (install-ids-read-file (format "IDS-Daikanwa-%02d.txt" i)
43                            load-ids-simplify t)
44     (setq i (1+ i))))
45
46 (install-ids-read-file "IDS-Daikanwa-dx.txt" load-ids-simplify t)
47
48 (install-ids-read-file "IDS-Daikanwa-ho.txt" load-ids-simplify t)
49
50 (install-ids-read-file "IDS-CBETA.txt" load-ids-simplify t)
51
52 (install-ids-read-file "IDS-CDP.txt" load-ids-simplify t)
53 (let ((i 1))
54   (while (<= i 12)
55     (install-ids-read-file (format "IDS-HZK%02d.txt" i)
56                            load-ids-simplify t)
57     (setq i (1+ i))))
58
59 (princ "Updating char-feature `ideographic-structure'...")
60 (save-char-attribute-table 'ideographic-structure)
61 (princ "done.\n")
62
63 (princ "Updating char-feature `ideographic-products'...")
64 (let* ((feature-dir
65         (expand-file-name
66          "feature"
67          (expand-file-name
68           "character" chise-system-db-directory)))
69        (p-file
70         (expand-file-name "ideographic-products" feature-dir))
71        old-p-file)
72   (when (file-exists-p p-file)
73     (setq old-p-file (make-temp-name p-file))
74     (rename-file p-file old-p-file))
75   (ids-update-index)
76   (when old-p-file
77     (delete-file old-p-file)))
78 (princ "done.\n")
79
80 ;;; install-ids.el ends hear