From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jonathan Leech-Pepin Subject: Re: how to replace 'org-drawers' Date: Mon, 6 Oct 2014 11:13:51 -0400 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a11c137b8f536000504c2883d Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:60543) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xb9zJ-0002Zb-6m for emacs-orgmode@gnu.org; Mon, 06 Oct 2014 11:14:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xb9zI-0001J4-5N for emacs-orgmode@gnu.org; Mon, 06 Oct 2014 11:14:13 -0400 Received: from mail-qg0-x22a.google.com ([2607:f8b0:400d:c04::22a]:35293) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xb9zI-0001Iu-0B for emacs-orgmode@gnu.org; Mon, 06 Oct 2014 11:14:12 -0400 Received: by mail-qg0-f42.google.com with SMTP id z60so3905436qgd.1 for ; Mon, 06 Oct 2014 08:14:11 -0700 (PDT) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Alan Schmitt Cc: emacs-orgmode --001a11c137b8f536000504c2883d Content-Type: text/plain; charset=UTF-8 Hello Alan On 6 October 2014 08:23, Alan Schmitt 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))) Regards, Jonathan > Thanks, > > Alan > > -- > OpenPGP Key ID : 040D0A3B4ED2E5C7 > --001a11c137b8f536000504c2883d Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hello Alan

On 6 October 2014 08:23, Alan Schmitt <<= a href=3D"mailto:alan.schmitt@polytechnique.org" target=3D"_blank">alan.sch= mitt@polytechnique.org> 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 su= ch that it
works with current org?


A quick search for variables reveals `= org-drawer-regexp` [ "^[ =C2=A0=C2=A0=C2=A0 ]*:\\(\\(?:\\w\\|[-_]\\)+\= \):[ =C2=A0=C2=A0=C2=A0 ]*$" ]

It matches both the n= ame of the drawer and `:END:`.

So the function could be a= dapted to use `org-drawer-regexp` instead (untested but should match to the= next :END:):

((looking-at org-drawer-regexp)
=C2=A0(while (or (e= obp)
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 = (not (looking-at ":END:")))
=C2=A0=C2=A0 (re-search-forward or= g-drawer-regexp nil t)))

Regards,
Jonathan
=C2=A0
Thanks,

Alan

--
OpenPGP Key ID : 040D0A3B4ED2E5C7

--001a11c137b8f536000504c2883d--