emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* result of code evaluation
@ 2011-08-19 19:06 Henri-Paul Indiogine
  2011-08-19 20:00 ` Sebastien Vauban
  0 siblings, 1 reply; 7+ messages in thread
From: Henri-Paul Indiogine @ 2011-08-19 19:06 UTC (permalink / raw)
  To: emacs-org

Greetings!

I am just now starting to use babel in my org-mode files.  I am
intrigued by its capabilities, but I encountered a strange phenomenon:

--------8<------------------------------->8-------------
#+srcname: test
#+begin_src sh :results value
#!/bin/bash

echo "hello"

#+end_src

#+results: test
: hello
-------8<--------------------------------->8------------

Why is there a ":" at the beginning of the results line?  Can I get rid of it?

Thanks,
Henri-Paul
-- 
Henri-Paul Indiogine

Curriculum & Instruction
Texas A&M University
TutorFind Learning Centre

Email: hindiogine@gmail.com
Skype: hindiogine
Website: http://people.cehd.tamu.edu/~sindiogine

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: result of code evaluation
  2011-08-19 19:06 Henri-Paul Indiogine
@ 2011-08-19 20:00 ` Sebastien Vauban
  2011-08-19 20:10   ` Henri-Paul Indiogine
  0 siblings, 1 reply; 7+ messages in thread
From: Sebastien Vauban @ 2011-08-19 20:00 UTC (permalink / raw)
  To: emacs-orgmode-mXXj517/zsQ

Hi Henri-Paul,

Henri-Paul Indiogine wrote:
> Greetings!
>
> I am just now starting to use babel in my org-mode files.  I am
> intrigued by its capabilities, but I encountered a strange phenomenon:
>
> --------8<------------------------------->8-------------
> #+srcname: test
> #+begin_src sh :results value
> #!/bin/bash
>
> echo "hello"
>
> #+end_src
>
> #+results: test
> : hello
> -------8<--------------------------------->8------------
>
> Why is there a ":" at the beginning of the results line?

Its purpose is to delimit the result block. Imagine you re-eval the code
block, and that (by default, BTW) the result block must be overridden by the
new value, Babel must have a way to identify what to delete first.

> Can I get rid of it?

The only other solutions are:

- use the option =:results raw=, but you can't do any replace anymore (of old
  results by new results)

- =(setq org-babel-min-lines-for-block-output 1)=, to force Org to put the
  output enclosed in a #+begin/end_example block.

Best regards,
  Seb

-- 
Sebastien Vauban

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: result of code evaluation
       [not found] <4E4EC0F1.5070809@ymail.com>
@ 2011-08-19 20:02 ` iminet
  0 siblings, 0 replies; 7+ messages in thread
From: iminet @ 2011-08-19 20:02 UTC (permalink / raw)
  To: emacs-orgmode


Am 19.08.2011 21:06, schrieb Henri-Paul Indiogine:
>  Greetings!
>
>  I am just now starting to use babel in my org-mode files.  I am
>  intrigued by its capabilities, but I encountered a strange phenomenon:
>
>  --------8<------------------------------->8-------------
>  #+srcname: test
>  #+begin_src sh :results value
>  #!/bin/bash
>
>  echo "hello"
>
>  #+end_src
>
>  #+results: test
>  : hello
>  -------8<--------------------------------->8------------
>
>  Why is there a ":" at the beginning of the results line?  Can I get rid of it?
>
>  Thanks,
>  Henri-Paul

I dont know, but the example on
http://orgmode.org/guide/Working-With-Source-Code.html also includes a
':' at the beginning of the line.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: result of code evaluation
  2011-08-19 20:00 ` Sebastien Vauban
@ 2011-08-19 20:10   ` Henri-Paul Indiogine
  2011-08-19 20:20     ` Sebastien Vauban
  0 siblings, 1 reply; 7+ messages in thread
From: Henri-Paul Indiogine @ 2011-08-19 20:10 UTC (permalink / raw)
  To: Sebastien Vauban; +Cc: emacs-orgmode

Hi Sebastien!

2011/8/19 Sebastien Vauban <wxhgmqzgwmuf@spammotel.com>:
> The only other solutions are:
>
> - use the option =:results raw=, but you can't do any replace anymore (of old
>  results by new results)
>
> - =(setq org-babel-min-lines-for-block-output 1)=, to force Org to put the
>  output enclosed in a #+begin/end_example block.

I like the second option.   I have place the line in my .emacs and it
works beautifully.

Thanks!

Henri-Paul

-- 
Henri-Paul Indiogine

Curriculum & Instruction
Texas A&M University
TutorFind Learning Centre

Email: hindiogine@gmail.com
Skype: hindiogine
Website: http://people.cehd.tamu.edu/~sindiogine

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: result of code evaluation
  2011-08-19 20:10   ` Henri-Paul Indiogine
