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

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

[elpa] externals-release/org 1b4ffe868e: lisp/org.el (org-insert-subhead


From: ELPA Syncer
Subject: [elpa] externals-release/org 1b4ffe868e: lisp/org.el (org-insert-subheading): Fix error when at `point-max'
Date: Fri, 12 Jul 2024 09:59:16 -0400 (EDT)

branch: externals-release/org
commit 1b4ffe868eed3eadb6a5170f3f6bdf3b8adc4c95
Author: Ihor Radchenko <yantar92@posteo.net>
Commit: Ihor Radchenko <yantar92@posteo.net>

    lisp/org.el (org-insert-subheading): Fix error when at `point-max'
    
    * lisp/org.el (org-insert-subheading): Make sure that `forward-char'
    never happens at the end of buffer.  Also, only move char when we are
    at actual heading/item - that's the only case when we need to adjust
    point position to avoid `org-insert-heading' inserting above.
---
 lisp/org.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/org.el b/lisp/org.el
index 5967ab27e7..5cf26ef07f 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -6698,7 +6698,7 @@ The prefix argument ARG is passed to `org-insert-heading'.
 Unlike `org-insert-heading', when point is at the beginning of a
 heading, still insert the new sub-heading below."
   (interactive "P")
-  (when (bolp) (forward-char))
+  (when (and (bolp) (not (eobp)) (not (eolp))) (forward-char))
   (org-insert-heading arg)
   (cond
    ((org-at-heading-p) (org-do-demote))



reply via email to

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