From: morioka Date: Mon, 27 Apr 1998 12:55:07 +0000 (+0000) Subject: (ctree-find-calist): Add optional argument 'all. X-Git-Tag: apel-8_6~6 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=4d020c75bbc197542764be4c42181b6eb0534a12;p=elisp%2Fapel.git (ctree-find-calist): Add optional argument 'all. --- diff --git a/calist.el b/calist.el index 38f4889..ee643b6 100644 --- a/calist.el +++ b/calist.el @@ -84,7 +84,7 @@ ret-alist)))) )))) -(defun ctree-find-calist (rule-tree alist) +(defun ctree-find-calist (rule-tree alist &optional all) "Return list of condition-alist which matches ALIST in RULE-TREE." (if (null rule-tree) (list alist) @@ -100,20 +100,25 @@ (if ret-alist (if (cdr choice) (setq dest - (append - (ctree-find-calist (cdr choice) ret-alist) - dest)) + (append (ctree-find-calist + (cdr choice) ret-alist all) + dest)) (setq dest (cons ret-alist dest)) ))))) (setq choices (cdr choices))) - (or dest + (or (and (not all) dest) (if default (let ((ret-alist (calist-field-match alist type t))) (if ret-alist (if (cdr default) - (ctree-find-calist (cdr default) ret-alist) - (list ret-alist) - )))))))) + (setq dest + (append (ctree-find-calist + (cdr default) ret-alist all) + dest)) + (setq dest (cons ret-alist dest)) + )))) + ) + dest))) (defun calist-to-ctree (calist) "Convert condition-alist CALIST to condition-tree."