summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Goaziou <mail@nicolasgoaziou.fr>2015-11-29 14:23:50 +0100
committerNicolas Goaziou <mail@nicolasgoaziou.fr>2015-11-29 22:38:56 +0100
commit4dd06b2cdfc411e5390f2f6f9d799244a34a34e0 (patch)
tree0f9f614d73b7472417ea2a81349fb8ecfd678b0f
parent813d04f8d4087ef6bf479000535cee3af6b3f61c (diff)
downloadorg-mode-4dd06b2cdfc411e5390f2f6f9d799244a34a34e0.tar.gz
ox-publish.el: Fix :preparation-function and :completion-function
* lisp/ox-publish.el (org-publish-projects): Do not use `run-hooks' in a lexical binding environment. Reported-by: Julien Cubizolles <j.cubizolles@free.fr> <http://permalink.gmane.org/gmane.emacs.orgmode/103124>
-rw-r--r--lisp/ox-publish.el12
1 files changed, 6 insertions, 6 deletions
diff --git a/lisp/ox-publish.el b/lisp/ox-publish.el
index 90f307c..b49b9d3 100644
--- a/lisp/ox-publish.el
+++ b/lisp/ox-publish.el
@@ -667,9 +667,9 @@ If `:auto-sitemap' is set, publish the sitemap too. If
`:makeindex' is set, also produce a file \"theindex.org\"."
(dolist (project (org-publish-expand-projects projects))
(let ((project-plist (cdr project)))
- (let ((preparation-function
- (plist-get project-plist :preparation-function)))
- (when preparation-function (run-hooks 'preparation-function)))
+ (let ((f (plist-get project-plist :preparation-function)))
+ (cond ((consp f) (mapc #'funcall f))
+ ((functionp f) (funcall f))))
;; Each project uses its own cache file.
(org-publish-initialize-cache (car project))
(when (plist-get project-plist :auto-sitemap)
@@ -701,9 +701,9 @@ If `:auto-sitemap' is set, publish the sitemap too. If
(org-publish-index-generate-theindex
project (plist-get project-plist :base-directory))
(org-publish-file theindex project t)))
- (let ((completion-function
- (plist-get project-plist :completion-function)))
- (when completion-function (run-hooks 'completion-function)))
+ (let ((f (plist-get project-plist :completion-function)))
+ (cond ((consp f) (mapc #'funcall f))
+ ((functionp f) (funcall f))))
(org-publish-write-cache-file))))
(defun org-publish-org-sitemap (project &optional sitemap-filename)