From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: Code block evaluation export bug ? Date: Wed, 09 Nov 2011 16:55:43 -0500 Message-ID: <11459.1320875743@alphaville.americas.hpqcorp.net> 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> <877h39dmot.fsf@gmail.com> Reply-To: nicholas.dokos@hp.com Return-path: Received: from eggs.gnu.org ([140.186.70.92]:41809) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ROG7j-0002F0-CM for emacs-orgmode@gnu.org; Wed, 09 Nov 2011 16:56:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ROG7h-000812-7t for emacs-orgmode@gnu.org; Wed, 09 Nov 2011 16:55:59 -0500 Received: from g1t0028.austin.hp.com ([15.216.28.35]:39269) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ROG7h-0007ze-1Z for emacs-orgmode@gnu.org; Wed, 09 Nov 2011 16:55:57 -0500 In-Reply-To: Message from Eric Schulte of "Wed, 09 Nov 2011 14:13:06 MST." <877h39dmot.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: nicholas.dokos@hp.com, emacs-orgmode@gnu.org Eric Schulte wrote: > 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. > Works fine - thanks! > 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/ >