changeset 5786:730053369cab

(outline-end-of-subtree): If loop leaves us at eob, don't move back from there.
author Richard M. Stallman <rms@gnu.org>
date Sat, 05 Feb 1994 01:33:12 +0000
parents e761c2b18894
children bef3a67ac893
files lisp/textmodes/ooutline.el
diffstat 1 files changed, 7 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/textmodes/ooutline.el	Fri Feb 04 23:11:34 1994 +0000
+++ b/lisp/textmodes/ooutline.el	Sat Feb 05 01:33:12 1994 +0000
@@ -352,9 +352,13 @@
 		(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)))))
 
 (defun show-branches ()
   "Show all subheadings of this heading, but not their bodies."