changeset 48001:4e7ef1c1f0dd

(outline-next-heading): Make sure the match-data is correct where returning.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Fri, 25 Oct 2002 15:30:20 +0000
parents 5144fabfb105
children d58423d8f9ce
files lisp/textmodes/outline.el
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/textmodes/outline.el	Fri Oct 25 12:32:18 2002 +0000
+++ b/lisp/textmodes/outline.el	Fri Oct 25 15:30:20 2002 +0000
@@ -326,9 +326,11 @@
 (defun outline-next-heading ()
   "Move to the next (possibly invisible) heading line."
   (interactive)
-  (if (re-search-forward (concat "\n\\(?:" outline-regexp "\\)")
+  ;; Make sure we don't match the heading we're at.
+  (if (and (bolp) (not (eobp))) (forward-char 1))
+  (if (re-search-forward (concat "^\\(?:" outline-regexp "\\)")
 			 nil 'move)
-      (goto-char (1+ (match-beginning 0)))))
+      (goto-char (match-beginning 0))))
 
 (defun outline-previous-heading ()
   "Move to the previous (possibly invisible) heading line."