From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rainer M Krug Subject: Re: BUG - Problem in tangle-mode Date: Wed, 12 Jun 2013 17:15:59 +0200 Message-ID: <8761xjl5qo.fsf@krugs.de> References: <878v2omz5g.fsf@krugs.de> <51af4bfd.0c95ec0a.2372.097e@mx.google.com> <87ehcf6xey.fsf@gmail.com> <87ehcewdye.fsf@krugs.de> <8738ssmoyl.fsf@gmail.com> <87k3m21jhc.fsf@krugs.de> <8761xmgtpy.fsf_-_@krugs.de> <87k3m2hsa2.fsf@gmail.com> <87bo7dds7g.fsf_-_@krugs.de> <878v2gh6ea.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:40608) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UmmmV-0001R7-0X for emacs-orgmode@gnu.org; Wed, 12 Jun 2013 11:16:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UmmmO-0004ak-6h for emacs-orgmode@gnu.org; Wed, 12 Jun 2013 11:16:14 -0400 Received: from mail-we0-x232.google.com ([2a00:1450:400c:c03::232]:63181) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UmmmN-0004aT-Ss for emacs-orgmode@gnu.org; Wed, 12 Jun 2013 11:16:08 -0400 Received: by mail-we0-f178.google.com with SMTP id u53so7001135wes.37 for ; Wed, 12 Jun 2013 08:16:07 -0700 (PDT) In-Reply-To: (Rainer M. Krug's message of "Tue, 11 Jun 2013 20:25:46 +0200") 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@gnu.org" --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Rainer M Krug writes: > On Tuesday, June 11, 2013, Eric Schulte wrote: > >> Rainer M Krug > writes: >> >> > Eric Schulte > writes: >> > >> >>>>> >> >>>>> I've added a :tangle-mode header argument which may be used to >> control >> >>>>> the permissions of tangled files. See the manual for instructions= on >> >>>>> it's usage. >> >>>> >> >>>> >> >>>> Thanks a lot. I will try it out today or tomorrow. >> >>> >> >>> I did, and there is a problem with tangling multiple blocks into a >> >>> single file: >> >>> >> >> >> >> Oh, stupid of me. Thanks for sending this alert, I've just pushed up= a >> >> change which should fix this problem. We now wait to set the file mo= des >> >> until after all blocks are tangled and after the post-tangle-hook has >> >> been run. >> >> >> >> Thanks, >> > >> > Hi >> > >> > Unfortunately, it is now worse, as even without the tangle-mode header, >> > I can't tangle two blocks - the second block overwrites the before >> > tangled blocks. It tells me that two blocks were tangled, but only the >> > last one is in the tangled file. >> > >> > I will for revert for now to the version from yesterday. >> > >> > Cheers, >> > >> >> Just pushed up a fix. Cheers, > > > Thanks. Will try it out tomorrow, Hi it seems that I have no luck at the moment. Now the post tangle hook does not seem to be called. If I use the file below, evaluate the code to set the hook, the hook is not executed. ,---- | #+PROPERTY: tangle ./test.R |=20 | * Internal configurations :noexp= ort: | ** 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" n= il 0 nil)) | ) | #+end_src |=20 | ** Post tangle script | #+begin_src sh :tangle postTangleScript.sh | touch PostTangleScriptHasBeenExecuted | #+end_src |=20 | #+results: |=20 |=20 | * Two blocks | Block 1 | #+begin_src R | suitName <- function(species) | { | return( paste(species$layer, "suitability", sep=3D"= _") ) | } | #+end_src=20=20 |=20 | Block 2 | #+begin_src R | statDistName <- function(species){ | return( paste(species$layer, "disturbances_static", sep=3D"_") ) | } | #+end_src=20=20 `---- The hook is set: ,---- | Its value is | ((lambda nil | (call-process-shell-command "./postTangleScript.sh" nil 0 nil))) |=20 | Original value was nil `---- Strangely enough, if I use ,---- | #+begin_src emacs-lisp :tangle no | (defvar org-babel-tangled-file nil | "If non-nill, current file was tangled with org-babel-tangle") | (put 'org-babel-tangled-file 'safe-local-variable 'booleanp) |=20 | (defun org-babel-mark-file-as-tangled () |=20=20=20 | (when (string-match "[.]R" (buffer-file-name)) | (add-file-local-variable 'org-babel-tangled-file t) | (add-file-local-variable 'buffer-read-only t) | ;; (add-file-local-variable 'eval: (auto-revert-mode)) | (basic-save-buffer))) |=20 | (add-hook 'org-babel-post-tangle-hook 'org-babel-mark-file-as-tangled) | #+end_src `---- and evaluate this block (after resetting the post-tangle-hook), this function is executed? Sorry about all the hassles, Rainer > > Cheers, > > Rainer > >> >> -- >> Eric Schulte >> http://cs.unm.edu/~eschulte >> =2D-=20 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 : +33 - (0)9 58 10 27 44 Fax (D): +49 - (0)3 21 21 25 22 44 email: Rainer@krugs.de Skype: RMkrug --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iQEcBAEBAgAGBQJRuJCvAAoJENvXNx4PUvmCKvYH/01mH5GbYILGu8bYMVjBhwkM uCDtfmvHXzQBbKDzJgDjTMoMNYXlbp/cukK5EKsmLqkyTtTgKjL60971YqyjMCAb voYC/jYWsBlxHX3qfbPTjcphQB+W96XkDLwbKEnyXdzR+SsftbbCF/4GCUVbkNEF 6r3iw7AjkfVAV3rW7g7uCY20GjcSUl9NAvsKQrJNfuuG8HdhJQFQBaK3PKOhNGUB sxHiDObkmA3eGZBj0o7V4bBJkMA/9nOwO8T7HehwbG7Ma/IXalpRWylj6rSSgPGM z7VXb3xS4CuD8P//se/oVc+X8hDZIl4WXBHeGj0oC5Wscqf3z2oMt3DtNi21ad4= =mM/Z -----END PGP SIGNATURE----- --=-=-=--