ox-publish: Fix void-variable project-plist

* lisp/ox-publish.el (org-publish-projects): Fix bug introduced in
  346d227.
This commit is contained in:
Nicolas Goaziou 2015-10-14 12:39:07 +02:00
parent fa61cb4079
commit 606b5fdd87

View file

@ -671,42 +671,43 @@ See `org-publish-projects'."
(defun org-publish-projects (projects) (defun org-publish-projects (projects)
"Publish all files belonging to the PROJECTS alist. "Publish all files belonging to the PROJECTS alist.
If `:auto-sitemap' is set, publish the sitemap too. If If `:auto-sitemap' is set, publish the sitemap too. If
`:makeindex' is set, also produce a file theindex.org." `:makeindex' is set, also produce a file \"theindex.org\"."
(dolist (project (org-publish-expand-projects projects)) (dolist (project (org-publish-expand-projects projects))
(let ((preparation-function (let ((project-plist (cdr project)))
(plist-get project-plist :preparation-function))) (let ((preparation-function
(when preparation-function (run-hooks 'preparation-function))) (plist-get project-plist :preparation-function)))
;; Each project uses its own cache file. (when preparation-function (run-hooks 'preparation-function)))
(org-publish-initialize-cache (car project)) ;; Each project uses its own cache file.
(let* ((project-plist (cdr project)) (org-publish-initialize-cache (car project))
(exclude-regexp (plist-get project-plist :exclude)) (when (plist-get project-plist :auto-sitemap)
(sitemap-p (plist-get project-plist :auto-sitemap)) (let ((sitemap-filename
(sitemap-filename (or (plist-get project-plist :sitemap-filename) (or (plist-get project-plist :sitemap-filename)
"sitemap.org")) "sitemap.org"))
(sitemap-function (or (plist-get project-plist :sitemap-function) (sitemap-function
'org-publish-org-sitemap)) (or (plist-get project-plist :sitemap-function)
(org-publish-sitemap-date-format #'org-publish-org-sitemap))
(or (plist-get project-plist :sitemap-date-format) (org-publish-sitemap-date-format
org-publish-sitemap-date-format)) (or (plist-get project-plist :sitemap-date-format)
(org-publish-sitemap-file-entry-format org-publish-sitemap-date-format))
(or (plist-get project-plist :sitemap-file-entry-format) (org-publish-sitemap-file-entry-format
org-publish-sitemap-file-entry-format)) (or (plist-get project-plist :sitemap-file-entry-format)
(files (org-publish-get-base-files project exclude-regexp)) org-publish-sitemap-file-entry-format)))
(theindex (funcall sitemap-function project sitemap-filename)))
(expand-file-name "theindex.org"
(plist-get project-plist :base-directory))))
(when sitemap-p (funcall sitemap-function project sitemap-filename))
;; Publish all files from PROJECT excepted "theindex.org". Its ;; Publish all files from PROJECT excepted "theindex.org". Its
;; publishing will be deferred until "theindex.inc" is ;; publishing will be deferred until "theindex.inc" is
;; populated. ;; populated.
(dolist (file files) (let ((theindex
(unless (equal file theindex) (org-publish-file file project t))) (expand-file-name "theindex.org"
;; Populate "theindex.inc", if needed, and publish (plist-get project-plist :base-directory)))
;; "theindex.org". (exclude-regexp (plist-get project-plist :exclude)))
(when (plist-get project-plist :makeindex) (dolist (file (org-publish-get-base-files project exclude-regexp))
(org-publish-index-generate-theindex (unless (equal file theindex) (org-publish-file file project t)))
project (plist-get project-plist :base-directory)) ;; Populate "theindex.inc", if needed, and publish
(org-publish-file theindex project t)) ;; "theindex.org".
(when (plist-get project-plist :makeindex)
(org-publish-index-generate-theindex
project (plist-get project-plist :base-directory))
(org-publish-file theindex project t)))
(let ((completion-function (let ((completion-function
(plist-get project-plist :completion-function))) (plist-get project-plist :completion-function)))
(when completion-function (run-hooks 'completion-function))) (when completion-function (run-hooks 'completion-function)))