Eric Schulte <eric.schu...@gmx.com> writes: > Thomas Alexander Gerds <tagt...@sund.ku.dk> writes:
[...] >> now, I would like to tell org to evaluate the lisp code at startup, when >> the org-file is opened. can this be achieved? particularly, is there a >> startup special line which tells org to evaluate the lisp src block? I >> could add a suitable function to org-mode-hook, but is this the >> recommended way? >> Tomy >> > There is not currently any support for evaluating specific code blocks > on buffer open. You could move your elisp code into a > buffer-local-variable block (which can house functions) and which are > evaluated when buffers are opened. I believe all changes made in such > blocks are buffer local, so that may be your best bet. and I would be uncomfortable having code execute automatically upon visiting an org file... however, I would imagine it should be possible to add something to org-mode-hook that would execute a predefined src code block, e.g. maybe one named "startup" or probably a bit more specific? I wouldn't know the babel invocation required, mind you, but I'm others can help here! -- : Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 24.0.92.1 : using Org-mode version 7.8.03 (release_7.8.03.325.g5847)