From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rick Frankel Subject: Re: Babel: the disappearing hline Date: Tue, 12 Nov 2013 14:22:46 -0500 Message-ID: References: <877gcfhuq0.fsf@syk.fi> <8738n3t2ez.fsf@gmail.com> <87fvr3nfcm.fsf@syk.fi> <87wqkfrm3v.fsf@gmail.com> <87y54uhpw8.fsf@gmail.com> <87y54urgs4.fsf@syk.fi> <87ppq6hlye.fsf@gmail.com> <87r4amb0vc.fsf@syk.fi> <87ob5pmwkf.fsf@syk.fi> 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]:45226) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VgJY3-0002rt-Am for emacs-orgmode@gnu.org; Tue, 12 Nov 2013 14:22:56 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VgJXy-0007LM-AS for emacs-orgmode@gnu.org; Tue, 12 Nov 2013 14:22:51 -0500 Received: from [204.62.15.78] (port=51556 helo=mail.rickster.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VgJXy-0007LE-5v for emacs-orgmode@gnu.org; Tue, 12 Nov 2013 14:22:46 -0500 In-Reply-To: <87ob5pmwkf.fsf@syk.fi> 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: emacs-orgmode@gnu.org On 2013-11-12 11:09, Jarmo Hurri wrote: > Rick Frankel writes: > > Greetings Rick. > > Note that in versions of org-mode prior to commit 6857d139 of > 2013-09-28 (below), this was overridden in the setting of > `org-babel-default-header-args:emacs-lisp, so this may be why you are > seeing and "inconsistency" between the call line and the emacs-lisp > source block. > > If I understand correctly, you are referring to the possibility that > the > inconsistency would be caused by an old version of org. I do not think > that this is the case: I have been pulling the newest version every > day. Below is the output of the test, including a printout of my org > version number. I don't think 8.2.3a is the lastest version from git, containing the change eric made to the header args: % git diff release_8.2.3a..6857d139 lisp/ob-emacs-lisp.el|cat diff --git a/lisp/ob-emacs-lisp.el b/lisp/ob-emacs-lisp.el index 886645d..4505129 100644 --- a/lisp/ob-emacs-lisp.el +++ b/lisp/ob-emacs-lisp.el @@ -28,8 +28,7 @@ ;;; Code: (require 'ob) -(defvar org-babel-default-header-args:emacs-lisp - '((:hlines . "yes") (:colnames . "no")) +(defvar org-babel-default-header-args:emacs-lisp nil "Default arguments for evaluating an emacs-lisp source block.") (declare-function orgtbl-to-generic "org-table" (table params)) what is the output of: #+BEGIN_SRC emacs-lisp (mapcar 'list org-babel-default-header-args:emacs-lisp)) #+END_SRC Regardless, I get the same results you do. I think the issue is this: hlines are stripped in the input to a block and added back after depending on the value of the :hlines header argument. Since your code is outputting literal hlines, there is no processing on output from the literal block as there where no inputs. However, if you do the following you will see that the hlines follow the header rules (stripping the hlines by default: #+BEGIN_SRC emacs-lisp :var data=func() data #+END_SRC #+RESULTS: | a | | b | | c | As to the "call" lines, think of the output of the "called" block as being input to an anonymous block (the #+call), so the hlines are stripped. > Or is there something weird in my setup? Do you get a different output > with my test cases? No, nothing weird, but the issue is not specific to "call" lines, it's just related to the way babel processes input and output tablular data. It's not entirely obvious (and affects colnames as well as hlines). Again, the solution is to globally set the :hline property to =yes= instead of the default =no=, and you will get the results you want. Change the value of `org-babel-default-header-args' in your startup or just change the :hlines property on a file or headline basis: #+PROPERTY: hlines yes or * hline pruning in output :PROPERTIES: :hlines: yes :END: > I will look at the other stuff you sent a bit later. > > All the best, > > Jarmo > > # > ---------------------------------------------------------------------- > > * hline pruning in output > > # test org version > #+BEGIN_SRC emacs-lisp > (org-version) > #+END_SRC > > #+RESULTS: > : 8.2.3a > > # case 1: hlines are retained by default when a source code block is > # defined and evaluated > #+NAME: func > #+BEGIN_SRC emacs-lisp > (list '(a) '(b) 'hline '(c)) > #+END_SRC > > #+RESULTS: func > | a | > | b | > |---| > | c | > > # case 2: hlines are retained by default when source code is called > # by post > #+BEGIN_SRC emacs-lisp :post func() > > #+END_SRC > > #+RESULTS: > | a | > | b | > |---| > | c | > > # case 3: but hlines are removed by default when source code is > # called by #+CALL > #+CALL: func() > > #+RESULTS: > | a | > | b | > | c |