emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Andreas Leha <andreas.leha@med.uni-goettingen.de>
To: emacs-orgmode@gnu.org
Subject: Re: Possible to use src block to generate org headlines for	export?
Date: Sat, 26 Jul 2014 01:26:02 +0100	[thread overview]
Message-ID: <oluy4vhge3p.fsf@med.uni-goettingen.de> (raw)
In-Reply-To: 87r419ju9z.fsf@nicolasgoaziou.fr

Nicolas Goaziou <mail@nicolasgoaziou.fr> writes:

> Andreas Leha <andreas.leha@med.uni-goettingen.de> 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

  reply	other threads:[~2014-07-26  0:26 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-22 23:52 Possible to use src block to generate org headlines for export? Matt Lundin
2014-07-23  1:27 ` Nick Dokos
2014-07-23  2:35   ` Matt Lundin
2014-07-23  2:46     ` Matt Lundin
2014-07-23 13:42     ` Brett Viren
2014-07-23 15:17       ` Matt Lundin
2014-07-23 16:06         ` Charles Berry
2014-07-23 17:07           ` Matt Lundin
2014-07-24  1:51           ` Nick Dokos
2014-07-24 10:21             ` Andreas Leha
2014-07-25  8:31               ` Nicolas Goaziou
2014-07-25 13:05                 ` Andreas Leha
2014-07-25 13:23                   ` Nicolas Goaziou
2014-07-25 13:39                     ` Andreas Leha
2014-07-25 14:26                       ` Thorsten Jolitz
2014-07-25 16:08                       ` Nicolas Goaziou
2014-07-26  0:26                         ` Andreas Leha [this message]
2014-07-26  8:07                           ` Nicolas Goaziou
2014-07-26 19:47                             ` Andreas Leha
2014-07-24 18:40             ` Charles Berry
2014-07-24 19:41               ` Nick Dokos
2014-07-23 19:53         ` Brett Viren
2014-07-23 20:42           ` Matt Lundin
2014-07-24 22:05             ` Brett Viren
2014-07-23 16:09     ` Rick Frankel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=oluy4vhge3p.fsf@med.uni-goettingen.de \
    --to=andreas.leha@med.uni-goettingen.de \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).