From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rafael Laboissiere Subject: Re: [PATCH] call_*() is not working inside #+DATE Date: Sun, 13 Mar 2016 18:41:53 +0100 Message-ID: <20160313174153.GM3916@laboissiere.net> References: <20160307015829.GE11627@laboissiere.net> <20160312075704.GI16308@laboissiere.net> <877fh8oz9g.fsf@ucl.ac.uk> <20160312093451.GL16308@laboissiere.net> <87y49mmgth.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:42101) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1afA1f-0000v8-Ek for emacs-orgmode@gnu.org; Sun, 13 Mar 2016 13:42:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1afA1a-0001J5-TJ for emacs-orgmode@gnu.org; Sun, 13 Mar 2016 13:41:59 -0400 Received: from laboissiere.net ([46.101.243.132]:45954) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1afA1a-0001Iu-Lu for emacs-orgmode@gnu.org; Sun, 13 Mar 2016 13:41:54 -0400 Content-Disposition: inline In-Reply-To: <87y49mmgth.fsf@nicolasgoaziou.fr> 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: emacs-orgmode@gnu.org * Nicolas Goaziou [2016-03-13 18:24]: > Rafael Laboissiere writes: > >> It would be much better if the following construct worked: >> >> #+DATE: src_sh{git show -s --date=short --format="%cd [%h]" HEAD} >> >> Unfortunately, it does not. This behavior (or misbehavior, I do not >> know) can be traced down to the org-element-context function. >> >> [snip] > > Values from keyword are not parsed. Org used to make an exception for an > arbitrary bunch of them (e.g., DATE, TITLE, etc.). Now it is up to the > export back-ends to decide what keyword is going to be parsed. > > I can think of two ways to solve this: > > 1. Only evaluate the Babel code during export. Upon exporting the > document, parsed keywords are known, so > `org-babel-exp-process-buffer' may try to find "hidden" Babel code > and execute it. > > This would however introduce a discrepancy between > org-babel-execute-buffer and the behaviour upon exporting. > > 2. Sort parsed keywords from regular ones at the syntax level, much > like we did for export blocks recently. I.e., every keyword is > parsed expect those marked as verbatim. I don't have an idea bout > the involved syntax. > > This would probably induce some backward incompatibility. > > WDYT? Thanks for your proposal. I would vote for solution #1. The discrepancy between org-babel-execute-buffer and the behaviour upon exporting that you mention would not bother me. Whatever solution is adopted (or if the current behavior is kept), the info documentation must be updated. Do you agree with the patch that I proposed earlier in this thread? Best, Rafael