From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: doc patch: move footnote in external links Date: Mon, 12 Jan 2015 23:56:26 +0100 Message-ID: <87egqzehgl.fsf@nicolasgoaziou.fr> References: <87egs4bwuu.fsf@nicolasgoaziou.fr> <87388jab2j.fsf@nicolasgoaziou.fr> <87y4q745w7.fsf@nicolasgoaziou.fr> <87vbl6x91a.fsf@nicolasgoaziou.fr> <87twzxdlkf.fsf@nicolasgoaziou.fr> <87lhl8e6db.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:58288) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YAntU-0000Dp-Bs for emacs-orgmode@gnu.org; Mon, 12 Jan 2015 17:55:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YAntQ-0005w5-90 for emacs-orgmode@gnu.org; Mon, 12 Jan 2015 17:55:32 -0500 Received: from relay5-d.mail.gandi.net ([2001:4b98:c:538::197]:37313) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YAntP-0005v5-RK for emacs-orgmode@gnu.org; Mon, 12 Jan 2015 17:55:28 -0500 In-Reply-To: (Alan Schmitt's message of "Mon, 12 Jan 2015 12:12:21 +0100") 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 Alan Schmitt writes: > Should we assume the cookie is at the end of the headline or not? The cookie can be anywhere within the headline text. > I'd gladly do this, but to use the `org-element-map' function it seem > that I need a parse tree. How can I get it? Or is it possible to use > directly `org-element-map' on a buffer? You don't need to use `org-element-map'[fn:1]. However, you cannot just use `re-search-forward' either. You probably need to map over entries (e.g., with `org-map-entries'), apply some filter to current headline, and compare it with link's path. This is slower than the current implementation. Another option would be to ignore only contents of statistics cookies, not the whole cookie. This way we still can turn path into a proper regexp. WDYT? Regards, [fn:1] Btw, you get a parse tree with `org-element-parse-buffer'.