From 487a5900169502e24dd0199c085ea91e000c13a8 Mon Sep 17 00:00:00 2001 From: morioka Date: Wed, 6 May 1998 05:49:03 +0000 Subject: [PATCH] (ctree-find-calist): fixed duplicated result. --- calist.el | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) 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))) )))) -- 1.7.10.4