emacs-orgmode
[Top][All Lists]
Advanced

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

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


From: Magnus Henoch
Subject: [Orgmode] Re: [PATCH] Use save-excursion in org-map-dblocks
Date: Wed, 24 Mar 2010 13:47:58 +0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

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.

-- 
Magnus Henoch





reply via email to

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