From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matt Price Subject: Re: Fwd: set global visibility set to CONTENTS in a defun? Date: Sat, 9 Nov 2013 21:24:36 -0500 Message-ID: References: <871u2wbeeu.fsf@bzg.ath.cx> <87a9hd8ikj.fsf@bzg.ath.cx> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:46035) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VfKha-00064O-KT for emacs-orgmode@gnu.org; Sat, 09 Nov 2013 21:24:39 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VfKhZ-0005fp-Cz for emacs-orgmode@gnu.org; Sat, 09 Nov 2013 21:24:38 -0500 In-Reply-To: <87a9hd8ikj.fsf@bzg.ath.cx> 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: Bastien Cc: Org Mode On Sat, Nov 9, 2013 at 2:46 PM, Bastien wrote: > Hi Matt, > > Matt Price writes: > >> What I mostly wanted was to write an interactive defun that would >> switch to an org buffer and then automatically set the visibility >> (either the global visibility or the visibility of the active subtree) >> to an arbitrary desired level. > > The only way I see is to set this desired level as a property for > the entries, then to let your defun act depending on this property. > > See the Org manual (2.3 Visibility cycling): > > Furthermore, any entries with a 'VISIBILITY' property (*note > Properties > and Columns::) will get their visibility adapted accordingly. Allowed > values for this property are 'folded', 'children', 'content', and > 'all'. > > 'C-u C-u ' ('org-set-startup-visibility') Switch back to the > startup visibility of the buffer, i.e., whatever is requested by > startup options and 'VISIBILITY' properties in individual entries. > >> org-cycle does not seem to be a >> reliable way to do this because you can't just pass the desired >> visibility level as an argument -- or at least, I an't figure out how >> to do this. The same is true for org-global-cycle. I'm not sure, >> does that clarify what I'm asking? > > Yes.. but I'm not sure I can think of a solution, manipulating > visibility states is a bit daunting. Yes, it seems quite difficult I am working on other solutions... > > -- > Bastien