From: morioka Date: Wed, 6 May 1998 05:49:03 +0000 (+0000) Subject: (ctree-find-calist): fixed duplicated result. X-Git-Tag: apel-8_9~2 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=487a5900169502e24dd0199c085ea91e000c13a8;p=elisp%2Fapel.git (ctree-find-calist): fixed duplicated result. --- diff --git a/calist.el b/calist.el index 3da7ea6..0d47213 100644 --- a/calist.el +++ b/calist.el @@ -132,10 +132,15 @@ even if other rules are matched for ALIST." (let ((ret-alist (calist-field-match alist type (car choice)))) (if ret-alist (if (cdr choice) - (setq dest - (append (ctree-find-calist - (cdr choice) ret-alist all) - dest)) + (let ((ret (ctree-find-calist + (cdr choice) ret-alist all))) + (while ret + (let ((elt (car ret))) + (or (member elt dest) + (setq dest (cons elt dest)) + )) + (setq ret (cdr ret)) + )) (or (member ret-alist dest) (setq dest (cons ret-alist dest))) ))))) @@ -145,10 +150,15 @@ even if other rules are matched for ALIST." (let ((ret-alist (calist-field-match alist type t))) (if ret-alist (if (cdr default) - (setq dest - (append (ctree-find-calist - (cdr default) ret-alist all) - dest)) + (let ((ret (ctree-find-calist + (cdr default) ret-alist all))) + (while ret + (let ((elt (car ret))) + (or (member elt dest) + (setq dest (cons elt dest)) + )) + (setq ret (cdr ret)) + )) (or (member ret-alist dest) (setq dest (cons ret-alist dest))) ))))