emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] obtain ob-template.el for Babel language extension


From: Joe Riel
Subject: Re: [O] obtain ob-template.el for Babel language extension
Date: Sun, 13 Sep 2015 10:45:44 -0700

On Fri, 11 Sep 2015 19:30:20 +0000
Marco Maggesi <address@hidden> wrote:

> I also have a few questions about ob-template.el
> 
> 1. Can we assume that the HEAD version of ob-template.el is adequate as a
> basis for an implementation which is compatible with org version 8.2.xx
> (i.e., with older versions of org-mode)?
> 
> 2. In function org-babel-execute:template functions first, second, third,
> etc are used to extract values from processed-params. However, such
> function are not defined in elisp, (nth N processed-params) should be used
> instead.  Is it correct?
> Also, it seems from other examples that the usual approach is to use assoc,
> e.g.,  (cdr (assoc ":session" params)). Are there enforced conventions that
> ensure the order in processed-params?

first, second, etc are macros in cl.el; nothing wrong with that.
However, there is a problem with the usage in the given template.
They are applied to processed-params, and that is not correct because
any variables in the block header are prepended to the list so first,
second, etc are wrong.  The template code should be rewritten.  The
better way to handle this appears to be

  (let ((vars (mapcar #'cdr (org-babel-get-header params :var))))
     ... )


> 3. In function org-babel-expand-body:template we assume that vars is a list
> of pairs.  However, it seems to me from some experiments that sometimes
> vars contains symbols. Am I wrong?

I don't know, but believe it should always contain pairs as vars are required
to have values.  Caveat: I just started playing with this so could be very 
wrong.

--
Joe Riel





reply via email to

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