From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rainer M Krug Subject: Re: Embedded code Date: Tue, 18 Jan 2011 09:51:56 +0100 Message-ID: <4D3554AC.1060303@gmail.com> References: <2324250583714673900@unknownmsgid> <87aaizhz23.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Return-path: Received: from [140.186.70.92] (port=55540 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pf7II-0001xw-LG for emacs-orgmode@gnu.org; Tue, 18 Jan 2011 03:52:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Pf7IH-0000xM-90 for emacs-orgmode@gnu.org; Tue, 18 Jan 2011 03:52:02 -0500 Received: from mail-ww0-f41.google.com ([74.125.82.41]:36589) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Pf7IH-0000x7-4V for emacs-orgmode@gnu.org; Tue, 18 Jan 2011 03:52:01 -0500 Received: by wwi18 with SMTP id 18so2947813wwi.0 for ; Tue, 18 Jan 2011 00:51:59 -0800 (PST) In-Reply-To: <87aaizhz23.fsf@gmail.com> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Eric Schulte Cc: Ido Magal , emacs-orgmode@gnu.org -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 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? Cheers, Rainer > > Best -- Eric > > > > > > Ido Magal 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. >> 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 - -- Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys. (Germany) Centre of Excellence for Invasion Biology Natural Sciences Building Office Suite 2039 Stellenbosch University Main Campus, Merriman Avenue Stellenbosch South Africa Tel: +33 - (0)9 53 10 27 44 Cell: +27 - (0)8 39 47 90 42 Fax (SA): +27 - (0)8 65 16 27 82 Fax (D) : +49 - (0)3 21 21 25 22 44 Fax (FR): +33 - (0)9 58 10 27 44 email: Rainer@krugs.de Skype: RMkrug -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk01VKwACgkQoYgNqgF2egqGpQCfV+cIwibbFNGENpeem101fxy2 DQkAnRx825iX2QP/B9wl/M5xYa61yqQV =1BSa -----END PGP SIGNATURE-----