diff options
| author | Eli Zaretskii | 2006-12-22 22:57:15 +0000 |
|---|---|---|
| committer | Eli Zaretskii | 2006-12-22 22:57:15 +0000 |
| commit | cf27cc8311fea87cb0c4181b47e2cf88929a8de2 (patch) | |
| tree | 48474d02ce5ff57a6c701649a97d1a709eca15b2 | |
| parent | f321348b56a0318ab6062965ec4247c498474c0c (diff) | |
| download | emacs-cf27cc8311fea87cb0c4181b47e2cf88929a8de2.tar.gz emacs-cf27cc8311fea87cb0c4181b47e2cf88929a8de2.zip | |
(outline-next-visible-heading): Fix the case with a header at end-of-file
with no final newline.
| -rw-r--r-- | lisp/outline.el | 31 |
1 files changed, 18 insertions, 13 deletions
diff --git a/lisp/outline.el b/lisp/outline.el index b44fd288bfc..95594ebec9f 100644 --- a/lisp/outline.el +++ b/lisp/outline.el | |||
| @@ -652,19 +652,24 @@ A heading line is one that starts with a `*' (or that | |||
| 652 | (if (< arg 0) | 652 | (if (< arg 0) |
| 653 | (beginning-of-line) | 653 | (beginning-of-line) |
| 654 | (end-of-line)) | 654 | (end-of-line)) |
| 655 | (while (and (not (bobp)) (< arg 0)) | 655 | (let (found-heading-p) |
| 656 | (while (and (not (bobp)) | 656 | (while (and (not (bobp)) (< arg 0)) |
| 657 | (re-search-backward (concat "^\\(?:" outline-regexp "\\)") | 657 | (while (and (not (bobp)) |
| 658 | nil 'move) | 658 | (setq found-heading-p |
| 659 | (outline-invisible-p))) | 659 | (re-search-backward |
| 660 | (setq arg (1+ arg))) | 660 | (concat "^\\(?:" outline-regexp "\\)") |
| 661 | (while (and (not (eobp)) (> arg 0)) | 661 | nil 'move)) |
| 662 | (while (and (not (eobp)) | 662 | (outline-invisible-p))) |
| 663 | (re-search-forward (concat "^\\(?:" outline-regexp "\\)") | 663 | (setq arg (1+ arg))) |
| 664 | nil 'move) | 664 | (while (and (not (eobp)) (> arg 0)) |
| 665 | (outline-invisible-p (match-beginning 0)))) | 665 | (while (and (not (eobp)) |
| 666 | (setq arg (1- arg))) | 666 | (setq found-heading-p |
| 667 | (beginning-of-line)) | 667 | (re-search-forward |
| 668 | (concat "^\\(?:" outline-regexp "\\)") | ||
| 669 | nil 'move)) | ||
| 670 | (outline-invisible-p (match-beginning 0)))) | ||
| 671 | (setq arg (1- arg))) | ||
| 672 | (if found-heading-p (beginning-of-line)))) | ||
| 668 | 673 | ||
| 669 | (defun outline-previous-visible-heading (arg) | 674 | (defun outline-previous-visible-heading (arg) |
| 670 | "Move to the previous heading line. | 675 | "Move to the previous heading line. |