Hi Nicolas,

> Here it is. If you =detangle= the =broken-detangle--working.el= file, it
> will work as expected.
>
> However, if you try to detangle the =broken-detangle--NOT-working.el= file,
> you should get a "Not in a source block" error in *message*.

This is fixed in "master".

That is great! Working perfectly no, thanks!

 
> Another thing I noted while creating the ECM is if there is only *one* code
> block in the =.org= file, then it throws a =End of Buffer= error.

I couldn't reproduce this. If the fix below doesn't solve it, could you
provide a dedicated ECM?

Yes, that fixed it as well.



There is one last thing related to =org-babel-detangle= that seems "broken" is that as far as I can see, the top =save-excursion= should save the position of the cursor of the source file and keep the buffer at that position when we perform a detangling on it, no?

Right now, the behavior is that when we do a detangle from a source file, the org file get opened in the buffer of the source file.

However, I think that the right behavior is that when we detangle that the remain at the same position in the source file otherwise this gets confusing in my opinion.

Is that a bug or the expected behavior?

Thanks!

Take care

Fred