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*.

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.



On Sat, Jun 2, 2018 at 6:17 AM, Nicolas Goaziou <mail@nicolasgoaziou.fr> wrote:
Hello,

Frederick Giasson <fred@curbside.com> writes:

> It appears that org-detangle is broken. I am using spacemacs, but even with
> a vanilla Emacs (emacs -Q) it appears to be broken.
>
> When I tangle a file with =:comments link= every things works as expected
> and the comments are added in the tangled file.
>
> When I just detangle that tangled file, everything get detangled as
> expected.
>
> If I change one or two lines, it normally works as expected.
>
> If I change more than 4 lines, I always get the error message "Not in a
> block file".
>
> Some debugging shows that the function =org-element-at-point= sometimes tag
> the element as =paragraph= instead of =src-block=, like if it doesn't know
> where it is... somehow.
>
> Does anybody use that function without experiencing this (apparent major)
> issue?

Could you provide an ECM demonstrating the issue?

Thank you.

Regards,

--
Nicolas Goaziou