From 47aea69a79be5db20af226e429d0c07e445d6391 Mon Sep 17 00:00:00 2001 From: Carsten Dominik Date: Wed, 17 Sep 2008 13:32:32 +0200 Subject: [PATCH] Allow project components to have components. --- lisp/ChangeLog | 5 +++++ lisp/org-publish.el | 31 ++++++++++++------------------- 2 files changed, 17 insertions(+), 19 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index e46f9de41..eb9aaf604 100755 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2008-09-17 Carsten Dominik + + * org-publish.el (org-publish-expand-components): Function removed. + (org-publish-expand-projects): Allow components to have components. + 2008-09-13 Carsten Dominik * org.el (org-indent-line-function): Do not indent in regions that diff --git a/lisp/org-publish.el b/lisp/org-publish.el index e68926dca..98b6c6b49 100644 --- a/lisp/org-publish.el +++ b/lisp/org-publish.el @@ -408,25 +408,18 @@ If NO-EXCLUSION is non-nil, don't exclude files." all-files)) (defun org-publish-expand-projects (projects-alist) - "Expand projects contained in PROJECTS-ALIST." - (let (without-component with-component) - (mapc (lambda(p) - (add-to-list - (if (plist-get (cdr p) :components) - 'with-component 'without-component) p)) - projects-alist) - (org-publish-delete-dups - (append without-component - (car (mapcar (lambda(p) (org-publish-expand-components p)) - with-component)))))) - -(defun org-publish-expand-components (project) - "Expand PROJECT into an alist of its components." - (let* ((components (plist-get (cdr project) :components))) - (org-publish-delete-dups - (delq nil (mapcar (lambda(c) (assoc c org-publish-project-alist)) - components))))) - + "Expand projects in PROJECTS-ALIST. +This splices all the components into the list." + (let ((rest projects-alist) rtn p c) + (while (setq p (pop rest)) + (if (setq components (plist-get (cdr p) :components)) + (setq rest (append + (mapcar (lambda (x) (assoc x org-publish-project-alist)) + components) + rest)) + (push p rtn))) + (nreverse (org-publish-delete-dups (delq nil rtn))))) + (defun org-publish-get-base-files-1 (base-dir &optional recurse match skip-file skip-dir) "Set `org-publish-temp-files' with files from BASE-DIR directory. If RECURSE is non-nil, check BASE-DIR recursively. If MATCH is -- 2.11.4.GIT