# HG changeset patch # User Richard M. Stallman # Date 806123943 0 # Node ID 140e46e751a09adfe00621fd869b0767f845f80e # Parent 6d033c8501d415a33dec3999391759d54a883251 (outline-next-visible-heading): Rewritten to handle backwards motion and handle beg/end of buffer properly. diff -r 6d033c8501d4 -r 140e46e751a0 lisp/textmodes/outline.el --- a/lisp/textmodes/outline.el Tue Jul 18 23:59:23 1995 +0000 +++ b/lisp/textmodes/outline.el Wed Jul 19 03:19:03 1995 +0000 @@ -331,16 +331,18 @@ (if (< arg 0) (beginning-of-line) (end-of-line)) - (let (found) - (or (while (and found (> arg 0)) - (setq found nil) - (while (not found) - (setq found - (and (re-search-backward (concat "^\\(" outline-regexp "\\)") - nil t) - (outline-visible)))) - (setq arg (1- arg))) - (error ""))) + (while (and (not (bobp)) (< arg 0)) + (while (and (not (bobp)) + (re-search-backward (concat "^\\(" outline-regexp "\\)") + nil 'move) + (not (outline-visible)))) + (setq arg (1+ arg))) + (while (and (not (eobp)) (> arg 0)) + (while (and (not (eobp)) + (re-search-forward (concat "^\\(" outline-regexp "\\)") + nil 'move) + (not (outline-visible)))) + (setq arg (1- arg))) (beginning-of-line)) (defun outline-previous-visible-heading (arg)