[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] [PATCH] call_*() is not working inside #+DATE

From: Rafael Laboissiere
Subject: Re: [O] [PATCH] call_*() is not working inside #+DATE
Date: Sat, 12 Mar 2016 08:57:04 +0100
User-agent: Mutt/1.5.24 (2015-08-30)

* Rafael Laboissiere <address@hidden> [2016-03-07 02:58]:

The following used to work for me in the past:

  #+NAME: date
  #+BEGIN_SRC sh :results silent :exports results :tangle no
  #+TITLE: Sample
  #+AUTHOR: Me
  #+DATE: call_date()

and I saw the output of the shell command "date" when exporting the file to LaTeX. However does not work for the current HEAD of the Git repository.

Using git-bisect, I discovered that the culprit is commit 85ff663, i.e. my code above works for commit 85ff663^ but fails for commit 85ff663.

Commit 85ff663 was a pretty large commit and, besides that, the new code introduced by it was posteriorly changed, so it is hard to find where the bug comes from. Could someone more acquainted with the code try to look at this bug, please?

I investigated this issue further and discovered that the constructs call_<name>(args) and src_<lang>{code} are not evaluated at all when they appear in a keyword line (starting with "#+<keyword>:"). Org-babel behaves in this way probably on purpose. At any rate, it would be better if the current behavior is documented somewhere. This may be accomplished with the patch attached below.


Rafael Laboissière

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. When exporting to LaTeX, I wanted to have, as the contents of the \date{} macro, the date and the hash of the last Git commit of the current checkout HEAD, to which my Org document belongs. Here is how I am doing it now:

   #+TITLE: Sample
   #+AUTHOR: Me
   #+BEGIN_SRC sh :results silent :exports results :tangle no
   git show -s --date=short --format="%cd [%h]" HEAD > GitDateCommit.tex
   #+DATE: \input{GitDateCommit}

Attachment: 0001-Document-lack-of-evaluation-of-inline-code-blocks-in.patch
Description: Text Data

reply via email to

[Prev in Thread] Current Thread [Next in Thread]