Re: [Orgmode] Re: Embedded code

2011-01-28 Thread Eric Schulte
Sébastien Vauban wxhgmqzgw...@spammotel.com writes:

 Hi Eric and Ido,

 Ido Magal wrote:
 I've gotten the fix and am trying to verify it, however I keep seeing

 File local-variables error: (invalid-function org-save-outline-visibility)

 I'm not sure if it's relevant or not.  This is my test file:

 
 # -*- eval: (org-babel-execute-buffer) -*-

 src_sh[:results append]{ls -t ~/org/ *.txt|head -5}
 

 When this call is executed, the table results is inserted *before* the call
 line. Is this the intended behavior?


The implementation of inline code blocks assumed that they would be used
inline for referencing live values from within paragraphs.  The most
common usage replaces the code block with the result upon export.  We
never really anticipated this syntax being used to replace regular code
blocks.

Given that these can and now are being used in other ways, I've updated
the handling of inline code blocks bringing it more inline with regular
code block usage -- and simplifying the export mechanisms.  They should
now insert their results *after* the code block.

Best -- Eric


 Best regards,
   Seb

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] Re: Embedded code

2011-01-26 Thread Sébastien Vauban
Hi Eric and Ido,

Ido Magal wrote:
 I've gotten the fix and am trying to verify it, however I keep seeing

 File local-variables error: (invalid-function org-save-outline-visibility)

 I'm not sure if it's relevant or not.  This is my test file:

 
 # -*- eval: (org-babel-execute-buffer) -*-

 src_sh[:results append]{ls -t ~/org/ *.txt|head -5}
 

When this call is executed, the table results is inserted *before* the call
line. Is this the intended behavior?

Best regards,
  Seb

-- 
Sébastien Vauban


___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] Re: Embedded code

2011-01-19 Thread Dan Davison
Eric Schulte schulte.e...@gmail.com writes:

 Rainer M Krug r.m.k...@gmail.com writes:

 On 01/18/2011 12:48 AM, Eric Schulte wrote:
 Hi,
 
 This is possible using Babel, the attached org-mode file will execute
 its code block every time it is opened.  You can replace the contents of
 the code block with any arbitrary elisp you would like to have executed
 in the file.
 
 To see this work, save the attached org-mode file to your system, open
 the file, answer y to allow execution, and then check your messages
 buffer for the I have been run message to see that the code block has
 in fact been evaluated.

 This is indeed very useful (e.g. if I open an R script, to open an R
 session and source the file).

 But it seems that all code blocks are evaluated on loading. Is there a
 way of only executing a specific code block?


 Yes, replace the 

 # -*- eval: (org-babel-execute-buffer) -*-

 with

 # -*- eval: (save-excursion (org-babel-goto-named-src-block NAME) 
 (org-babel-execute-src-block)) -*-

I think `sbe' can be used here for a nice short version. E.g.

# -*- eval: (sbe NAME) -*-

or this at the end

# Local variables:
# eval:(sbe NAME)
# End:

where NAME is a double-quoted string.

Dan


 where NAME is replaced with the name of the code block to execute.

 Cheers -- Eric

 ___
 Emacs-orgmode mailing list
 Please 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
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode