diff options
| author | Stefan Monnier | 2002-10-25 15:30:20 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2002-10-25 15:30:20 +0000 |
| commit | baaec43f3d30175df2183aca2a5965d0303cbbee (patch) | |
| tree | 9cbc3393c426c713c390db833b95b7d0f6851fdc | |
| parent | 869331eef11afdb3fb68ecc62185ecbbea4c744f (diff) | |
| download | emacs-baaec43f3d30175df2183aca2a5965d0303cbbee.tar.gz emacs-baaec43f3d30175df2183aca2a5965d0303cbbee.zip | |
(outline-next-heading): Make sure the match-data is correct where returning.
| -rw-r--r-- | lisp/textmodes/outline.el | 6 |
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." |