From: Rainer M Krug <Rainer@krugs.de>
To: Eric Schulte <schulte.eric@gmail.com>
Cc: "emacs-orgmode@gnu.org" <emacs-orgmode@gnu.org>
Subject: Re: BUG - Problem in tangle-mode
Date: Wed, 12 Jun 2013 17:15:59 +0200 [thread overview]
Message-ID: <8761xjl5qo.fsf@krugs.de> (raw)
In-Reply-To: <CAGhLh6EPD81n4Kot=LZ9u3X8WryuL+N3=4Cc7VsArNv3FyUeZg@mail.gmail.com> (Rainer M. Krug's message of "Tue, 11 Jun 2013 20:25:46 +0200")
[-- Attachment #1: Type: text/plain, Size: 3963 bytes --]
Rainer M Krug <r.m.krug@gmail.com> writes:
> On Tuesday, June 11, 2013, Eric Schulte wrote:
>
>> Rainer M Krug <Rainer@krugs.de <javascript:;>> writes:
>>
>> > Eric Schulte <schulte.eric@gmail.com <javascript:;>> 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 modes
>> >> 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
|
| * Internal configurations :noexport:
| ** 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
|
| ** Post tangle script
| #+begin_src sh :tangle postTangleScript.sh
| touch PostTangleScriptHasBeenExecuted
| #+end_src
|
| #+results:
|
|
| * Two blocks
| Block 1
| #+begin_src R
| suitName <- function(species)
| {
| return( paste(species$layer, "suitability", sep="_") )
| }
| #+end_src
|
| Block 2
| #+begin_src R
| statDistName <- function(species){
| return( paste(species$layer, "disturbances_static", sep="_") )
| }
| #+end_src
`----
The hook is set:
,----
| Its value is
| ((lambda nil
| (call-process-shell-command "./postTangleScript.sh" nil 0 nil)))
|
| 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)
|
| (defun org-babel-mark-file-as-tangled ()
|
| (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)))
|
| (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
>>
--
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
[-- Attachment #2: Type: application/pgp-signature, Size: 489 bytes --]
next prev parent reply other threads:[~2013-06-12 15:16 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-05 14:04 Automatically adding local variables to tangled file Rainer M Krug
2013-06-05 14:32 ` Darlan Cavalcante Moreira
2013-06-05 15:41 ` Vitalie Spinu
2013-06-05 16:15 ` Rainer M Krug
2013-06-06 7:53 ` Sebastien Vauban
2013-06-06 16:01 ` Eric Schulte
2013-06-07 7:57 ` Rainer M Krug
2013-06-07 8:32 ` Rainer M Krug
2013-06-07 10:57 ` [PATCH] Don't ask "File changed on disk" in org-babel-post-tangle-hook Vitalie Spinu
2013-06-07 13:23 ` Eric Schulte
2013-06-07 13:47 ` Rainer M Krug
2013-06-08 18:23 ` Automatically adding local variables to tangled file Eric Schulte
2013-06-08 20:59 ` Achim Gratz
2013-06-08 21:17 ` Eric Schulte
2013-06-10 8:02 ` Rainer M Krug
2013-06-10 10:12 ` Problem in tangle-mode -- WAS: " Rainer M Krug
2013-06-10 15:58 ` Eric Schulte
2013-06-11 7:25 ` BUG - Problem in tangle-mode Rainer M Krug
2013-06-11 13:09 ` Eric Schulte
2013-06-11 18:25 ` Rainer M Krug
2013-06-12 15:15 ` Rainer M Krug [this message]
2013-06-12 21:42 ` Eric Schulte
2013-06-13 7:28 ` Rainer M Krug
2013-06-10 11:32 ` SOLVED: Automatically adding local variables to tangled file Rainer M Krug
2013-06-05 17:10 ` Thorsten Jolitz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8761xjl5qo.fsf@krugs.de \
--to=rainer@krugs.de \
--cc=emacs-orgmode@gnu.org \
--cc=schulte.eric@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.