From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: Code block evaluation export bug ? Date: Sat, 22 Oct 2011 19:51:14 -0400 Message-ID: <32187.1319327474@alphaville.dokosmarshall.org> References: <20111019162146.GA24998@client199-154.wlan.hu-berlin.de> <81fwip3q0k.fsf@gmail.com> <20111019201437.GA28039@kenny.fritz.box> <7108.1319059342@alphaville.americas.hpqcorp.net> Reply-To: nicholas.dokos@hp.com Return-path: Received: from eggs.gnu.org ([140.186.70.92]:33359) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RHlLT-0001J3-Qi for emacs-orgmode@gnu.org; Sat, 22 Oct 2011 19:51:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RHlLS-00023A-Gc for emacs-orgmode@gnu.org; Sat, 22 Oct 2011 19:51:19 -0400 Received: from g4t0016.houston.hp.com ([15.201.24.19]:20245) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RHlLS-000231-A8 for emacs-orgmode@gnu.org; Sat, 22 Oct 2011 19:51:18 -0400 In-Reply-To: Message from tsd@tsdye.com (Thomas S. Dye) of "Thu, 20 Oct 2011 15:57:20 -1000." 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: "Thomas S. Dye" Cc: nicholas.dokos@hp.com, emacs-orgmode@gnu.org 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