all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* auto hiding src blocks upon toggling headers
@ 2014-10-08 13:26 Adriaan Sticker
  2014-10-08 18:27 ` Instructor account
  0 siblings, 1 reply; 4+ messages in thread
From: Adriaan Sticker @ 2014-10-08 13:26 UTC (permalink / raw
  To: emacs-orgmode@gnu.org

[-- Attachment #1: Type: text/plain, Size: 264 bytes --]

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

[-- Attachment #2: Type: text/html, Size: 342 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: auto hiding src blocks upon toggling headers
  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
  0 siblings, 1 reply; 4+ messages in thread
From: Instructor account @ 2014-10-08 18:27 UTC (permalink / raw
  To: Adriaan Sticker; +Cc: emacs-orgmode@gnu.org

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: auto hiding src blocks upon toggling headers
  2014-10-08 18:27 ` Instructor account
@ 2014-10-08 23:33   ` John Kitchin
  2014-10-09  9:11     ` Adriaan Sticker
  0 siblings, 1 reply; 4+ messages in thread
From: John Kitchin @ 2014-10-08 23:33 UTC (permalink / raw
  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 <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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: auto hiding src blocks upon toggling headers
  2014-10-08 23:33   ` John Kitchin
@ 2014-10-09  9:11     ` Adriaan Sticker
  0 siblings, 0 replies; 4+ messages in thread
From: Adriaan Sticker @ 2014-10-09  9:11 UTC (permalink / raw
  To: John Kitchin; +Cc: emacs-orgmode@gnu.org, Instructor account

[-- Attachment #1: Type: text/plain, Size: 1257 bytes --]

Works perfectly!
thanks!

2014-10-09 1:33 GMT+02:00 John Kitchin <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 <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
>

[-- Attachment #2: Type: text/html, Size: 2142 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-10-09  9:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2014-10-09  9:11     ` Adriaan Sticker

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.