Aaron Ecay <aarone...@gmail.com> 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 <n.goaz...@gmail.com>
> 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


Reply via email to