emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] tangle on export


From: Alan Schmitt
Subject: Re: [O] tangle on export
Date: Thu, 24 Sep 2015 15:36:34 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (darwin)

Hi Rainer,

On 2015-09-24 13:17, Rainer M Krug <address@hidden> writes:

> Alan Schmitt <address@hidden> writes:
>
>> Hello,
>>
>> I have a question I feel is very basic but I did not find the answer in
>> the manual. How can I trigger the tangling of a block upon export.
>
> Tangling and exporting are two different paths (well - one could see
> tangling as a special case of exporting).
>
> You have to use an export hook (see
> http://orgmode.org/tmp/worg/org-configs/org-hooks.html for a list of
> hooks in org).
>
> I have done something similar to run a post-tangle hook:
>
> #+begin_src emacs-lisp
> (defvar org-babel-tangle-run-postTangleScript nil
>   "If non-nil, postTangleScript.sh will be executed")
> (put 'org-babel-tangle-run-postTangleScript 'safe-local-variable 'booleanp)
>
> (defun org-babel-run-post-tangle-script ()
>   (when org-babel-tangle-run-postTangleScript
>     (message "running the postTangleScript.sh bash shell script")
>     (shell-command "bash ./postTangleScript.sh")))
>
> (add-hook 'org-babel-post-tangle-hook 'org-babel-run-post-tangle-script)
> #+end_src

Thanks, I’ll give this a try.

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7
Athmospheric CO₂ (Updated September 22, 2015, Mauna Loa Obs.): 397.23 ppm

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]