From bf330503aecb8e97341c3e3d4c2ff69bbb7bfed3 Mon Sep 17 00:00:00 2001 From: yuhan0 Date: Mon, 31 Dec 2018 23:49:27 +0800 Subject: [PATCH] Add numeric prefix argument to outshine-cycle-buffer From functionality of org-cycle-buffer --- outshine.el | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/outshine.el b/outshine.el index 5671a5b..1632e9b 100644 --- a/outshine.el +++ b/outshine.el @@ -1998,11 +1998,15 @@ Essentially a much simplified version of `next-line'." ;; Not at a headline: Do indent-relative (outline-back-to-heading)))))) -(defun outshine-cycle-buffer () - "Cycle the visibility state of buffer." - (interactive) +(defun outshine-cycle-buffer (&optional arg) + "Cycle the visibility state of buffer. +With a numeric prefix, show all headlines up to that level." + (interactive "P") (save-excursion (cond + ((integerp arg) + (outline-show-all) + (outline-hide-sublevels arg)) ((eq last-command 'outshine-cycle-overview) ;; We just created the overview - now do table of contents ;; This can be slow in very large buffers, so indicate action