From 2e24b634275c61ab913851b11d8b8f053f0f88f0 Mon Sep 17 00:00:00 2001 Message-ID: <2e24b634275c61ab913851b11d8b8f053f0f88f0.1716030861.git.yantar92@posteo.net> 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 8d921f11e..bec8a87a4 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -7365,6 +7365,7 @@ (defvar org-markers-to-move nil 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 @@ -7374,6 +7375,7 @@ (defun org-save-markers-in-region (beg end) 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) -- 2.45.1