emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Eric Schulte <schulte.eric@gmail.com>
To: Rainer M Krug <Rainer@krugs.de>
Cc: "emacs-orgmode@gnu.org" <emacs-orgmode@gnu.org>
Subject: Re: BUG - Problem in tangle-mode
Date: Wed, 12 Jun 2013 15:42:37 -0600	[thread overview]
Message-ID: <87wqpzvwdu.fsf@gmail.com> (raw)
In-Reply-To: <8761xjl5qo.fsf@krugs.de> (Rainer M. Krug's message of "Wed, 12 Jun 2013 17:15:59 +0200")

[-- Attachment #1: Type: text/plain, Size: 628 bytes --]

>
> Hi
>
> it seems that I have no luck at the moment.
>
> Now the post tangle hook does not seem to be called.
>

It is called, however the shell script you are trying to execute is not
executing because it is not set as executable.  The permissions of
tangled files are set *after* the post-tangle hook is called (so that
the post-tangle hook has a chance to modify files which will eventually
be set to read only).

You example is trying to run a tangled shell script before it is set to
be executable.  This can not work.  My attached alternative of your
example does run the shell script by not assuming it is executable.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: example.org --]
[-- Type: text/x-org, Size: 890 bytes --]

#+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 ()
                (message "running the post-tangle shell script")
                (shell-command "bash ./postTangleScript.sh")))
#+end_src

** Post tangle script
#+begin_src sh :tangle postTangleScript.sh :results silent
touch PostTangleScriptHasBeenExecuted
#+end_src

* 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  

[-- Attachment #3: Type: text/plain, Size: 46 bytes --]


-- 
Eric Schulte
http://cs.unm.edu/~eschulte

  reply	other threads:[~2013-06-12 21:43 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
2013-06-12 21:42                       ` Eric Schulte [this message]
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

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87wqpzvwdu.fsf@gmail.com \
    --to=schulte.eric@gmail.com \
    --cc=Rainer@krugs.de \
    --cc=emacs-orgmode@gnu.org \
    /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 public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).