[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] fold all drawers in a buffer?
From: |
Thorsten Jolitz |
Subject: |
Re: [O] fold all drawers in a buffer? |
Date: |
Fri, 01 Nov 2013 20:28:05 +0100 |
User-agent: |
Gnus/5.130002 (Ma Gnus v0.2) Emacs/24.3 (gnu/linux) |
Aaron Ecay <address@hidden> 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 <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.
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