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

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

[elpa] externals/org-transclusion 3f461e3624 06/18: chg: Don't move past


From: ELPA Syncer
Subject: [elpa] externals/org-transclusion 3f461e3624 06/18: chg: Don't move past org headings when adding transclusion links
Date: Sun, 21 Jan 2024 15:58:42 -0500 (EST)

branch: externals/org-transclusion
commit 3f461e3624020021ff929b9c2e9aac636c95d8d0
Author: Joseph Turner <joseph@breatheoutbreathe.in>
Commit: Joseph Turner <joseph@breatheoutbreathe.in>

    chg: Don't move past org headings when adding transclusion links
---
 org-transclusion.el | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/org-transclusion.el b/org-transclusion.el
index d08466425a..6c0845322a 100644
--- a/org-transclusion.el
+++ b/org-transclusion.el
@@ -1295,13 +1295,14 @@ changes, the logic in this function will need to 
reviewed."
     m))
 
 (defun org-transclusion-search-or-add-next-empty-line ()
-  "Search the next empty line.
-Start with the next line.  If the current line is the bottom of
-the line, add a new empty line."
+  "Move point to the next empty line.
+If no empty line exists before the next org heading or the end of
+the buffer, stop there and add a newline."
   (forward-line)
   (while (not (looking-at-p "^[ \t]*$"))
-    (if (eobp)
-        (insert "\n")
+    (if (or (org-at-heading-p) (eobp))
+        (progn (insert "\n")
+               (backward-char))
       (forward-line))))
 
 (defun org-transclusion-wrap-path-to-link (path)



reply via email to

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