From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andreas Leha Subject: Re: Possible to use src block to generate org headlines for export? Date: Sat, 26 Jul 2014 01:26:02 +0100 Message-ID: References: <87zjg1gddd.fsf@fastmail.fm> <87wqb4amqb.fsf@gmail.com> <8738dshkdw.fsf@fastmail.fm> <8761io2jnz.fsf@fastmail.fm> <87ha27a5ip.fsf@gmail.com> <87ppgtltzj.fsf@nicolasgoaziou.fr> <87zjfxk1wb.fsf@nicolasgoaziou.fr> <87r419ju9z.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:40753) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XApof-0003Xo-6w for emacs-orgmode@gnu.org; Fri, 25 Jul 2014 20:26:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XApoZ-0006He-R1 for emacs-orgmode@gnu.org; Fri, 25 Jul 2014 20:26:25 -0400 Received: from plane.gmane.org ([80.91.229.3]:40347) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XApoZ-0006HZ-Jo for emacs-orgmode@gnu.org; Fri, 25 Jul 2014 20:26:19 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1XApoW-0007WH-FS for emacs-orgmode@gnu.org; Sat, 26 Jul 2014 02:26:16 +0200 Received: from vpn-2007.gwdg.de ([134.76.2.7]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 26 Jul 2014 02:26:16 +0200 Received: from andreas.leha by vpn-2007.gwdg.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 26 Jul 2014 02:26:16 +0200 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 Nicolas Goaziou writes: > Andreas Leha writes: > >> But then, I do not understand your statement 'headlines are the only >> limitation to raw+replace behaviour'. >> >> This code block does not seem to respect 'raw+replace' for me: >> >> #+name: dtrn >> #+BEGIN_SRC R :results raw replace >> nwords <- 500 >> nletters <- sapply(1:nwords, function(i) sample(1:10, 1)) >> words <- sapply(nletters, function(i) paste(sample(letters, i), collapse="")) >> words[sample(nwords, 100)] <- "\n" >> paste(words, collapse=" ") >> #+END_SRC > > That was not clear, indeed. > > "raw" behaviour is only "useful" (i.e., mandatory) when you want to > insert a headline (or a drawer) as a result of a code block evaluation. > But then, you lose the ability to replace results. That's the limitation > I'm talking about. > > In any other case, "drawer+replace" is the superior choice. Thanks for this clarification. But in that case let me return to and refine my proposal: Why not have "drawer" as the default unless "raw" is given? One could argue, that the extent of the results is implicitly given when the results are not "raw", but being explicit here would allow for some additional features (such as different background for results -- is anyone doing this? I'd be interested). One could also argue, that the users are free to put their results in drawers if they wish. But on the other hand what would be lost by defaulting to drawers? <<<<< main part ends here Having said all that, I want to add, that I do not particularly like the visual appearance of drawers for results blocks; I think they - add one more line than necessary and they - differ too much from the appearance of source blocks This is the state in org This is what I'd prefer... --8<------start-------->8--- --8<------start-------->8--- #+PROPERTY: results drawer #+PROPERTY: results drawer * Test * Test #+name: dtrn #+name: dtrn #+begin_src R :exports both #+begin_src R :exports both "hello" "hello" #+end_src #+end_src #+results: dtrn :RESULTS: #+begin_results dtrn hello hello :END: #+end_results --8<-------end--------->8--- --8<-------end--------->8--- But do not take this too seriously. I am more than happy to live with the standard appearance of drawers here. Regards, Andreas