From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thorsten Jolitz Subject: Re: fold all drawers in a buffer? Date: Fri, 01 Nov 2013 20:28:05 +0100 Message-ID: <8761sbly62.fsf@gmail.com> References: <87ppqkktky.fsf@gmail.com> <87d2mkkr8c.fsf@gmail.com> <87txfw0y4s.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:38880) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VcKOQ-0001pP-7t for emacs-orgmode@gnu.org; Fri, 01 Nov 2013 15:28:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VcKOI-0004pA-Pi for emacs-orgmode@gnu.org; Fri, 01 Nov 2013 15:28:26 -0400 Received: from plane.gmane.org ([80.91.229.3]:41320) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VcKOI-0004oE-J9 for emacs-orgmode@gnu.org; Fri, 01 Nov 2013 15:28:18 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1VcKOH-0001vN-KX for emacs-orgmode@gnu.org; Fri, 01 Nov 2013 20:28:17 +0100 Received: from g231108014.adsl.alicedsl.de ([92.231.108.14]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 01 Nov 2013 20:28:17 +0100 Received: from tjolitz by g231108014.adsl.alicedsl.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 01 Nov 2013 20:28:17 +0100 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: emacs-orgmode@gnu.org Aaron Ecay writes: Hi Aaron, > 2013ko azaroak 1an, Thorsten Jolitz-ek idatzi zuen: >> I tested the above functions with a big org file - way to slow. >> These versions perfom better, but only on property drawers: >> >> #+begin_src emacs-lisp >> (defun org-show-drawers () >> "Unfold all drawers in buffer" >> (interactive) >> (save-excursion >> (goto-char (point-min)) >> (while (re-search-forward org-property-start-re nil 'NOERROR) >> (and (org-element-property :hiddenp (org-element-at-point)) >> (org-cycle))))) >> >> (defun org-hide-drawers () >> "Unfold all drawers in buffer" >> (interactive) >> (save-excursion >> (goto-char (point-min)) >> (while (re-search-forward org-property-start-re nil 'NOERROR) >> (and (not (org-element-property :hiddenp (org-element-at-point))) >> (org-cycle))))) >> #+end_src > > This will work on recent versions of org, but the :hiddenp properties > were taken out of the parser by the following git commit (not yet in any > released version of org AFAIK): > > commit fe27ca9906f1d6c48a93f463d85850925687b825 > Author: Nicolas Goaziou > Date: Thu Oct 3 22:57:02 2013 +0200 > > For forward compatibility you can skip the visibility check and use > ‘(org-flag-drawer nil)’ unconditionally, I think. I see, thanks for the tip. I did not know about the fate of 'hiddenp' or about the useful 'org-flag-XXX' functions. -- cheers, Thorsten