From: Joe Riel <joer@san.rr.com>
To: Marco Maggesi <maggesi@math.unifi.it>
Cc: emacs-orgmode@gnu.org
Subject: Re: obtain ob-template.el for Babel language extension
Date: Sun, 13 Sep 2015 10:45:44 -0700 [thread overview]
Message-ID: <20150913104544.70261ce3@gauss> (raw)
In-Reply-To: <CAAdZW_tT8Z9rKT+EF_vYHSAKfw0yi5pSqThPOXBnH8R0C3=Vyw@mail.gmail.com>
On Fri, 11 Sep 2015 19:30:20 +0000
Marco Maggesi <maggesi@math.unifi.it> 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
next prev parent reply other threads:[~2015-09-13 17:45 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-11 5:23 obtain ob-template.el for Babel language extension Joe Riel
2015-09-11 6:38 ` Thomas S. Dye
2015-09-11 14:37 ` Joe Riel
2015-09-11 16:03 ` Thomas S. Dye
2015-09-11 19:30 ` Marco Maggesi
2015-09-13 17:45 ` Joe Riel [this message]
2015-09-15 2:37 ` Thomas S. Dye
2015-09-16 15:43 ` Joe Riel
2015-09-12 4:13 ` Joe Riel
2015-09-12 17:15 ` Thomas S. Dye
2015-09-12 17:39 ` Joe Riel
2015-09-12 18:50 ` [PATCH] small improvements to info page, Working with source code Joe Riel
2015-09-13 17:32 ` [PATCH] small improvements to info page, Working with source code; add TINYCHANG Joe Riel
2015-09-13 18:24 ` Rasmus
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150913104544.70261ce3@gauss \
--to=joer@san.rr.com \
--cc=emacs-orgmode@gnu.org \
--cc=maggesi@math.unifi.it \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.