From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rainer M Krug Subject: [babel] set post tangle hook on per file basis - evalu Date: Mon, 8 Aug 2011 10:12:49 +0200 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=0016364572064fc47f04a9fa0375 Return-path: Received: from eggs.gnu.org ([140.186.70.92]:50749) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QqKx9-00030k-7F for emacs-orgmode@gnu.org; Mon, 08 Aug 2011 04:12:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QqKx8-0007Eg-6Y for emacs-orgmode@gnu.org; Mon, 08 Aug 2011 04:12:51 -0400 Received: from mail-qw0-f41.google.com ([209.85.216.41]:57500) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QqKx8-0007Eb-10 for emacs-orgmode@gnu.org; Mon, 08 Aug 2011 04:12:50 -0400 Received: by qwa26 with SMTP id 26so1643223qwa.0 for ; Mon, 08 Aug 2011 01:12:49 -0700 (PDT) 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: emacs-orgmode --0016364572064fc47f04a9fa0375 Content-Type: text/plain; charset=ISO-8859-1 Hi for different files, I put different things in the post-tangle hook. At tha moment, I have an emacs-lisp code block, which I evaluate before I tangle, but I forget this sometimes - so y question: is it possible (and think to remember that it is, but I can't find how) to evaluate a source code block upon opening of the file, or set the org-babel-post-tangle-hook in a different way upon opening of the org file? The code block I am using at the moment is: ** Evaluate to run post tangle script #+begin_src emacs-lisp :results silent :tangle no :exports none (add-hook 'org-babel-post-tangle-hook ( lambda () (call-process-shell-command "./postTangleScript.sh" nil 0 nil) ) ) #+end_src Thanks, Rainer -- 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 --0016364572064fc47f04a9fa0375 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi

for different files, I put different things in the po= st-tangle hook. At tha moment, I have an emacs-lisp code block, which I eva= luate before I tangle, but I forget this sometimes - so y question: is it p= ossible (and think to remember that it is, but I can't find how) to eva= luate a source code block upon opening of the file, or set the org-babel-po= st-tangle-hook in a different way upon opening of the org file?

The code block I am using at the moment is:
<= br>
** Evaluate to run post tangle script
#+begin_= src emacs-lisp :results silent :tangle no :exports none
=A0 (add-= hook 'org-babel-post-tangle-hook
=A0 =A0 =A0 =A0 =A0 =A0 (
=A0 =A0 =A0 =A0 =A0 =A0 =A0lambda = ()=A0
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (call-process-shell= -command "./postTangleScript.sh" nil 0 nil)
=A0 =A0 =A0= =A0 =A0 =A0 =A0 =A0 =A0 =A0 )
=A0 =A0 =A0 =A0 =A0 =A0 )
#+end_src

Thanks,

Rainer<= /div>

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

Centre of Ex= cellence for Invasion Biology
Stellenbosch 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
<= br>Fax (D): =A0 =A0+49 - (0)3 21 21 25 22 44<= /a>

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

Skype: =A0 =A0 =A0RMkrug

--0016364572064fc47f04a9fa0375--