From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Schulte Subject: Re: Code block evaluation export bug ? Date: Wed, 09 Nov 2011 14:13:06 -0700 Message-ID: <877h39dmot.fsf@gmail.com> References: <20111019162146.GA24998@client199-154.wlan.hu-berlin.de> <81fwip3q0k.fsf@gmail.com> <20111019201437.GA28039@kenny.fritz.box> <7108.1319059342@alphaville.americas.hpqcorp.net> <32187.1319327474@alphaville.dokosmarshall.org> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([140.186.70.92]:59890) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ROFSL-0005DH-CV for emacs-orgmode@gnu.org; Wed, 09 Nov 2011 16:13:14 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ROFSJ-0008Ce-IG for emacs-orgmode@gnu.org; Wed, 09 Nov 2011 16:13:13 -0500 Received: from mail-qw0-f41.google.com ([209.85.216.41]:34225) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ROFSJ-0008CZ-Ds for emacs-orgmode@gnu.org; Wed, 09 Nov 2011 16:13:11 -0500 Received: by qadc11 with SMTP id c11so2256277qad.0 for ; Wed, 09 Nov 2011 13:13:10 -0800 (PST) In-Reply-To: <32187.1319327474@alphaville.dokosmarshall.org> (Nick Dokos's message of "Sat, 22 Oct 2011 19:51:14 -0400") 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: nicholas.dokos@hp.com Cc: emacs-orgmode@gnu.org I turns out the problem here is that the table was being parsed for column headers twice, so the top two rows were both being taken as column headers. I've just pushed up a fix. Best -- Eric Nick Dokos writes: > Thomas S. Dye wrote: > >> Nick Dokos writes: >> >> > While testing my response to Viktor's question, I ran into a problem. >> > I used a test file that is slightly modified from a previous post of Tom Dye's: >> > >> > * R tables >> > >> > #+TBLNAME: tbl-1 >> > | column1 | column2 | >> > |---------+---------| >> > | 45 | 34 | >> > | 77 | 56 | >> > >> > #+tblname: tbl-2 >> > | col1 | col2 | >> > |------+------| >> > | a | b | >> > | c | d | >> > >> > #+tblname: tbl-3 >> > | c1 | c2 | >> > |----+----| >> > | A | B | >> > | C | D | >> > >> > #+BEGIN_SRC R :var x=tbl-1 :var y=tbl-2 :var z=tbl-3 :colnames yes :exports both :results value >> > z >> > #+END_SRC >> > >> > >> > >> > Evaluating the code block correctly produces the result >> > >> > ,---- >> > | >> > | #+results: >> > | | c1 | c2 | >> > | |----+----| >> > | | A | B | >> > | | C | D | >> > `---- >> > >> > but exporting (to ascii, PDF, HTML or ODT) chops off the first row of >> > the result. For example, here >> > is the ascii: >> > >> > ,---- >> > | >> > | c1 c2 >> > | ----+---- >> > | C D >> > `---- >> > ... >> >> Aloha Nick, >> >> I see the same behavior. >> > > Here's a progress report on this: the call chain is > > ,---- > | > | org-babel-process-params(((:comments . "") (:shebang . "") (:cache > | . "no") (:padline . "") (:noweb . "no") (:tangle . "no") (:exports > | . "both") (:results . "replace value") (:var x (45 34) (77 56)) > | (:var y ("a" "b") ("c" "d")) (:var z ("A" "B") ("C" "D")) (:session > | . "none") (:rowname-names) (:result-type . value) (:result-params > | "replace" "value") (:padnewline . "yes") (:hlines . "no") (:colnames > | . "yes") (:colname-names (x "column1" "column2") (y "col1" "col2") > | (z "c1" "c2")))) > | ... > | (org-babel-exp-in-export-file lang (org-babel-process-params (org-babel-merge-params (nth 2 info) (\` ((:results \, (if silent "silent" "replace"))))))) > | ... > | org-babel-exp-results(("R" "z" ((:cache . "no") (:colname-names (x > | "column1" "column2") (y "col1" "col2") (z "c1" "c2")) (:colnames > | . "yes") (:comments . "") (:exports . "both") (:hlines . "no") > | (:noweb . "no") (:padline . "") (:padnewline . "yes") > | (:result-params "replace" "value") (:result-type . value) (:results > | . "replace value") (:rowname-names) (:session . "none") (:shebang > | . "") (:tangle . "no") (:var x (45 34) (77 56)) (:var y ("a" "b") > | ("c" "d")) (:var z ("A" "B") ("C" "D"))) "" nil 0) block nil > | "6443d36b0252c9e3192f813429018760bee3c11d") > | ... > | org-babel-exp-do-export(("R" "z" ((:cache . "no") (:colname-names > | (x "column1" "column2") (y "col1" "col2") (z "c1" "c2")) (:colnames > | . "yes") (:comments . "") (:exports . "both") (:hlines . "no") > | (:noweb . "no") (:padline . "") (:padnewline . "yes") > | (:result-params "replace" "value") (:result-type . value) (:results > | . "replace value") (:rowname-names) (:session . "none") (:shebang > | . "") (:tangle . "no") (:var x (45 34) (77 56)) (:var y ("a" "b") > | ("c" "d")) (:var z ("A" "B") ("C" "D"))) "" nil 0) block > | "6443d36b0252c9e3192f813429018760bee3c11d") > | > | org-babel-exp-src-block(...) > | > | org-export-blocks-preprocess() > | ... > | org-export-preprocess-string(...) > | ... > | org-export-as-ascii(nil nil nil "*Org ASCII Export*") > | org-export-as-ascii-to-buffer(nil) > | ... > | org-export(nil) > `---- > > So far, so good: x, y and z are still 2x2 tables. But evaluating the last form, we get > > ((:var x (77 56)) (:var y ("c" "d")) (:var z ("C" "D")) > (:colname-names (x "column1" "column2") (y "col1" "col2") (z "c1" > "c2")) (:rowname-names) (:result-params "replace" "value" "replace" > "value") (:result-type . value) (:comments . "") (:shebang . "") > (:cache . "no") (:padline . "") (:noweb . "no") ...) > > The first row of each table has disappeared. Looks like a problem with org-babel-process-params. > Eric, can you take a look? > > Thanks, > Nick > -- Eric Schulte http://cs.unm.edu/~eschulte/