emacs-orgmode
[Top][All Lists]
Advanced

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

Re: behavior of (org-insert-heading-respect-content)


From: Marco Wahl
Subject: Re: behavior of (org-insert-heading-respect-content)
Date: Sat, 18 Sep 2021 15:08:58 +0200
User-agent: Gnus/5.13 (Gnus v5.13)

Victor!

> Le 13 Sep 2021, Marco Wahl <marcowahlsoft@gmail.com> a écrit :
>
>> As far is I see it, the intended behavior of
>> org-insert-heading-respect-content with point before the first heading
>> is to
>>
>> - insert the new heading immediately before the first heading.  Respect
>>   the content!
> Hi Marco !
>
> I agree with you. But this does not work. Say I have a buffer with this 
> content :
>
> put point HERE and C-<return>
> Some more stuff 
> * Heading
> content
>
>
> When point is at HERE and I C-<return>, org inserts a new asterisk on
> the after "stuff", but  on the same line → not a proper heading.
>>
>> - If there is no heading at all in the file the heading shall be
>>   inserted at the bottom of the file.
>
> Yes. But I get the same behavior with 
>
> put point HERE and C-<return>
> Some more stuff 
>
> The asterisk is inserted right after "stuff", on the same line → not
> a proper heading.
>
>>
>> Do we agree on the desired behavior of
>> org-insert-heading-respect-content?
>
> Yes, we do!
>>
>> With your proposition the respect for the content gets lost,
>> doesn't it?
>
> Yes, you’re right. It currently does not respect the content before
> first heading. Therefore it’s not a fix for the behavior of
> org-insert-heading-respect-content.
> It’s just the quickest workaround I’ve come up with to make my own
> function work (in my use-case, when I call that function, either point
> is at point-min in a brand new buffer, or point is below the first
> heading).

Okay, thanks for clarifying.

Would be great if you could test the fix.


Thank you!



reply via email to

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