[Top][All Lists]

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

Re: org-capture at point

From: No Wayman
Subject: Re: org-capture at point
Date: Fri, 02 Oct 2020 14:46:16 -0400
User-agent: mu4e 1.5.5; emacs 28.0.50

Looks like it was introduced with:

f5573e6a0 org-capture.el: Fix heading's level when inserting a
template "here"

I believe the issue is due to `org-back-to-heading' moving point when calculating the heading level.
The attached patch corrects the issue on my end.
Tested by running:

#+begin_src emacs-lisp :lexical t
(dotimes (n 3)
 (let ((org-capture-templates
        `(( "e" "test"
            (file "/temp/null.org")
            ,(format "* %d" n)
            :immediate-finish t
            :no-save t))))
   (goto-char (point-max))
   (org-capture 0 "e")))

With a buffer containing:

* foo
** one
*** two
**** three
*** four

Which results in:

* foo
** one
*** two
**** three
*** four
*** 0
*** 1
*** 2

Attachment: 0001-org-capture.el-Fix-heading-s-position-when-inserting.patch
Description: capture-here-position

reply via email to

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