Browse Source

Fix publishing of component files.

When starting the publishing process with
`org-publish-current-project' from a file that is located in a project
that is also a component of a parent project, this patch now makes
sure that the entire parent project is published instead.
Carsten Dominik 16 years ago
parent
commit
8e31f6f99c
4 changed files with 22 additions and 2 deletions
  1. 14 0
      doc/ChangeLog
  2. 2 1
      doc/org.texi
  3. 2 0
      lisp/ChangeLog
  4. 4 1
      lisp/org-publish.el

+ 14 - 0
doc/ChangeLog

@@ -1,3 +1,17 @@
+2008-11-25  Carsten Dominik  <carsten.dominik@gmail.com>
+
+	* org.texi (Project alist): Add info about the publishing sequence
+	of components.
+
+
+
+
+
+
+
+
+
+
 2008-11-24  Carsten Dominik  <carsten.dominik@gmail.com>
 
 	* org.texi: Re-apply the change to FDL 1.3.

+ 2 - 1
doc/org.texi

@@ -8049,7 +8049,8 @@ a project takes the second form listed above, the individual members
 of the ``components'' property are taken to be components of the
 project, which group together files requiring different publishing
 options. When you publish such a ``meta-project'' all the components
-will also publish.
+will also publish.  The @code{:components} are published in the sequence
+provided.
 
 @node Sources and destinations, Selecting files, Project alist, Configuration
 @subsection Sources and destinations for files

+ 2 - 0
lisp/ChangeLog

@@ -2,6 +2,8 @@
 
 	* org-publish.el (org-publish-org-index): Only exclude the index
 	file in the main directory from being added to the site-map.
+	(org-publish-get-project-from-filename): If the current project is
+	a component, start publishing from the parent project.
 
 2008-11-24  Carsten Dominik  <carsten.dominik@gmail.com>
 

+ 4 - 1
lisp/org-publish.el

@@ -470,7 +470,10 @@ matching filenames."
 (defun org-publish-get-project-from-filename (filename)
   "Return the project FILENAME belongs."
   (let* ((project-name (cdr (assoc (expand-file-name filename)
-				   org-publish-files-alist))))
+                                   org-publish-files-alist))))
+    (dolist (prj org-publish-project-alist)
+      (if (member project-name (plist-get (cdr prj) :components))
+          (setq project-name (car prj))))
     (assoc project-name org-publish-project-alist)))
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;