From 5fcd1d9deff6e84fe4ff84c7f1fd48beba9474fc Mon Sep 17 00:00:00 2001 From: Ihor Radchenko Date: Sat, 18 May 2024 13:12:50 +0200 Subject: [PATCH] org-save-markers-in-region: Store log note marker * lisp/org.el (org-save-markers-in-region): Store `org-log-note-marker' when storing and reinstalling Org markers. This change automatically handles note taken after refiling/archiving without trying to place the note in place of the moved subtree/heading. Link: https://orgmode.org/list/m2plyjid8q.fsf@kyon.home --- lisp/org.el | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lisp/org.el b/lisp/org.el index b545e6bf6..ed18565bd 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -7371,6 +7371,7 @@ If optional TXT is given, check this string instead of the current kill." Those markers are stored together with their positions relative to the start of the region.") +(defvar org-log-note-marker) ; defined later (defun org-save-markers-in-region (beg end) "Check markers in region. If these markers are between BEG and END, record their position relative @@ -7380,6 +7381,7 @@ This function gets called just before an entry or tree gets cut from the buffer. After re-insertion, `org-reinstall-markers-in-region' must be called immediately, to move the markers with the entries." (setq org-markers-to-move nil) + (org-check-and-save-marker org-log-note-marker beg end) (when (featurep 'org-clock) (org-clock-save-markers-for-cut-and-paste beg end)) (when (featurep 'org-agenda)