aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/textmodes/outline.el6
1 files changed, 4 insertions, 2 deletions
diff --git a/lisp/textmodes/outline.el b/lisp/textmodes/outline.el
index e3bff3a174e..696e2eb9466 100644
--- a/lisp/textmodes/outline.el
+++ b/lisp/textmodes/outline.el
@@ -326,9 +326,11 @@ at the end of the buffer."
326(defun outline-next-heading () 326(defun outline-next-heading ()
327 "Move to the next (possibly invisible) heading line." 327 "Move to the next (possibly invisible) heading line."
328 (interactive) 328 (interactive)
329 (if (re-search-forward (concat "\n\\(?:" outline-regexp "\\)") 329 ;; Make sure we don't match the heading we're at.
330 (if (and (bolp) (not (eobp))) (forward-char 1))
331 (if (re-search-forward (concat "^\\(?:" outline-regexp "\\)")
330 nil 'move) 332 nil 'move)
331 (goto-char (1+ (match-beginning 0))))) 333 (goto-char (match-beginning 0))))
332 334
333(defun outline-previous-heading () 335(defun outline-previous-heading ()
334 "Move to the previous (possibly invisible) heading line." 336 "Move to the previous (possibly invisible) heading line."