From 753f4e2723c493274d9e55c195296fe5d0b5773e Mon Sep 17 00:00:00 2001 From: Philip Date: Tue, 18 Aug 2015 20:24:13 +0000 Subject: [PATCH] Avoid error when first line of the buffer isn't a heading. * outshine.el (outline-hide-sublevels): Avoid error for files that don't begin with a heading. (outline-cycle): Avoid error for files that don't begin with a heading. --- outshine.el | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/outshine.el b/outshine.el index 9ccbd1f..aba5271 100644 --- a/outshine.el +++ b/outshine.el @@ -1826,8 +1826,9 @@ The old value is stored in (setq keep-levels (1- keep-levels)) (save-excursion (goto-char (point-min)) - (hide-subtree) - (show-children keep-levels) + (when (outline-on-heading-p) + (hide-subtree) + (show-children keep-levels)) (condition-case err (while (outline-get-next-sibling) (hide-subtree) @@ -2048,7 +2049,8 @@ may have changed." (message "SUBTREE"))) (t ;; Default action: hide the subtree. - (hide-subtree) + (when (outline-on-heading-p) + (hide-subtree)) (unless outshine-cycle-silently (message "FOLDED")))))) -- 2.5.0