* Rafael Laboissiere [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 > date > #+END_SRC > #+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_(args) and src_{code} are not evaluated at all when they appear in a keyword line (starting with "#+:"). 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. Best, 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 #+END_SRC #+DATE: \input{GitDateCommit}