diff options
| author | Richard M. Stallman | 1994-05-04 05:48:53 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1994-05-04 05:48:53 +0000 |
| commit | 6f3c2ad9789bf9c43d2a9fcb8e47e02f1469b3f0 (patch) | |
| tree | a55f51ecd7c616f86630d3ebb3cc9b9da5901b73 | |
| parent | d541babe36ee50d364a62a477f178553625c6586 (diff) | |
| download | emacs-6f3c2ad9789bf9c43d2a9fcb8e47e02f1469b3f0.tar.gz emacs-6f3c2ad9789bf9c43d2a9fcb8e47e02f1469b3f0.zip | |
(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'.
| -rw-r--r-- | lisp/textmodes/ooutline.el | 25 |
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." | |||
| 372 | (setq levels (1- levels)) | 372 | (setq levels (1- levels)) |
| 373 | (save-excursion | 373 | (save-excursion |
| 374 | (goto-char (point-min)) | 374 | (goto-char (point-min)) |
| 375 | (condition-case nil | 375 | ;; Keep advancing to the next top-level heading. |
| 376 | ;; Keep advancing to the next top-level heading. | 376 | (while (or (and (bobp) (outline-on-heading-p)) |
| 377 | (while (progn (or (and (bobp) (outline-on-heading-p)) | 377 | (outline-next-heading)) |
| 378 | (outline-next-heading)) | 378 | (let ((end (save-excursion (outline-end-of-subtree) (point)))) |
| 379 | (not (eobp))) | 379 | ;; Hide everything under that. |
| 380 | (setq first nil) | 380 | (outline-flag-region (point) end ?\^M) |
| 381 | (let ((end (save-excursion (outline-end-of-subtree) (point)))) | 381 | ;; Show the first LEVELS levels under that. |
| 382 | ;; Hide everything under that. | 382 | (if (> levels 1) |
| 383 | (outline-flag-region (point) end ?\^M) | 383 | (show-children levels)) |
| 384 | ;; Show the first LEVELS levels under that. | 384 | ;; Move to the next, since we already found it. |
| 385 | (show-children levels) | 385 | (goto-char end))))) |
| 386 | ;; Move to the next, since we already found it. | ||
| 387 | (goto-char end))) | ||
| 388 | (error nil)))) | ||
| 389 | 386 | ||
| 390 | (defun hide-other () | 387 | (defun hide-other () |
| 391 | "Hide everything except for the current body and the parent headings." | 388 | "Hide everything except for the current body and the parent headings." |