emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [Orgmode] Re: [PATCH] Use save-excursion in org-map-dblocks


From: Carsten Dominik
Subject: Re: [Orgmode] Re: [PATCH] Use save-excursion in org-map-dblocks
Date: Wed, 24 Mar 2010 22:27:06 +0100


On Mar 24, 2010, at 2:47 PM, Magnus Henoch wrote:

Carsten Dominik <address@hidden> writes:

this looks like an OK patch and I don't have any problems applying it.
However, I do not quite understand the need for it.  Can you please
try to explain a bit better?  Do you have two processes running over
the same file at the same time, or why is there a conflict?

My dblock-write function calls url-retrieve, to asynchronously retrieve an HTML page. The callback function I pass to url-retrieve will then fill
in the information I need into the dynamic block.

So in the following case:

* Find start of dblock 1, store as pos
* Make HTTP request for dblock 1
* Go back to pos
* Find end of dblock 1
* Find start of dblock 2, store as pos
* Make HTTP request for dblock 2
* Asynchronous event: HTTP response for dblock 1 arrives, insert lots of
 data in dblock 1
* Go back to pos
* Find end of dblock 2

the last step will actually find the end of dblock 1, if the amount of
data inserted in dblock 1 is great enough that pos suddenly points
inside it. (Then it will of course find dblock 2 again, request its HTML
page again, and thus insert the data twice.)

An equivalent fix would be to make pos a marker instead.

Yes, that would be the same.

I have applied the patch, thanks.

Can I ask you to sign the FSF papers for future patches which might be more than a few lines?

Thanks.

- Carsten





reply via email to

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