From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rainer M Krug Subject: Re: [babel] set post tangle hook on per file basis - evalu Date: Wed, 10 Aug 2011 09:33:08 +0200 Message-ID: References: <87ipq6hhxt.fsf@gmail.com> <87obzyecbz.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=e89a8f64780b1cfead04aa21b1c0 Return-path: Received: from eggs.gnu.org ([140.186.70.92]:53152) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qr3Hq-00076p-ST for emacs-orgmode@gnu.org; Wed, 10 Aug 2011 03:33:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qr3Hp-0006oV-FB for emacs-orgmode@gnu.org; Wed, 10 Aug 2011 03:33:10 -0400 Received: from mail-qw0-f41.google.com ([209.85.216.41]:50721) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qr3Hp-0006oP-BV for emacs-orgmode@gnu.org; Wed, 10 Aug 2011 03:33:09 -0400 Received: by qwa26 with SMTP id 26so498532qwa.0 for ; Wed, 10 Aug 2011 00:33:09 -0700 (PDT) In-Reply-To: <87obzyecbz.fsf@gmail.com> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Eric Schulte Cc: emacs-orgmode --e89a8f64780b1cfead04aa21b1c0 Content-Type: text/plain; charset=ISO-8859-1 On Tue, Aug 9, 2011 at 7:14 PM, Eric Schulte wrote: > >> > >> Hi Rainer, > >> > >> I like to use file local variables [1] to do per-file Org-mode > >> configuration and customization this is an easy way to set the local > >> value of a variable every time the file is opened. > >> > >> I think you could use file local variables to evaluate arbitrary elisp > >> when a file is opened in which case you could evaluate a named code > >> block with something like `(sbe code-block-name)'. > >> > > > > Sounds interesting. > > > > So to set the post-tangle-hook, I tried the following: > > > > # -*- eval: (add-hook 'org-babel-post-tangle-hook; -*- > > > > But it did not work - I have no idea, what I'm missing - eval should > > evaluate the following expression, which should set the post-tangle-hook. > > > > maybe try something like the following > > # -*- org-babel-post-tangle-hook: '(my-tangle-hook-function) -*- > > where `my-tangle-hook-function' is defined in your .emacs config. > Good idea - I'll try that - thanks. > > > > > Your suggestion, to evaluate a code block after opening, sounds very > > interesting - could you give me a very short example? > > > > The info link I posted should explain how to evaluate a snippet of > elisp, once you have that working (you could test with simple calls to > the `message' function) you can use the `sbe' function (see it's > documentation) to evaluate named code blocks. > Thanks, I'll try it out, Rainer > > Best -- Eric > > > > > Thanks, and sorry for my lack of elisp understanding - it has not > improved > > much... > > > > Rainer > > > > > >> Best -- Eric > >> > >> Footnotes: > >> [1] [[info:emacs#Specifying%20File%20Variables][info:emacs#Specifying > File > >> Variables]] > >> > >> -- > >> Eric Schulte > >> http://cs.unm.edu/~eschulte/ > >> > > -- > Eric Schulte > http://cs.unm.edu/~eschulte/ > -- Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys. (Germany) Centre of Excellence for Invasion Biology Stellenbosch University South Africa Tel : +33 - (0)9 53 10 27 44 Cell: +33 - (0)6 85 62 59 98 Fax (F): +33 - (0)9 58 10 27 44 Fax (D): +49 - (0)3 21 21 25 22 44 email: Rainer@krugs.de Skype: RMkrug --e89a8f64780b1cfead04aa21b1c0 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable

On Tue, Aug 9, 2011 at 7:14 PM, Eric Sch= ulte <schult= e.eric@gmail.com> wrote:
>>
>> Hi Rainer,
>>
>> I like to use file local variables [1] to do per-file Org-mode
>> configuration and customization this is an easy way to set the loc= al
>> value of a variable every time the file is opened.
>>
>> I think you could use file local variables to evaluate arbitrary e= lisp
>> when a file is opened in which case you could evaluate a named cod= e
>> block with something like `(sbe code-block-name)'.
>>
>
> Sounds interesting.
>
> So to set the post-tangle-hook, I tried the following:
>
> # -*- eval: (add-hook 'org-babel-post-tangle-hook; -*-
>
> But it did not work - I have no idea, what I'm missing - eval shou= ld
> evaluate the following expression, which should set the post-tangle-ho= ok.
>

maybe try something like the following

# -*- org-babel-post-tangle-hook: '(my-tangle-hook-function) -*-

where `my-tangle-hook-function' is defined in your .emacs config.

Good idea - I'll try that - thanks.
=A0

>
> Your suggestion, to evaluate a code block after opening, sounds very > interesting - could you give me a very short example?
>

The info link I posted should explain how to evaluate a snippet of elisp, once you have that working (you could test with simple calls to
the `message' function) you can use the `sbe' function (see it'= s
documentation) to evaluate named code blocks.

Thanks, I'll try it out,

Rainer

=A0

Best -- Eric

>
> Thanks, and sorry for my lack of elisp understanding - it has not impr= oved
> much...
>
> Rainer
>
>
>> Best -- Eric
>>
>> Footnotes:
>> [1] =A0[[info:emacs#Specifying%20File%20Variables][info:emacs#Spec= ifying File
>> Variables]]
>>
>> --
>> Eric Schulte
>> http://= cs.unm.edu/~eschulte/
>>

--
Eric Schulte
http://cs.unm.ed= u/~eschulte/



--
Rainer M. K= rug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl= . Phys. (Germany)

Centre of Excellence for Invasion Biology
Stell= enbosch University
South Africa

Tel : =A0 =A0 =A0 +33 - (0)9 53 10 27 44
Cell: =A0 = =A0 =A0 +33 - (0)6 85 62 59 98
Fax (F): =A0 =A0 =A0 +33 - (0)9 58 10 27 = 44

Fax (D): =A0 =A0+49 - (0)3 21 21 25 22 44

email: =A0 =A0 = =A0Rainer@krugs.de=

Skype: =A0 =A0 =A0RMkrug

--e89a8f64780b1cfead04aa21b1c0--