From 4d020c75bbc197542764be4c42181b6eb0534a12 Mon Sep 17 00:00:00 2001 From: morioka Date: Mon, 27 Apr 1998 12:55:07 +0000 Subject: [PATCH] (ctree-find-calist): Add optional argument 'all. --- calist.el | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) 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." -- 1.7.10.4