- (if (or char
- (setq char (condition-case nil
- (define-char char-ref)
- (error nil))))
- (progn
- (setq al nil
- cal nil)
- (while char-ref
- (setq key (car (car char-ref)))
- (if (find-charset key)
- (setq cal (cons key cal))
- (setq al (cons key al)))
- (setq char-ref (cdr char-ref)))
- (insert-char-attributes char
- readable
- (or al 'none) cal))
- (insert (prin1-to-string char-ref)))))
+ (unless (or char
+ (condition-case nil
+ (setq char (find-char char-spec))
+ (error nil)))
+ ;; define temporary character
+ ;; Current implementation is dirty.
+ (setq temp-char (define-char (cons '(ideograph-daikanwa . 0)
+ char-spec)))
+ (remove-char-attribute temp-char 'ideograph-daikanwa)
+ (setq char temp-char))
+ (setq al nil
+ cal nil)
+ (while char-spec
+ (setq key (car (car char-spec)))
+ (if (find-charset key)
+ (setq cal (cons key cal))
+ (setq al (cons key al)))
+ (setq char-spec (cdr char-spec)))
+ (insert-char-attributes char
+ readable
+ (or al 'none) cal)
+ (when temp-char
+ ;; undefine temporary character
+ ;; Current implementation is dirty.
+ (setq char-spec (char-attribute-alist temp-char))
+ (while char-spec
+ (remove-char-attribute temp-char (car (car char-spec)))
+ (setq char-spec (cdr char-spec))))))