emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[elpa] externals/org 6f742685d7 1/3: org-metaup: Fix edge case when the


From: ELPA Syncer
Subject: [elpa] externals/org 6f742685d7 1/3: org-metaup: Fix edge case when the upper subtree is moved further below
Date: Sun, 2 Apr 2023 10:58:42 -0400 (EDT)

branch: externals/org
commit 6f742685d78acfd6aa65516e091d08a8da68821d
Author: Ihor Radchenko <yantar92@posteo.net>
Commit: Ihor Radchenko <yantar92@posteo.net>

    org-metaup: Fix edge case when the upper subtree is moved further below
    
    * lisp/org.el (org-metaup): Work around `org-move-subtree-down'
    inserting before end marker.
    
    Reported-by: Philipp Kiefer <phil.kiefer@gmail.com>
    Link: 
https://orgmode.org/list/2248cb94-e400-08c7-b76b-bbae2d877ca7@gmail.com
---
 lisp/org.el | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lisp/org.el b/lisp/org.el
index 10ade32dda..c6a4702ff8 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -16920,7 +16920,9 @@ for more information."
     (let ((beg (region-beginning))
           (end (region-end)))
       (save-excursion
-        (goto-char end)
+        ;; Go a little earlier because `org-move-subtree-down' will
+        ;; insert before markers and we may overshoot in some cases.
+        (goto-char (max beg (1- end)))
         (setq end (point-marker))
         (goto-char beg)
         (let ((level (org-current-level)))



reply via email to

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