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

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

[elpa] externals/org 67ce9386ad 2/3: lisp/org.el (org-sort-entries): Fix


From: ELPA Syncer
Subject: [elpa] externals/org 67ce9386ad 2/3: lisp/org.el (org-sort-entries): Fix when end of region is not a bol
Date: Sun, 17 Dec 2023 09:58:17 -0500 (EST)

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

    lisp/org.el (org-sort-entries): Fix when end of region is not a bol
    
    * lisp/org.el (org-sort-entries): Avoid putting a heading not at bol
    when end of selected region is not at bol.
    
    Reported-by: Zelphir Kaltstahl <zelphirkaltstahl@posteo.de>
    Link: 
https://orgmode.org/list/8d637a8a-6cbc-4158-bded-f9182716a1fc@posteo.de
---
 lisp/org.el | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/lisp/org.el b/lisp/org.el
index 695721997e..f3679dd9b6 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -7778,6 +7778,12 @@ function is being called interactively."
 
     (save-restriction
       (narrow-to-region start end)
+      ;; No trailing newline - add one to avoid
+      ;; * heading
+      ;; text* another heading
+      (save-excursion
+        (goto-char end)
+        (unless (bolp) (insert "\n")))
       (let ((restore-clock?
             ;; The clock marker is lost when using `sort-subr'; mark
             ;; the clock with temporary `:org-clock-marker-backup'



reply via email to

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