From 8decb653ffd8b046ffcccb5e9aa2e8a820ce6ab0 Mon Sep 17 00:00:00 2001 From: James Cherti Date: Mon, 27 Apr 2026 11:14:56 -0400 Subject: [PATCH] Fix outline-end-of-subtree at end of buffer When a subtree is at the end of the buffer and followed by a newline, flagging the subtree as invisible incorrectly swallows the final newline. * lisp/outline.el (outline-end-of-subtree): Check for eobp to ensure the function steps back over the final newline when the subtree ends at the end of the buffer (bug#80917). --- lisp/outline.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/outline.el b/lisp/outline.el index 250723f4b77..79bb8982e4e 100644 --- a/lisp/outline.el +++ b/lisp/outline.el @@ -1374,7 +1374,7 @@ This also unhides the top heading-less body, if any." (or first (> (funcall outline-level) level))) (setq first nil) (outline-next-heading)) - (if (and (bolp) (not (eolp))) + (if (or (eobp) (and (bolp) (not (eolp)))) ;; We stopped at a nonempty line (the next heading). (outline--end-of-previous))))