]> git.eshelyaron.com Git - emacs.git/commitdiff
(outline-end-of-subtree): If loop leaves us at eob,
authorRichard M. Stallman <rms@gnu.org>
Sat, 5 Feb 1994 01:33:12 +0000 (01:33 +0000)
committerRichard M. Stallman <rms@gnu.org>
Sat, 5 Feb 1994 01:33:12 +0000 (01:33 +0000)
don't move back from there.

lisp/textmodes/ooutline.el

index b9e9dd3524dcfdcd400d9b7b8741c294ad41ad4e..efd49c9f41acae483b8cd1f567f66f6a282b2dbe 100644 (file)
@@ -352,9 +352,13 @@ while if FLAG is `\\^M' (control-M) the text is hidden."
                (or first (> (funcall outline-level) level)))
       (setq first nil)
       (outline-next-heading))
-    (forward-char -1)
-    (if (memq (preceding-char) '(?\n ?\^M))
-       (forward-char -1))))
+    (if (eobp)
+       nil
+      ;; go to end of line before heading
+      (forward-char -1)
+      ;; skip preceding balnk line, if there is one
+      (if (memq (preceding-char) '(?\n ?\^M))
+         (forward-char -1)))))
 \f
 (defun show-branches ()
   "Show all subheadings of this heading, but not their bodies."