emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] How to insert/replace during `org-elemment-map' call?


From: Thorsten Jolitz
Subject: Re: [O] How to insert/replace during `org-elemment-map' call?
Date: Thu, 07 Aug 2014 18:11:17 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

Nicolas Goaziou <address@hidden> writes:

Hello,

> Thorsten Jolitz <address@hidden> writes:
>
>> When I set that argument to non-nil (t or 'append or 'prepend), things
>> stop working because replacing/appending changes the parsed buffer,
>> but the :begin and :end properties of the already parsed elements are
>> not adjusted and I use them e.g. to delete a region.
>>
>> Without using the export-framework (which seems overkill in this
>> case), is there a way to make this work anyway?
>
> You can make replacements backwards, i.e., starting from the bottom of
> the buffer.

Its not really obvious for me how to do that. You mean simply by doing
it in 2 steps

 1. map parse-tree and get the result list

 2. goto point-max of buffer and use the result list to replace mapped
 elements backwards

or rather a 'trick' to make org-element-map process the parse-tree
backwards and thus start with replacing the last element?
Not sure what this trick would be - partly reverse the parse-tree?

-- 
cheers,
Thorsten




reply via email to

[Prev in Thread] Current Thread [Next in Thread]