emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Dan Davison <davison@stats.ox.ac.uk>
To: emailorama <emailorama@yahoo.com.au>
Cc: emacs-orgmode@gnu.org
Subject: Re: [babel] Is ":results output inline" possible
Date: Tue, 20 Oct 2009 11:20:46 -0400	[thread overview]
Message-ID: <87oco2ozw1.fsf@stats.ox.ac.uk> (raw)
In-Reply-To: <87ws2q41uk.fsf@stats.ox.ac.uk> (Dan Davison's message of "Tue, 20 Oct 2009 09:44:03 -0400")

Dan Davison <davison@stats.ox.ac.uk> writes:

[...]

>>
>>  -- Is it possible to use #+lob: with ":results output org" ?
>>
>>  -- Is it possible for #+lob: to take a string argument ?
>
> Both these were bugs, which are fixed in my development branch -- they
> should be merged into org-core by Eric soon.

Those changes are in the main org git repo now, so your examples should
work. Note that with your third example, the header args need to be
placed on the #+lob line rather than with the source block, so
that #+lob knows that it is to output org code (header args placed
with #+lob are inherited by the referenced source block).

Dan


* test
--------------------------------------------------
3. :results output org -> doesn't work with #+lob:
--------------------------------------------------
#+srcname: randthree(n,max)
#+begin_src ruby
number = n
maximum = max
puts "* Random numbers\n" +
"Here are some random numbers: " +
(1..number).collect {|x| (rand * maximum).ceil }.join(", ") +
"."
#+end_src

#+lob: randthree(n=3,max=10) :results output raw

#+resname: randthree(n=3,max=10)
* Random numbers
Here are some random numbers: 5, 1, 10.


> My output from your examples is below.
>
> Thanks a lot for the testing.
>
> Dan
>
>>     
>>     The 4 examples below show things I have tried.
>>       1. and 2. work fine.  
>>       3. and 4. are what I can't work out.
>>
>
> Here's my output
>
> * Al tests (emailorama)
> --------------------------------------------------
> 1.  :results output org -> works
> --------------------------------------------------
> #+srcname: randone
> #+begin_src ruby :results output org
> description = "lucky"
> number = 3
> maximum = 100
> puts "* Random numbers\n" +
> "Here are some #{description} numbers: " +
> (1..number).collect {|x| (rand * maximum).ceil }.join(", ") +
> "."
> #+end_src
>
> #+resname: randone
> *** Random numbers
> Here are some lucky numbers: 15, 52, 93.
>
>
>
> --------------------------------------------------
> 2. :results value  -> works with #+lob:
> --------------------------------------------------
> #+srcname: randtwo(n,max)
> #+begin_src ruby :results value
> number = n
> maximum = max
> "* Random numbers\n" +
> "Here are some random numbers: " +
> (1..number).collect {|x| (rand * maximum).ceil }.join(", ") +
> "."
> #+end_src
>
> #+lob: randtwo(n=3,max=100)
>
> #+resname: randtwo(n=3,max=100)
> : * Random numbers
> : Here are some random numbers: 47, 100, 38.
>
>
>
>
> --------------------------------------------------
> 3. :results output org -> doesn't work with #+lob:
> --------------------------------------------------
> #+srcname: randthree(n,max)
> #+begin_src ruby
> number = n
> maximum = max
> puts "* Random numbers\n" +
> "Here are some random numbers: " +
> (1..number).collect {|x| (rand * maximum).ceil }.join(", ") +
> "."
> #+end_src
>
> #+lob: randthree(n=3,max=10) :results output org
>
> #+resname: randthree(n=3,max=10)
> * Random numbers
> Here are some random numbers: 9, 3, 7.
>
>
> --------------------------------------------------
> 4. Not sure how to use string argument with #+lob:
> --------------------------------------------------
> #+srcname: randfour(n,max,desc)
> #+begin_src ruby :results value
> description = desc
> number = n
> maximum = max
> "* Random numbers\n" +
> "Here are some #{description} numbers: " +
> (1..number).collect {|x| (rand * maximum).ceil }.join(", ") +
> "."
> #+end_src
>
> #+lob: randfour(n=3,max=100,desc="lucky")
>
> #+resname: randfour(n=3,max=100,desc="lucky")
> : * Random numbers
> : Here are some lucky numbers: 65, 24, 42.
>
>
>
>
>
>> Thanks for any ideas you have about these things.
>>
>> al
>>
>> --------------------------------------------------
>> 1.  :results output org -> works
>> --------------------------------------------------
>> #+srcname: randone
>> #+begin_src ruby :results output org
>> description = "lucky"
>> number = 3
>> maximum = 100
>> puts "* Random numbers\n" +
>> "Here are some #{description} numbers: " +
>> (1..number).collect {|x| (rand * maximum).ceil }.join(", ") +
>> "."
>> #+end_src
>>
>> #+resname: randone
>> * Random numbers
>> Here are some lucky numbers: 48, 69, 6.
>>
>>
>> --------------------------------------------------
>> 2. :results value  -> works with #+lob:
>> --------------------------------------------------
>> #+srcname: randtwo(n,max)
>> #+begin_src ruby :results value
>> number = n
>> maximum = max
>> "* Random numbers\n" +
>> "Here are some random numbers: " +
>> (1..number).collect {|x| (rand * maximum).ceil }.join(", ") +
>> "."
>> #+end_src
>>
>> #+lob: randtwo(n=3,max=100)
>>
>> #+resname: randtwo(n=3,max=100)
>> : * Random numbers
>> : Here are some random numbers: 14, 77, 75.
>>
>>
>> --------------------------------------------------
>> 3. :results output org -> doesn't work with #+lob:
>> --------------------------------------------------
>> #+srcname: randthree(n,max)
>> #+begin_src ruby :results output org
>> number = n
>> maximum = max
>> puts "* Random numbers\n" +
>> "Here are some random numbers: " +
>> (1..number).collect {|x| (rand * maximum).ceil }.join(", ") +
>> "."
>> #+end_src
>>
>> #+lob: randthree(n=3,max=10)
>>
>> #+resname: randthree(n=3,max=10)
>> : nil
>>
>>
>> --------------------------------------------------
>> 4. Not sure how to use string argument with #+lob:
>> --------------------------------------------------
>> #+srcname: randfour(n,max,desc)
>> #+begin_src ruby :results value
>> description = desc
>> number = n
>> maximum = max
>> "* Random numbers\n" +
>> "Here are some #{description} numbers: " +
>> (1..number).collect {|x| (rand * maximum).ceil }.join(", ") +
>> "."
>> #+end_src
>>
>> #+lob: randfour(n=3,max=100,desc="lucky")
>>
>> #+resname: randfour(n=3,max=100,desc="lucky")
>> : randfour
>>
>>
>>
>>       
>>
>>
>> _______________________________________________
>> Emacs-orgmode mailing list
>> Remember: use `Reply All' to send replies to the list.
>> Emacs-orgmode@gnu.org
>> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
>
>
>
> _______________________________________________
> Emacs-orgmode mailing list
> Remember: use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode

  reply	other threads:[~2009-10-20 15:20 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-20  6:14 [babel] Is ":results output inline" possible emailorama
2009-10-20 13:44 ` Dan Davison
2009-10-20 15:20   ` Dan Davison [this message]
  -- strict thread matches above, loose matches on Subject: below --
2009-10-23  7:45 emailorama
2009-10-20  6:12 emailorama

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=87oco2ozw1.fsf@stats.ox.ac.uk \
    --to=davison@stats.ox.ac.uk \
    --cc=emacs-orgmode@gnu.org \
    --cc=emailorama@yahoo.com.au \
    /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).