From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Kitchin Subject: Re: auto hiding src blocks upon toggling headers Date: Wed, 08 Oct 2014 19:33:20 -0400 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:37234) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xc0jd-0001M6-5p for emacs-orgmode@gnu.org; Wed, 08 Oct 2014 19:33:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xc0jX-0007sQ-C1 for emacs-orgmode@gnu.org; Wed, 08 Oct 2014 19:33:33 -0400 Received: from mail-qc0-x22f.google.com ([2607:f8b0:400d:c01::22f]:41542) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xc0jX-0007sH-6R for emacs-orgmode@gnu.org; Wed, 08 Oct 2014 19:33:27 -0400 Received: by mail-qc0-f175.google.com with SMTP id x13so115856qcv.20 for ; Wed, 08 Oct 2014 16:33:25 -0700 (PDT) In-Reply-To: (Instructor account's message of "Wed, 08 Oct 2014 14:27:23 -0400") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Instructor account Cc: "emacs-orgmode@gnu.org" , Adriaan Sticker Sorry for the weird from email below. This was from me. I have a separate email setup in Emacs for a class I am teaching. Instructor account writes: > Adriaan Sticker 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