From mboxrd@z Thu Jan 1 00:00:00 1970 From: Joe Riel Subject: Re: obtain ob-template.el for Babel language extension Date: Sun, 13 Sep 2015 10:45:44 -0700 Message-ID: <20150913104544.70261ce3@gauss> References: <20150910222354.743ce9f2@gauss> <20150911073700.356f5760@gauss> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:42272) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZbBLh-0001Ih-CE for emacs-orgmode@gnu.org; Sun, 13 Sep 2015 13:45:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZbBLc-00072S-DM for emacs-orgmode@gnu.org; Sun, 13 Sep 2015 13:45:57 -0400 Received: from cdptpa-outbound-snat.email.rr.com ([107.14.166.227]:18287 helo=cdptpa-oedge-vip.email.rr.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZbBLc-000727-8p for emacs-orgmode@gnu.org; Sun, 13 Sep 2015 13:45:52 -0400 In-Reply-To: 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: Marco Maggesi Cc: emacs-orgmode@gnu.org On Fri, 11 Sep 2015 19:30:20 +0000 Marco Maggesi 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