[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: behavior of (org-insert-heading-respect-content)
From: |
Victor A. Stoichita |
Subject: |
Re: behavior of (org-insert-heading-respect-content) |
Date: |
Thu, 09 Sep 2021 21:29:05 +0200 |
Le 09 Sep 2021, Marco Wahl <marcowahlsoft@gmail.com> a écrit :
> My impression is that org-insert-heading-respect-content should be
> called only with point in a subtree.
>
> The fix would be to signal an error when point is not located in a
> subtree.
>
> Does this sound reasonable?
In a way, yes. I guess that the error would not appear too often.
But falling back gracefully to org-insert-heading could be even
better, especially when org-insert-heading-respect-content is called
from Lisp (rather than interactively).
For now, I use this and it seems to do the job:
#+begin_src elisp
(if (equal 1 (line-number-at-pos nil t))
(org-insert-heading)
(org-insert-heading-respect-content))
#+end_src
If I’m not mistaken, org-insert-heading-respect-content works as expected even
when point is not in a subtree. It seems to only fail if point is on the 1st
line.
Regards,
Victor
- behavior of (org-insert-heading-respect-content), Victor A. Stoichita, 2021/09/09
- Re: behavior of (org-insert-heading-respect-content), Marco Wahl, 2021/09/09
- Re: behavior of (org-insert-heading-respect-content),
Victor A. Stoichita <=
- Re: behavior of (org-insert-heading-respect-content), Marco Wahl, 2021/09/13
- Re: behavior of (org-insert-heading-respect-content), Victor A. Stoichita, 2021/09/17
- Re: behavior of (org-insert-heading-respect-content), Marco Wahl, 2021/09/18
- Re: behavior of (org-insert-heading-respect-content), Bastien, 2021/09/26
- Re: behavior of (org-insert-heading-respect-content), Marco Wahl, 2021/09/26
- Re: behavior of (org-insert-heading-respect-content), Bastien, 2021/09/26
- Re: behavior of (org-insert-heading-respect-content), Victor A. Stoichita, 2021/09/26