emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Aaron Ecay <aaronecay@gmail.com>
To: Thorsten Jolitz <tjolitz@gmail.com>, emacs-orgmode@gnu.org
Subject: Re: fold all drawers in a buffer?
Date: Fri, 01 Nov 2013 14:34:27 -0400	[thread overview]
Message-ID: <87txfw0y4s.fsf@gmail.com> (raw)
In-Reply-To: <87d2mkkr8c.fsf@gmail.com>

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 <n.goaziou@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.

-- 
Aaron Ecay

  reply	other threads:[~2013-11-01 18:34 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-01 13:46 fold all drawers in a buffer? Matt Price
2013-11-01 15:52 ` Thorsten Jolitz
2013-11-01 16:43   ` Thorsten Jolitz
2013-11-01 18:34     ` Aaron Ecay [this message]
2013-11-01 19:28       ` Thorsten Jolitz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87txfw0y4s.fsf@gmail.com \
    --to=aaronecay@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=tjolitz@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).