emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Orgmode] Embedded code


From: Eric Schulte
Subject: Re: [Orgmode] Embedded code
Date: Mon, 17 Jan 2011 16:48:20 -0700
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

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.

Best -- Eric

# -*- eval: (org-babel-execute-buffer) -*-
#+Title: Evaluates code on startup

* contents
* COMMENT statup code
#+begin_src emacs-lisp :results silent
  (message "I have been run")
#+end_src
Ido Magal <address@hidden> writes:

> Hello,
>
> Is it possible to put a block of code in a document such that it gets
> evaluated when the document is opened?  For example, I'd like to have
> a link-back section in each note.
>
> I'm aware of babel but I neither understand how to make it auto-evaluate on
> open nor do i know if
> making it compact ( and avoid having code and result blocks ) is possible.
>  I see examples where it's used for export but haven't seen one for general
> org usage.
>
> Thanks in advance.
> _______________________________________________
> Emacs-orgmode mailing list
> Please use `Reply All' to send replies to the list.
> address@hidden
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode

reply via email to

[Prev in Thread] Current Thread [Next in Thread]