emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: John Kitchin <jkitchin@andrew.cmu.edu>
To: Instructor account <instructor@andrew.cmu.edu>
Cc: "emacs-orgmode@gnu.org" <emacs-orgmode@gnu.org>,
	Adriaan Sticker <adriaan.sticker@gmail.com>
Subject: Re: auto hiding src blocks upon toggling headers
Date: Wed, 08 Oct 2014 19:33:20 -0400	[thread overview]
Message-ID: <m24mvef873.fsf@vpn-128-237-144-17.library.vpn.cmu.edu> (raw)
In-Reply-To: <m2r3yiifhw.fsf@andrew.cmu.edu> (Instructor account's message of "Wed, 08 Oct 2014 14:27:23 -0400")

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 <instructor@andrew.cmu.edu> writes:

> Adriaan Sticker <adriaan.sticker@gmail.com> 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	other threads:[~2014-10-08 23:33 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-08 13:26 auto hiding src blocks upon toggling headers Adriaan Sticker
2014-10-08 18:27 ` Instructor account
2014-10-08 23:33   ` John Kitchin [this message]
2014-10-09  9:11     ` Adriaan Sticker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m24mvef873.fsf@vpn-128-237-144-17.library.vpn.cmu.edu \
    --to=jkitchin@andrew.cmu.edu \
    --cc=adriaan.sticker@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=instructor@andrew.cmu.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).