From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rick Frankel Subject: Re: [BUG] :colnames not applied to #+call input Date: Tue, 09 Jul 2013 11:29:39 -0400 Message-ID: <8070da9ba809ec401d102619dbb8c1a2@mail.rickster.com> References: <3b90682f4749fc6cd9a5db0981f7f20a@mail.rickster.com> <8761wvkv0b.fsf@gmail.com> <7280541f4853fd4d21eeb275148fc4e8@mail.rickster.com> <87d2qzo8w8.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:33087) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UwZtS-0006Jx-8V for emacs-orgmode@gnu.org; Tue, 09 Jul 2013 11:31:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UwZtP-0004PU-MP for emacs-orgmode@gnu.org; Tue, 09 Jul 2013 11:31:54 -0400 Received: from [204.62.15.78] (port=37842 helo=mail.rickster.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UwZrH-0003ML-Ei for emacs-orgmode@gnu.org; Tue, 09 Jul 2013 11:29:39 -0400 In-Reply-To: <87d2qzo8w8.fsf@gmail.com> 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: Eric Schulte Cc: emacs-orgmode On 2013-07-03 13:23, Eric Schulte wrote: > Currently colnames are not used for emacs-lisp code blocks (for > historical reasons). Unfortunately, call lines are executed by > expanding first to a trivial emacs-lisp code block, which is then run > to > collect and possibly re-package the results of the called function. > Thus colnames do not work well in call lines. > > I think the best solution here is to add colnames support to Emacs Lisp > code blocks. I can put this on my Org-mode queue, but can't promise to > get to it any time soon. I'm confused by this response, as the behavior exhibited by org-mode seems to indicate that :colnames IS affecting emacs-lisp code blocks, but inconsistenly affecting "called" code blocks -- only applying to the output but not the input as exhibited in an example in a previous email. As to the above, given: #+name: table1 | 1 | 2 | 3 | |---+---+---| | 4 | 5 | 6 | and the code: #+name: map1 #+BEGIN_SRC emacs-lisp :var table=table1 :colnames yes (mapcar (lambda (row) (mapcar '1+ row)) table) #+END_SRC I get: #+RESULTS: map1 | 1 | 2 | 3 | |---+---+---| | 5 | 6 | 7 | and the `*Message*' buffer contains: #+BEGIN_EXAMPLE executing Emacs-Lisp code block (map1)... (table (quote ((4 5 6)))) Code block evaluation complete. #+END_EXAMPLE But, removing the :colnames argument: #+name: map2 #+BEGIN_SRC emacs-lisp :var table=table1 (mapcar (lambda (row) (mapcar '1+ row)) table) #+END_SRC give the error "Wrong type argument: sequencep, hline", and the message buffer shows: #+BEGIN_EXAMPLE executing Emacs-Lisp code block (map2)... (table (quote ((1 2 3) hline (4 5 6)))) Wrong type argument: sequencep, hline #+END_EXAMPLE Finally, #+name: mapp: #+BEGIN_SRC emacs-lisp :var table=table1 (mapcar (lambda (row) (if (listp row) (mapcar '1+ row) row)) table) #+END_SRC #+RESULTS: mapp: | 2 | 3 | 4 | |---+---+---| | 5 | 6 | 7 | and the message buffer contains: #+BEGIN_EXAMPLE executing Emacs-Lisp code block (mapp:)... (table (quote ((1 2 3) hline (4 5 6)))) Code block evaluation complete. #+END_EXAMPLE #+name: call1 #+call: map1() works: #+RESULTS: call1 | 1 | 2 | 3 | |---+---+---| | 5 | 6 | 7 | with the message: #+BEGIN_EXAMPLE executing Emacs-Lisp code block (map1)... (table (quote ((4 5 6)))) ((1 2 3) hline (5 6 7)) executing Emacs-Lisp code block (call1)... (results (quote ((1 2 3) hline (5 6 7)))) Code block evaluation complete. #+END_EXAMPLE but: #+name: call2 #+call: map1(table=table1) Generates the following message: #+BEGIN_EXAMPLE executing Emacs-Lisp code block (map1)... (table (quote ((4 5 6)))) ((1 2 3) hline (5 6 7)) executing Emacs-Lisp code block (call1)... (results (quote ((1 2 3) hline (5 6 7)))) Code block evaluation complete. Mark set [2 times] #+END_EXAMPLE rick