[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] how to replace 'org-drawers'
From: |
Alan Schmitt |
Subject: |
Re: [O] how to replace 'org-drawers' |
Date: |
Mon, 06 Oct 2014 19:21:33 +0200 |
User-agent: |
Gnus/5.130012 (Ma Gnus v0.12) Emacs/24.3 (darwin) |
Hello Jonathan,
On 2014-10-06 11:13, Jonathan Leech-Pepin <address@hidden> writes:
> Hello Alan
>
> On 6 October 2014 08:23, Alan Schmitt <address@hidden>
> wrote:
>
> Hello,
>
> I'm trying to use org-wc, but it fails because org-drawers no
> longer
> exists. Is there a suggestion to change
> https://github.com/dato/org-wc/blob/master/org-wc.el#L55 such that
> it
> works with current org?
>
>
> A quick search for variables reveals `org-drawer-regexp` [ "^[ ]*:\\
> (\\(?:\\w\\|[-_]\\)+\\):[ ]*$" ]
>
> It matches both the name of the drawer and `:END:`.
>
> So the function could be adapted to use `org-drawer-regexp` instead
> (untested but should match to the next :END:):
>
> ((looking-at org-drawer-regexp)
> (while (or (eobp)
> (not (looking-at ":END:")))
> (re-search-forward org-drawer-regexp nil t)))
This was a most helpful suggestion. Looking at the commit that got rid
of org-drawers, I saw there is a `org-in-drawer-p' function that works
great. The code is now simply
((org-in-drawer-p)
(forward-line))
Thanks again,
Alan
--
OpenPGP Key ID : 040D0A3B4ED2E5C7
signature.asc
Description: PGP signature