From mboxrd@z Thu Jan 1 00:00:00 1970 From: Arun Isaac Subject: [BUG] Dynamic scoping of project-plist in preparation-function Date: Tue, 21 Jun 2016 23:46:59 +0530 Message-ID: <87oa6u1k6c.fsf@systemreboot.net> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:39965) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bFQEr-0000hF-6J for emacs-orgmode@gnu.org; Tue, 21 Jun 2016 14:17:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bFQEl-00085Z-6o for emacs-orgmode@gnu.org; Tue, 21 Jun 2016 14:17:29 -0400 Received: from [117.218.232.8] (port=45366 helo=hrrol) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bFQEk-00085R-LV for emacs-orgmode@gnu.org; Tue, 21 Jun 2016 14:17:23 -0400 Received: from [223.227.9.123] (helo=steel) by hrrol with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.87) (envelope-from ) id 1bFQEh-0001a0-DU for emacs-orgmode@gnu.org; Tue, 21 Jun 2016 23:47:20 +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: "Emacs-orgmode@gnu.org" --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain 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. Regards, Arun Isaac. --=-=-= Content-Type: application/emacs-lisp Content-Disposition: attachment; filename=preparation-function-dynamic-scoping.el Content-Transfer-Encoding: quoted-printable ;; activate debugging (setq debug-on-error t debug-on-signal nil debug-on-quit nil) ;; add latest org-mode to load path (add-to-list 'load-path (expand-file-name "~/.emacs.d/org-mode/lisp")) (require 'org) (defun foo () project-plist) (setq org-publish-project-alist '(("org" :base-directory "~/bar" :base-extension "org" :publishing-directory "~/bar" :publishing-function org-html-publish-to-html :preparation-function foo))) (org-publish-project "org") --=-=-=-- --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJXaYSbAAoJEC4l7othgCuzER8H/1TM9+/hKCey5h3dyxhgIu6Y W8be/WY1nI9BhYjWUfAxgzNpipPkgrR7SaANtKLNFP4RzC9v7IXOCNRZ8aqskV68 yJ30qVHIiwVhyHFQokSAkdWS072oAqj49bo1mIBD1XieTPSGLlkgE90/r/WcxgIf 8pogmbnMsP4JgrD5cGUv9z2nGqX/NOt+3FGO45Mx8+unipzJAJvzSdPI1KuN2U/H +dmKMkdlC9FIVb0vWHeKBq230KIxjtWpn1RvjLrRH8V6fWGmTg3bXZfPANvKDmFZ 1iXYf+An32d8bFSrqnZQ2ecx3J1A8RSA6w52+KmFW4lC8+9I2TgoLDZDZQosxQU= =NkSJ -----END PGP SIGNATURE----- --==-=-=--