(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)