# HG changeset patch # User Richard M. Stallman # Date 768030533 0 # Node ID 102e78c0fb9a01f1cef576436f9046d2f76cb51e # Parent b4ef2060b17144bc64a2e2c6219f954f70bef282 (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'. diff -r b4ef2060b171 -r 102e78c0fb9a lisp/textmodes/ooutline.el --- a/lisp/textmodes/ooutline.el Wed May 04 05:15:26 1994 +0000 +++ b/lisp/textmodes/ooutline.el Wed May 04 05:48:53 1994 +0000 @@ -372,20 +372,17 @@ (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."