emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Rainer Stengele <rainer.stengele@diplan.de>
To: Carsten Dominik <carsten.dominik@gmail.com>
Cc: org-mode mailing list <emacs-orgmode@gnu.org>
Subject: Re: Suppress visibility cycling for a specific tree
Date: Mon, 25 Jul 2011 16:26:19 +0200	[thread overview]
Message-ID: <4E2D7D0B.4080001@diplan.de> (raw)
In-Reply-To: <70280F95-CCCC-4831-ABBC-A8DA8B783F02@gmail.com>

Am 25.07.2011 15:24, schrieb Carsten Dominik:
> 
> On Jul 25, 2011, at 2:13 PM, suvayu ali wrote:
> 
>> Hi,
>>
>> Is it possible to suppress visibility cycling for a particular tree?
>> What I am looking for is the behaviour of an ARCHIVEd tree. I have some
>> general guidelines and local config in this tree that I don't want to
>> see usually but since it is technically not archived information I am
>> looking for an alternate means to a similar goal.
>>
>> Could I specify a special tag of my own and define the behaviour I want
>> with elisp? Where do I start looking for this?
> 
> Archived trees are kept closed by the function
> `org-cycle-hide-archived-subtrees', which is called by
> `org-cycle-hook'.  You could define a tag of your choice
> and then put a function into org-cycle-hook that uses a let form
> to bind `org-archive-tag' to the chosen tag and then calls
> `org-cycle-hide-archived-subtrees' to do the work.
> 
> Hope this gets you on the path.
> 
> - Carsten
> 
> 
> 
Thanks, Carsten,

this works, added to my .emacs:

(defun custom-org-cycle-hide-hidden-subtrees (state)
  "temporarily set archive tag to 'HIDE', then hide archived subtree"
  (let ((org-archive-tag "HIDE"))
    (org-cycle-hide-archived-subtrees state)))
;; add function to be called when cycling takes place: hides subtrees with "HIDE" tag
(add-hook 'org-cycle-hook 'custom-org-cycle-hide-hidden-subtrees)

Please remember that I am an emacs-lisp greenhorn.

- Rainer

  parent reply	other threads:[~2011-07-25 14:26 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-25 12:13 Suppress visibility cycling for a specific tree suvayu ali
2011-07-25 12:57 ` Rainer Stengele
2011-07-25 12:58 ` Rainer Stengele
2011-07-25 13:01 ` Rainer Stengele
2011-07-25 13:24 ` Carsten Dominik
2011-07-25 14:17   ` Carsten Dominik
2011-07-25 14:49     ` Rainer Stengele
2011-07-25 14:26   ` Rainer Stengele [this message]
2011-07-25 16:43   ` suvayu ali

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=4E2D7D0B.4080001@diplan.de \
    --to=rainer.stengele@diplan.de \
    --cc=carsten.dominik@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /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).