From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: [BUG] Dynamic scoping of project-plist in preparation-function Date: Tue, 21 Jun 2016 22:15:47 +0200 Message-ID: <87pora9u30.fsf@saiph.selenimh> References: <87oa6u1k6c.fsf@systemreboot.net> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:39174) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bFS5a-00013g-C7 for emacs-orgmode@gnu.org; Tue, 21 Jun 2016 16:16:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bFS5U-0007rS-FU for emacs-orgmode@gnu.org; Tue, 21 Jun 2016 16:16:01 -0400 Received: from relay4-d.mail.gandi.net ([217.70.183.196]:58505) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bFS5U-0007q8-7h for emacs-orgmode@gnu.org; Tue, 21 Jun 2016 16:15:56 -0400 In-Reply-To: <87oa6u1k6c.fsf@systemreboot.net> (Arun Isaac's message of "Tue, 21 Jun 2016 23:46:59 +0530") 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" To: Arun Isaac Cc: "Emacs-orgmode@gnu.org" Hello, Arun Isaac writes: > The org mode manual says "The project property list is scoped into this > call as the variable project-plist". But, ox-publish.el has lexical > binding enabled, and the variable project-plist doesn't seem to be > accessible from the executed preparation-function. When I try to access > the variable, I get a (void-variable project-plist) error. > > Please find attached a minimal elisp file to reproduce the bug. > > emacs -Q -l preparation-function-dynamic-scoping.el > > My understanding of dynamic and lexical binding is a little foggy. So, > do let me know if I'm missing something. There are two ways to handle this. 1. Create a new global variable, with appropriate prefix, to hold project plist, e.g., `org-publish-project-plist'; 2. Require preparation functions to accept one parameter, the project plist. I'd favor the second one. In any case, the manual should be updated accordingly. WDYT? Regards, -- Nicolas Goaziou