From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rafael Laboissiere Subject: Re: [PATCH] call_*() is not working inside #+DATE Date: Sat, 12 Mar 2016 10:34:51 +0100 Message-ID: <20160312093451.GL16308@laboissiere.net> References: <20160307015829.GE11627@laboissiere.net> <20160312075704.GI16308@laboissiere.net> <877fh8oz9g.fsf@ucl.ac.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1; format=flowed Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:42407) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aefwm-0006oS-Nb for emacs-orgmode@gnu.org; Sat, 12 Mar 2016 04:34:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aefwi-000173-I9 for emacs-orgmode@gnu.org; Sat, 12 Mar 2016 04:34:56 -0500 Received: from laboissiere.net ([46.101.243.132]:43802) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aefwi-00016y-AB for emacs-orgmode@gnu.org; Sat, 12 Mar 2016 04:34:52 -0500 Content-Disposition: inline In-Reply-To: <877fh8oz9g.fsf@ucl.ac.uk> 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 * Eric S Fraga [2016-03-12 08:51]: > On Saturday, 12 Mar 2016 at 08:57, Rafael Laboissiere wrote: >> P.S.: For those who are reading this message and are interested in a >> solution for my original problem, here is the way I am getting around it >> right now. > > Thanks for this alternate solution. You are welcome. 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. Suppose that you have the following content in a org-mode buffer: #+DATE: src_sh{date} src_sh{date} With the cursor just after the underscore in the #+DATE line, org-element-context returns: (keyword (:key "DATE" :value "src_sh{date}" :begin 1 :end 22 :post-blank 0 :post-affiliated 1 :parent nil)) On the other hand, with the cursor just after the underscore in the next line, org-element-context returns (as it should be): (inline-src-block (:language "sh" :value "date" :parameters nil :begin 22 :end 34 :post-blank 0  :parent (paragraph (:begin 22 :end 35 :contents-begin 22 :contents-end 35 :post-blank 0  :post-affiliated 22 :parent nil)))) This is the reason why Org-babel does not evaluate the inline source block in the #+DATE line. Best, Rafael Laboissière