emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] auto hiding src blocks upon toggling headers


From: Instructor account
Subject: Re: [O] auto hiding src blocks upon toggling headers
Date: Wed, 08 Oct 2014 14:27:23 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (darwin)

Adriaan Sticker <address@hidden> writes:

This is not perfect but it seems close:

#+BEGIN_SRC emacs-lisp
(defun my-hide (state)
  (message "%s" state)
  (if (or (eq state 'children)
          (eq state 'subtree))
      (save-restriction
        (org-narrow-to-subtree)
        (org-hide-block-all))))

(add-hook 'org-cycle-hook 'my-hide)
#+END_SRC




> Hi all
>
> Is there a way to automatically hide a source block when toggling the
> fold status of the parent header.
>
> Currently the hide status is remembered when folding its parent
> headers but this turned out not to be to practical in my current
> workflow.
>
> Greetings
>

-- 
-----------------------------------
John Kitchin
Professor
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
http://kitchingroup.cheme.cmu.edu



reply via email to

[Prev in Thread] Current Thread [Next in Thread]