emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [Orgmode] org-babel-post-tangle-hook just opening tangled file


From: Eric Schulte
Subject: Re: [Orgmode] org-babel-post-tangle-hook just opening tangled file
Date: Wed, 08 Sep 2010 11:41:10 -0600
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

Hi Miguel,

The hook is run as part of the tangle process, and the tangle process
ensures that if the tangled file was not open before tangling it will
not be open after tangling, so the code you pasted below will have no
effect.

You could use the following function instead of ob-tangle to get the
behavior you've described.

(defun schulte/tangle-then-open ()
  (interactive)
  (mapc #'find-file (org-babel-tangle)))

Best -- Eric

Miguel Ruiz <address@hidden> writes:

> Hi
>
> Should
>
>   (add-hook 'org-babel-post-tangle-hook
>             (lambda () (save-window-excursion
>                         (find-file (buffer-file-name)))))
>
> work in .emacs? 
>
> The purpose is simply opening the tangled file but I think the opening
> happens before the tangled file has finished of being written.
>
> I have tried
>
>   (add-hook 'org-babel-post-tangle-hook
>             (lambda () (save-window-excursion
>                         (find-file "anyfile"))))
>
> and no problem, but the first code does nothing, apparently.
>
> I am a beginner with elisp, so I beg your pardon.
>
> Miguel Ruiz.
>
>
>       
>
> _______________________________________________
> Emacs-orgmode mailing list
> Please use `Reply All' to send replies to the list.
> address@hidden
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode



reply via email to

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