From mboxrd@z Thu Jan 1 00:00:00 1970 From: Adriaan Sticker Subject: Re: auto hiding src blocks upon toggling headers Date: Thu, 9 Oct 2014 11:11:40 +0200 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=f46d044306a802a4430504f9d236 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:47698) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xc9l8-0000Se-JU for emacs-orgmode@gnu.org; Thu, 09 Oct 2014 05:11:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xc9l7-0004d3-9c for emacs-orgmode@gnu.org; Thu, 09 Oct 2014 05:11:42 -0400 Received: from mail-wg0-x22c.google.com ([2a00:1450:400c:c00::22c]:34578) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xc9l7-0004ck-2r for emacs-orgmode@gnu.org; Thu, 09 Oct 2014 05:11:41 -0400 Received: by mail-wg0-f44.google.com with SMTP id y10so766834wgg.15 for ; Thu, 09 Oct 2014 02:11:40 -0700 (PDT) In-Reply-To: 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: John Kitchin Cc: "emacs-orgmode@gnu.org" , Instructor account --f46d044306a802a4430504f9d236 Content-Type: text/plain; charset=UTF-8 Works perfectly! thanks! 2014-10-09 1:33 GMT+02:00 John Kitchin : > 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 > --f46d044306a802a4430504f9d236 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Works perfectly!
thanks!

2014-10-09 1:33 GMT+02:00 John Kitchi= n <jkitchin@andrew.cmu.edu>:
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 <instruc= tor@andrew.cmu.edu> writes:

> Adriaan Sticker <adria= an.sticker@gmail.com> writes:
>
> This is not perfect but it seems close:
>
> #+BEGIN_SRC emacs-lisp
> (defun my-hide (state)
>=C2=A0 =C2=A0(message "%s" state)
>=C2=A0 =C2=A0(if (or (eq state 'children)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(eq state 'subtree))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0(save-restriction
>=C2=A0 =C2=A0 =C2=A0 =C2=A0(org-narrow-to-subtree)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0(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://kitc= hingroup.cheme.cmu.edu

--f46d044306a802a4430504f9d236--