From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ido Magal Subject: Re: Embedded code Date: Tue, 18 Jan 2011 09:12:58 -0800 Message-ID: References: <2324250583714673900@unknownmsgid> <87aaizhz23.fsf@gmail.com> <4D3554AC.1060303@gmail.com> <8762tmfa74.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1529279133==" Return-path: Received: from [140.186.70.92] (port=43063 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PfFEs-00069P-VB for emacs-orgmode@gnu.org; Tue, 18 Jan 2011 12:21:19 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PfF7c-00065P-4a for emacs-orgmode@gnu.org; Tue, 18 Jan 2011 12:13:33 -0500 Received: from mail-wy0-f169.google.com ([74.125.82.169]:50528) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PfF7b-00064b-Rd for emacs-orgmode@gnu.org; Tue, 18 Jan 2011 12:13:32 -0500 Received: by wyj26 with SMTP id 26so6460017wyj.0 for ; Tue, 18 Jan 2011 09:13:30 -0800 (PST) In-Reply-To: <8762tmfa74.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: emacs-orgmode@gnu.org, Rainer M Krug --===============1529279133== Content-Type: multipart/alternative; boundary=001485f0a0104bf2b1049a220499 --001485f0a0104bf2b1049a220499 Content-Type: text/plain; charset=UTF-8 Eric, thanks. This is great. Couple of followups: 1. Is it possible to avoid the confirmations on every file load? 2. Is it possible to manipulate or reference the results so that they're not bound to a RESULTS block. I'm finding all of the blocks of orgmode distracting and I'm trying to avoid and eliminate them as much as possible. I'm not used to it and they really impedes the readability of my notes. Ideally my notes would look something like this: * note 1 * note 2 * Back-links to this note: (backlinks-function) * All notes tagged with /foo/ (tagged-with( foo )) * All notes tagged with /bar/ (tagged-with( bar )) Is this possible? Thanks again. Cheers. On Tue, Jan 18, 2011 at 08:16, Eric Schulte wrote: > Rainer M Krug 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)) -*- > > where NAME is replaced with the name of the code block to execute. > > Cheers -- Eric > --001485f0a0104bf2b1049a220499 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Eric,

thanks. =C2=A0This is great.

Couple of followups:

1. Is it= possible to avoid the confirmations on every file load?
2. Is it= possible to manipulate or reference the results so that they're not bo= und to a RESULTS block. =C2=A0I'm finding all of the blocks of orgmode = distracting and I'm trying to avoid and eliminate them as much as possi= ble. =C2=A0I'm not used to it and they really impedes the readability o= f my notes. =C2=A0Ideally my notes would look something like this:

* note 1
* note 2

* = Back-links to this note:
(backlinks-function)
* All not= es tagged with /foo/
(tagged-with( foo ))
* All notes tagged w= ith /bar/
(tagged-with( bar ))

Is this possible?
<= div>
Thanks again. =C2=A0Cheers.


On Tue, Jan 18, 2011 at 08:16, Eric Schulte <schulte.eric@gmail.= com> wrote:
Rainer M Krug <r.m.krug@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 exec= ute
>> its code block every time it is opened. =C2=A0You can replace the = contents of
>> the code block with any arbitrary elisp you would like to have exe= cuted
>> 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-babe= l-execute-src-block)) -*-

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

Cheers -- Eric

--001485f0a0104bf2b1049a220499-- --===============1529279133== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ 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 --===============1529279133==--