summaryrefslogtreecommitdiff
path: root/lisp/textmodes/ooutline.el
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1994-05-04 05:48:53 +0000
committerRichard M. Stallman <rms@gnu.org>1994-05-04 05:48:53 +0000
commit5de6ca2586f2c8c848b9f8d606046932ec08a9df (patch)
treeac5629c77c66a9555ad0fd6825d8eecc912ce471 /lisp/textmodes/ooutline.el
parent42a8a7d67afb79e68f8bd80ac9b4e4b2c0f6ed7b (diff)
downloademacs-5de6ca2586f2c8c848b9f8d606046932ec08a9df.tar.gz
(hide-sublevels): No need for condition-case.
Don't call show-children if levels is 0. No need to check eob in while condition. Delete spurious setq of `first'.
Diffstat (limited to 'lisp/textmodes/ooutline.el')
-rw-r--r--lisp/textmodes/ooutline.el25
1 files changed, 11 insertions, 14 deletions
diff --git a/lisp/textmodes/ooutline.el b/lisp/textmodes/ooutline.el
index 618507ae25d..9709fc0d309 100644
--- a/lisp/textmodes/ooutline.el
+++ b/lisp/textmodes/ooutline.el
@@ -372,20 +372,17 @@ while if FLAG is `\\^M' (control-M) the text is hidden."
(setq levels (1- levels))
(save-excursion
(goto-char (point-min))
- (condition-case nil
- ;; Keep advancing to the next top-level heading.
- (while (progn (or (and (bobp) (outline-on-heading-p))
- (outline-next-heading))
- (not (eobp)))
- (setq first nil)
- (let ((end (save-excursion (outline-end-of-subtree) (point))))
- ;; Hide everything under that.
- (outline-flag-region (point) end ?\^M)
- ;; Show the first LEVELS levels under that.
- (show-children levels)
- ;; Move to the next, since we already found it.
- (goto-char end)))
- (error nil))))
+ ;; Keep advancing to the next top-level heading.
+ (while (or (and (bobp) (outline-on-heading-p))
+ (outline-next-heading))
+ (let ((end (save-excursion (outline-end-of-subtree) (point))))
+ ;; Hide everything under that.
+ (outline-flag-region (point) end ?\^M)
+ ;; Show the first LEVELS levels under that.
+ (if (> levels 1)
+ (show-children levels))
+ ;; Move to the next, since we already found it.
+ (goto-char end)))))
(defun hide-other ()
"Hide everything except for the current body and the parent headings."