changeset 25177:0ac130f2181a

(outline-previous-heading): New function. (outline-up-heading-all): Use outline-previous-heading. (outline-next-heading): Delete definition inserted yesterday.
author Richard M. Stallman <rms@gnu.org>
date Thu, 05 Aug 1999 14:50:30 +0000
parents 51eb4568f70b
children 1dc57e616e8d
files lisp/textmodes/outline.el
diffstat 1 files changed, 8 insertions(+), 22 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/textmodes/outline.el	Wed Aug 04 22:55:56 1999 +0000
+++ b/lisp/textmodes/outline.el	Thu Aug 05 14:50:30 1999 +0000
@@ -330,6 +330,12 @@
 			 nil 'move)
       (goto-char (1+ (match-beginning 0)))))
 
+(defun outline-previous-heading ()
+  "Move to the previous (possibly invisible) heading line."
+  (interactive)
+  (re-search-backward (concat "^\\(" outline-regexp "\\)")
+		      nil 'move))
+
 (defsubst outline-visible ()
   "Non-nil if the character after point is visible."
   (not (get-char-property (point) 'invisible)))
@@ -645,7 +651,7 @@
   (run-hooks 'outline-view-change-hook))
 
 (defun outline-up-heading-all (arg)
-  "Move to the heading line  of which the present line is a subheading.
+  "Move to the heading line of which the present line is a subheading.
 This function considers both visible and invisible heading lines.
 With argument, move up ARG levels."
   (outline-back-to-heading t)
@@ -657,29 +663,9 @@
     (let ((present-level (funcall outline-level)))
       (while (and (not (< (funcall outline-level) present-level))
 		  (not (bobp)))
-	(outline-next-heading -1))
+	(outline-previous-heading))
       (setq arg (- arg 1)))))
 
-(defun outline-next-heading (arg)
-  "Move to the next heading line (visible or invisible).
-With argument, repeats or can move backward if negative.
-A heading line is one that starts with a `*' (or that
-`outline-regexp' matches)."
-  (if (< arg 0)
-      (beginning-of-line)
-    (end-of-line))
-  (while (and (not (bobp)) (< arg 0))
-    (while (and (not (bobp))
-		(re-search-backward (concat "^\\(" outline-regexp "\\)")
-				    nil 'move)))
-    (setq arg (1+ arg)))
-  (while (and (not (eobp)) (> arg 0))
-    (while (and (not (eobp))
-		(re-search-forward (concat "^\\(" outline-regexp "\\)")
-				   nil 'move)))
-    (setq arg (1- arg)))
-  (beginning-of-line))
-
 (defun outline-up-heading (arg)
   "Move to the visible heading line of which the present line is a subheading.
 With argument, move up ARG levels."