From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Abrahamsen Subject: Re: How to find the headline matching a string Date: Wed, 04 Jun 2014 09:36:55 +0800 Message-ID: <87d2ep5ubs.fsf@ericabrahamsen.net> References: <87bnuedl38.fsf@ericabrahamsen.net> <87ha45r9hi.fsf@gmail.com> <874n05e0ls.fsf@ericabrahamsen.net> <87r436mkgb.fsf@gmail.com> <877g4y723u.fsf@ericabrahamsen.net> <87ioohpww8.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:41098) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ws05G-0007oH-9D for emacs-orgmode@gnu.org; Tue, 03 Jun 2014 21:33:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ws05A-0006m0-3L for emacs-orgmode@gnu.org; Tue, 03 Jun 2014 21:33:42 -0400 Received: from plane.gmane.org ([80.91.229.3]:60187) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ws059-0006lu-P1 for emacs-orgmode@gnu.org; Tue, 03 Jun 2014 21:33:36 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1Ws056-0008Dr-OU for emacs-orgmode@gnu.org; Wed, 04 Jun 2014 03:33:32 +0200 Received: from 123.123.20.225 ([123.123.20.225]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 04 Jun 2014 03:33:32 +0200 Received: from eric by 123.123.20.225 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 04 Jun 2014 03:33:32 +0200 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: emacs-orgmode@gnu.org Nicolas Goaziou writes: > Hello, > > Eric Abrahamsen writes: > >> I guess it shouldn't be too surprising -- the org element stuff is >> completely parsing the entire buffer on every pass. The other function >> probably boils down to passing a few targeted regexps over the buffer. >> I've sneakily cc'd Nicolas to see what he thinks. My guess is we could >> replace the call to org-element-parse-buffer with something that >> creates/accesses the cached version of the parse tree, and things would >> go much more swiftly. > > I didn't look closely into the issue, but I think the main reason is > that Element parses headlines thoroughly, including all properties, > scheduled keywords, which is not, by default, the case for > `org-map-entries'. > > For most use-cases, you don't need the parser for headlines, as their > grammar is context free. IOW, `org-element-parse-buffer' doesn't predate > `org-map-entries'. Interesting, thanks! I think at first we were unsure if org-map-entries was going to stay around in the long term, but it sounds like it's not going anywhere. E