From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bastien Subject: Re: Fwd: set global visibility set to CONTENTS in a defun? Date: Sat, 09 Nov 2013 20:46:04 +0100 Message-ID: <87a9hd8ikj.fsf@bzg.ath.cx> References: <871u2wbeeu.fsf@bzg.ath.cx> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:58995) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VfEU8-0004ub-6g for emacs-orgmode@gnu.org; Sat, 09 Nov 2013 14:46:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VfETz-0007mO-Oy for emacs-orgmode@gnu.org; Sat, 09 Nov 2013 14:46:20 -0500 Received: from mail-wi0-x235.google.com ([2a00:1450:400c:c05::235]:48477) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VfETz-0007mG-Hp for emacs-orgmode@gnu.org; Sat, 09 Nov 2013 14:46:11 -0500 Received: by mail-wi0-f181.google.com with SMTP id m19so746663wiv.14 for ; Sat, 09 Nov 2013 11:46:10 -0800 (PST) In-Reply-To: (Matt Price's message of "Fri, 8 Nov 2013 14:30:44 -0500") 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: Matt Price Cc: Org Mode 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. -- Bastien