[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] fold all drawers in a buffer?
From: |
Aaron Ecay |
Subject: |
Re: [O] fold all drawers in a buffer? |
Date: |
Fri, 01 Nov 2013 14:34:27 -0400 |
User-agent: |
Notmuch/0.16+113~g516efb7 (http://notmuchmail.org) Emacs/24.3.50.1 (x86_64-unknown-linux-gnu) |
Hi Thorsten,
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 <address@hidden>
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.
--
Aaron Ecay