Hi Nicolas, Nicolas Goaziou <n.goaz...@gmail.com> writes:
>> Confirmed -- I quickly looked, it seems that `org-in-item-p' should do >> a better job when preceeded by invisible text. > > I need to rewrite this function. > > Anyway, I'm not sure what you mean in your last sentence because, as > a low-level function, its results shouldn't be affected by folding > status of the document (I didn't follow the thread closely, though, and > could be off tracks). The problem is this one: * Folded subtree... ^-{ Point here then M-x org-insert-heading RET will *not* insert a heading if the folded subtree is ending with a list, because `org-in-item-p' will infer point is within a list. So maybe `org-insert-heading' should be fixed instead, as a higher level function, ignoring the folded content before the point? -- Bastien