Re: ist here a :post header arg for tangling?

2021-01-04 Thread Immanuel Litzroth
I also seem to remember that the buffer you are dropped into after tangling doesn't even have the correct major mode set. Immanuel On Mon, Jan 4, 2021 at 4:11 PM Diego Zamboni wrote: > > Agree. It should be possible to make the hook file-local, but still it's not > trivial to have good control

Re: ist here a :post header arg for tangling?

2021-01-04 Thread Immanuel Litzroth
Oh and I also made the tangling itself more flexible in that you can now also choose to only tangle stuff going to a certain file. This is mainly to be able to define an interactive command that tangles/reloads everything going to the file under point. Immanuel On Mon, Jan 4, 2021 at 4:31 PM

Re: ist here a :post header arg for tangling?

2021-01-04 Thread Immanuel Litzroth
Well I solved the problem by writing a tangler which can be configured with tangle-config you define a tangler by making a hash "language" -> tangle-hooks. The tangle-hooks are called at beginning of tangling, on each source block, on each noweb-ref and at the end of tangling. They receive the

Re: ist here a :post header arg for tangling?

2021-01-04 Thread George Mauer
So like I said, I would like to run some code to post-process files. Nothing super-concrete, but a bunch of small use cases I've run into such as - Running tests on every tangle - Executing a code block in the same document and running tests after all tangles - Running a code-formatter such as

Re: ist here a :post header arg for tangling?

2021-01-04 Thread Diego Zamboni
Agree. It should be possible to make the hook file-local, but still it's not trivial to have good control over where and how the changes are made. --Diego On Mon, Jan 4, 2021 at 3:51 PM Immanuel Litzroth < immanuel.litzr...@gmail.com> wrote: > There's that, but you're not gonna do much with

Re: ist here a :post header arg for tangling?

2021-01-04 Thread Immanuel Litzroth
There's that, but you're not gonna do much with that since it is global to emacs. If you're brimming with vigour you might achieve what you want by rebinding that each time you tangle to do the correct thing. Not much information is available in that hook, you get dropped into a temp buffer

Re: ist here a :post header arg for tangling?

2021-01-04 Thread Diego Zamboni
There's =org-babel-post-tangle-hook=, which AFAICT specifies hooks that will be run with the tangled code in a temporary buffer. I couldn't find much documentation nor examples, but it is mentioned at https://orgmode.org/manual/Extracting-Source-Code.html#Hooks-3 --Diego On Fri, Jan 1, 2021

Re: ist here a :post header arg for tangling?

2021-01-01 Thread Immanuel Litzroth
I don't think there is an arg for that. I have written a tangler that reuses a lot of the org-babel machinery and has a more flexible mechanism to decide what to do with the tangled code -- I use it for example to not write a tangled file if it hasn't changed, meaning that it will not trigger

ist here a :post header arg for tangling?

2020-12-31 Thread George Mauer
I'd like to run some code to post-process files after they are tangled. Is there a header-arg for that?