diff options
| author | Richard M. Stallman | 1999-08-05 14:50:30 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1999-08-05 14:50:30 +0000 |
| commit | fd702fdb11193ecda62f3264004d44ffd45b2b76 (patch) | |
| tree | dc8f390fbb71c5d67ffb0966f4aec002ea41a236 | |
| parent | 94662de752a38c2a029e7e89afed3537b54588e5 (diff) | |
| download | emacs-fd702fdb11193ecda62f3264004d44ffd45b2b76.tar.gz emacs-fd702fdb11193ecda62f3264004d44ffd45b2b76.zip | |
(outline-previous-heading): New function.
(outline-up-heading-all): Use outline-previous-heading.
(outline-next-heading): Delete definition inserted yesterday.
| -rw-r--r-- | lisp/textmodes/outline.el | 30 |
1 files changed, 8 insertions, 22 deletions
diff --git a/lisp/textmodes/outline.el b/lisp/textmodes/outline.el index b68d34f8d7b..147a5098000 100644 --- a/lisp/textmodes/outline.el +++ b/lisp/textmodes/outline.el | |||
| @@ -330,6 +330,12 @@ at the end of the buffer." | |||
| 330 | nil 'move) | 330 | nil 'move) |
| 331 | (goto-char (1+ (match-beginning 0))))) | 331 | (goto-char (1+ (match-beginning 0))))) |
| 332 | 332 | ||
| 333 | (defun outline-previous-heading () | ||
| 334 | "Move to the previous (possibly invisible) heading line." | ||
| 335 | (interactive) | ||
| 336 | (re-search-backward (concat "^\\(" outline-regexp "\\)") | ||
| 337 | nil 'move)) | ||
| 338 | |||
| 333 | (defsubst outline-visible () | 339 | (defsubst outline-visible () |
| 334 | "Non-nil if the character after point is visible." | 340 | "Non-nil if the character after point is visible." |
| 335 | (not (get-char-property (point) 'invisible))) | 341 | (not (get-char-property (point) 'invisible))) |
| @@ -645,7 +651,7 @@ Default is enough to cause the following heading to appear." | |||
| 645 | (run-hooks 'outline-view-change-hook)) | 651 | (run-hooks 'outline-view-change-hook)) |
| 646 | 652 | ||
| 647 | (defun outline-up-heading-all (arg) | 653 | (defun outline-up-heading-all (arg) |
| 648 | "Move to the heading line of which the present line is a subheading. | 654 | "Move to the heading line of which the present line is a subheading. |
| 649 | This function considers both visible and invisible heading lines. | 655 | This function considers both visible and invisible heading lines. |
| 650 | With argument, move up ARG levels." | 656 | With argument, move up ARG levels." |
| 651 | (outline-back-to-heading t) | 657 | (outline-back-to-heading t) |
| @@ -657,29 +663,9 @@ With argument, move up ARG levels." | |||
| 657 | (let ((present-level (funcall outline-level))) | 663 | (let ((present-level (funcall outline-level))) |
| 658 | (while (and (not (< (funcall outline-level) present-level)) | 664 | (while (and (not (< (funcall outline-level) present-level)) |
| 659 | (not (bobp))) | 665 | (not (bobp))) |
| 660 | (outline-next-heading -1)) | 666 | (outline-previous-heading)) |
| 661 | (setq arg (- arg 1))))) | 667 | (setq arg (- arg 1))))) |
| 662 | 668 | ||
| 663 | (defun outline-next-heading (arg) | ||
| 664 | "Move to the next heading line (visible or invisible). | ||
| 665 | With argument, repeats or can move backward if negative. | ||
| 666 | A heading line is one that starts with a `*' (or that | ||
| 667 | `outline-regexp' matches)." | ||
| 668 | (if (< arg 0) | ||
| 669 | (beginning-of-line) | ||
| 670 | (end-of-line)) | ||
| 671 | (while (and (not (bobp)) (< arg 0)) | ||
| 672 | (while (and (not (bobp)) | ||
| 673 | (re-search-backward (concat "^\\(" outline-regexp "\\)") | ||
| 674 | nil 'move))) | ||
| 675 | (setq arg (1+ arg))) | ||
| 676 | (while (and (not (eobp)) (> arg 0)) | ||
| 677 | (while (and (not (eobp)) | ||
| 678 | (re-search-forward (concat "^\\(" outline-regexp "\\)") | ||
| 679 | nil 'move))) | ||
| 680 | (setq arg (1- arg))) | ||
| 681 | (beginning-of-line)) | ||
| 682 | |||
| 683 | (defun outline-up-heading (arg) | 669 | (defun outline-up-heading (arg) |
| 684 | "Move to the visible heading line of which the present line is a subheading. | 670 | "Move to the visible heading line of which the present line is a subheading. |
| 685 | With argument, move up ARG levels." | 671 | With argument, move up ARG levels." |