@ 2011-08-19 20:20     ` Sebastien Vauban
  2011-08-19 22:08       ` Henri-Paul Indiogine
  0 siblings, 1 reply; 7+ messages in thread
From: Sebastien Vauban @ 2011-08-19 20:20 UTC (permalink / raw)
  To: emacs-orgmode-mXXj517/zsQ

Hi Henri-Paul,

Henri-Paul Indiogine wrote:
> 2011/8/19 Sebastien Vauban <wxhgmqzgwmuf-geNee64TY+gS+FvcfC7Uqw@public.gmane.org>:
>> The only other solutions are:
>>
>> - use the option =:results raw=, but you can't do any replace anymore (of old
>>  results by new results)
>>
>> - =(setq org-babel-min-lines-for-block-output 1)=, to force Org to put the
>>  output enclosed in a #+begin/end_example block.
>
> I like the second option.   I have place the line in my .emacs and it
> works beautifully.

I did it with (setq ... 2), so that only one-line results get prefixed by a
colon. All the others are enclosed in a block.

> Thanks!

You're welcome. Glad to help.

Best regards,
  Seb

-- 
Sebastien Vauban

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: result of code evaluation
  2011-08-19 20:20     ` Sebastien Vauban
@ 2011-08-19 22:08       ` Henri-Paul Indiogine
  2011-08-21 18:14         ` Eric Schulte
  0 siblings, 1 reply; 7+ messages in thread
From: Henri-Paul Indiogine @ 2011-08-19 22:08 UTC (permalink / raw)
  To: Sebastien Vauban; +Cc: emacs-orgmode

Greetings!

I have another question regarding the output of the bash script.   I
have a bunch of echo statements.  org-mode outputs now everything in a
table.  Is it possible to suppress this and have just plain lines?
That was the behavior with a simple script.

Thanks,
Henri-Paul


-- 
Henri-Paul Indiogine

Curriculum & Instruction
Texas A&M University
TutorFind Learning Centre

Email: hindiogine@gmail.com
Skype: hindiogine
Website: http://people.cehd.tamu.edu/~sindiogine

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: result of code evaluation
  2011-08-19 22:08       ` Henri-Paul Indiogine
@ 2011-08-21 18:14         ` Eric Schulte
  0 siblings, 0 replies; 7+ messages in thread
From: Eric Schulte @ 2011-08-21 18:14 UTC (permalink / raw)
  To: Henri-Paul Indiogine; +Cc: Sebastien Vauban, emacs-orgmode

Henri-Paul Indiogine <hindiogine@gmail.com> writes:

> Greetings!
>
> I have another question regarding the output of the bash script.   I
> have a bunch of echo statements.  org-mode outputs now everything in a
> table.  Is it possible to suppress this and have just plain lines?
> That was the behavior with a simple script.
>

Yes, the ":results scalar" header argument is what you want.

#+begin_src sh :results scalar
  echo 1
  echo 2
  echo 3
#+end_src

#+results:
: 1
: 2
: 3

Best -- Eric

-- 
Eric Schulte
http://cs.unm.edu/~eschulte/

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2011-08-21 18:16 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <4E4EC0F1.5070809@ymail.com>
2011-08-19 20:02 ` result of code evaluation iminet
2011-08-19 19:06 Henri-Paul Indiogine
2011-08-19 20:00 ` Sebastien Vauban
2011-08-19 20:10   ` Henri-Paul Indiogine
2011-08-19 20:20     ` Sebastien Vauban
2011-08-19 22:08       ` Henri-Paul Indiogine
2011-08-21 18:14         ` Eric Schulte

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).