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

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

[elpa] externals/org-transclusion 4628e81909 05/18: refactor: Simplify o


From: ELPA Syncer
Subject: [elpa] externals/org-transclusion 4628e81909 05/18: refactor: Simplify org-transclusion-search-or-add-next-empty-line
Date: Sun, 21 Jan 2024 15:58:42 -0500 (EST)

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

    refactor: Simplify org-transclusion-search-or-add-next-empty-line
---
 org-transclusion.el | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/org-transclusion.el b/org-transclusion.el
index 9015a851ee..d08466425a 100644
--- a/org-transclusion.el
+++ b/org-transclusion.el
@@ -1298,12 +1298,11 @@ changes, the logic in this function will need to 
reviewed."
   "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."
-  ;; beginning-of-line 2 moves to the next line if possible
-  (beginning-of-line 2)
-  (if (eobp)(insert "\n")
-    (while (not (looking-at-p "[ \t]*$"))
-      (beginning-of-line 2))
-    (if (eobp)(insert "\n"))))
+  (forward-line)
+  (while (not (looking-at-p "^[ \t]*$"))
+    (if (eobp)
+        (insert "\n")
+      (forward-line))))
 
 (defun org-transclusion-wrap-path-to-link (path)
   "Return Org link object for PATH string."



reply via email to

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