From: Richard M. Stallman Date: Sat, 5 Feb 1994 01:33:12 +0000 (+0000) Subject: (outline-end-of-subtree): If loop leaves us at eob, X-Git-Tag: emacs-19.34~10065 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=9d721a9e79c5dfd2807dca9a310dffcb6f5103ae;p=emacs.git (outline-end-of-subtree): If loop leaves us at eob, don't move back from there. --- diff --git a/lisp/textmodes/ooutline.el b/lisp/textmodes/ooutline.el index b9e9dd3524d..efd49c9f41a 100644 --- a/lisp/textmodes/ooutline.el +++ b/lisp/textmodes/ooutline.el @@ -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))))) (defun show-branches () "Show all subheadings of this heading, but not their bodies."