From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: Buffer positions from `org-element-map'? Date: Wed, 28 Jan 2015 08:32:47 +0100 Message-ID: <87vbjr2wdc.fsf@nicolasgoaziou.fr> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:42049) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YGN6M-0006XL-S1 for emacs-orgmode@gnu.org; Wed, 28 Jan 2015 02:31:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YGN6I-0006WD-AI for emacs-orgmode@gnu.org; Wed, 28 Jan 2015 02:31:50 -0500 Received: from relay6-d.mail.gandi.net ([2001:4b98:c:538::198]:47526) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YGN6I-0006W3-4P for emacs-orgmode@gnu.org; Wed, 28 Jan 2015 02:31:46 -0500 In-Reply-To: (Charles C. Berry's message of "Tue, 27 Jan 2015 17:48:42 -0800") 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: "Charles C. Berry" Cc: Org-Mode mailing list Hello, "Charles C. Berry" writes: > What I would like is to have the same values of :begin as would be > obtained by placing the cursor on each inline src block and evaluating > (org-element-context). As is evident below, :begin is sometimes a > relative position. This was fixed recently. > Suggestions on how to get the buffer position or some other way to do > in situ buffer modifications from `org-element-map' without > interpreting a complete parse tree (which I expect requires more > computation that doing selected `delete then insert' operations) are > welcome. I think the most efficient is to do a fast search, e.g., (search-forward "src_" nil t) then, with `org-element-context', double-check type of object found and collect :begin property. Regards, -- Nicolas Goaziou