+(defun ids-insert-chars-including-components* (components
+ &optional level ignored-chars)
+ (unless level
+ (setq level 0))
+ (let (is i as bs)
+ (dolist (c (sort (copy-tree (ideograph-find-products components
+ ignored-chars))
+ (lambda (a b)
+ (if (setq as (char-total-strokes a))
+ (if (setq bs (char-total-strokes b))
+ (if (= as bs)
+ (ideograph-char< a b)
+ (< as bs))
+ t)
+ (ideograph-char< a b)))))
+ (unless (memq c ignored-chars)
+ (setq is (char-feature c 'ideographic-structure))
+ (setq i 0)
+ (while (< i level)
+ (insert "\t")
+ (setq i (1+ i)))
+ (insert (ids-find-format-line c is))
+ (setq ignored-chars
+ (ids-insert-chars-including-components*
+ (char-to-string c) (1+ level)
+ (cons c ignored-chars))))
+ )
+ )
+ ignored-chars)
+
+(defun ids-insert-chars-including-components (components
+ &optional level ignored-chars)
+ (unless level
+ (setq level 0))
+ (setq ignored-chars
+ (nreverse
+ (ids-insert-chars-including-components* components
+ level ignored-chars)))
+ (let (is i as bs)
+ (dolist (c ignored-chars)
+ (dolist (vc (char-component-variants c))
+ (unless (memq vc ignored-chars)
+ (when (setq is (get-char-attribute vc 'ideographic-structure))
+ (setq i 0)
+ (while (< i level)
+ (insert "\t")
+ (setq i (1+ i)))
+ (insert (ids-find-format-line vc is))
+ (setq ignored-chars
+ (ids-insert-chars-including-components*
+ (char-to-string vc) (1+ level)
+ (cons vc ignored-chars)))))))
+ (dolist (c (sort (copy-tree (ideograph-find-products-with-variants
+ components ignored-chars))
+ (lambda (a b)
+ (if (setq as (char-total-strokes a))
+ (if (setq bs (char-total-strokes b))
+ (if (= as bs)
+ (ideograph-char< a b)
+ (< as bs))
+ t)
+ (ideograph-char< a b)))))
+ (unless (memq c ignored-chars)
+ (setq is (get-char-attribute c 'ideographic-structure))
+ (setq i 0)
+ (while (< i level)
+ (insert "\t")
+ (setq i (1+ i)))
+ (insert (ids-find-format-line c is))
+ (setq ignored-chars
+ (ids-insert-chars-including-components*
+ (char-to-string c) (1+ level)
+ (cons c ignored-chars))))
+ )
+ )
+ ignored-chars)
+