From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rainer Stengele Subject: Re: Suppress visibility cycling for a specific tree Date: Mon, 25 Jul 2011 16:26:19 +0200 Message-ID: <4E2D7D0B.4080001@diplan.de> References: <70280F95-CCCC-4831-ABBC-A8DA8B783F02@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([140.186.70.92]:43665) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QlM6x-0001KA-Hv for emacs-orgmode@gnu.org; Mon, 25 Jul 2011 10:26:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QlM6v-0000pT-Kp for emacs-orgmode@gnu.org; Mon, 25 Jul 2011 10:26:23 -0400 Received: from ns.diplan.de ([212.34.188.4]:32891 helo=mail.diplan.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QlM6v-0000p3-Ec for emacs-orgmode@gnu.org; Mon, 25 Jul 2011 10:26:21 -0400 In-Reply-To: <70280F95-CCCC-4831-ABBC-A8DA8B783F02@gmail.com> 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: Carsten Dominik Cc: org-mode mailing list 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