Browse Source

Revert "ox-publish: Raise an error when encountering undefined component"

This reverts commit 6e1d174d0a5564f3c18570025a439cbd201290cb.
Nicolas Goaziou 3 years ago
parent
commit
147b4646d2
1 changed files with 10 additions and 11 deletions
  1. 10 11
      lisp/ox-publish.el

+ 10 - 11
lisp/ox-publish.el

@@ -413,17 +413,16 @@ project base directory."
 
 (defun org-publish-expand-projects (projects-alist)
   "Expand projects in PROJECTS-ALIST.
-This splices all the components into a list."
-  (delete-dups
-   (cl-mapcan (lambda (project)
-		(pcase-let ((`(,name . ,properties) project))
-		  (cl-mapcan (lambda (component)
-			       (or
-				(assoc component org-publish-project-alist)
-				(user-error "Unknown component %S in project %S"
-					    component name)))
-			     (plist-get properties :components))))
-	      projects-alist)))
+This splices all the components into the list."
+  (let ((rest projects-alist) rtn p components)
+    (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 (delete-dups (delq nil rtn)))))
 
 (defun org-publish-get-base-files (project)
   "Return a list of all files in PROJECT."