From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: :completion function isn't run anymore? Date: Sun, 29 Nov 2015 21:53:09 +0100 Message-ID: <8737vomssq.fsf@nicolasgoaziou.fr> References: <87ziy0xt58.fsf@free.fr> <87y4djbg8c.fsf@free.fr> <87mvtxlz6y.fsf@nicolasgoaziou.fr> <87zixwh780.fsf@free.fr> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:59874) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a38wN-0000ND-77 for emacs-orgmode@gnu.org; Sun, 29 Nov 2015 15:51:24 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a38wJ-0006VS-W1 for emacs-orgmode@gnu.org; Sun, 29 Nov 2015 15:51:23 -0500 Received: from relay4-d.mail.gandi.net ([217.70.183.196]:47903) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a38wJ-0006VH-Qz for emacs-orgmode@gnu.org; Sun, 29 Nov 2015 15:51:19 -0500 In-Reply-To: <87zixwh780.fsf@free.fr> (Julien Cubizolles's message of "Sun, 29 Nov 2015 21:38:07 +0100") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Julien Cubizolles Cc: emacs-orgmode@gnu.org --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Julien Cubizolles writes: > Thanks for looking into it. It seems the completion-function is now > being accessed but unfortunately something is still wrong. The error > message is > > org-publish-projects: Wrong type argument: sequencep, > jc-org-publish-rename-beamer-pdf I forgot that :preparation-function could also be a single function. Attached is the updated patch to test. > If I'm to bisect, is it possible to reload all org-mode files without > restarting emacs=C2=A0? Would M-x org-mode be enough=C2=A0? See `org-reload'. Regards, --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-ox-publish.el-Fix-preparation-function-and-completio.patch >From 1180a87c002c8efc0687a051bec536ee6c34eec0 Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Sun, 29 Nov 2015 14:23:50 +0100 Subject: [PATCH] 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 --- lisp/ox-publish.el | 12 ++++++------ 1 file 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) -- 2.6.2 --=-=-=--