From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: Re: [PATCH] Use save-excursion in org-map-dblocks Date: Wed, 24 Mar 2010 22:27:06 +0100 Message-ID: <4B463C46-50B5-42FA-8459-9B4260AFBEF2@gmail.com> References: <841vfbszvp.fsf@linux-b2a3.site> <9AD8954E-F77B-45E0-84FB-3000DF3C4B4C@gmail.com> <84d3ytsuep.fsf@linux-b2a3.site> Mime-Version: 1.0 (Apple Message framework v936) Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NuY6Z-0007Gf-TV for emacs-orgmode@gnu.org; Wed, 24 Mar 2010 17:27:11 -0400 Received: from [140.186.70.92] (port=33577 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NuY6Y-0007GC-11 for emacs-orgmode@gnu.org; Wed, 24 Mar 2010 17:27:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1NuY6W-0005s2-HH for emacs-orgmode@gnu.org; Wed, 24 Mar 2010 17:27:09 -0400 Received: from mail-ew0-f216.google.com ([209.85.219.216]:51825) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NuY6W-0005rv-CT for emacs-orgmode@gnu.org; Wed, 24 Mar 2010 17:27:08 -0400 Received: by ewy8 with SMTP id 8so93911ewy.8 for ; Wed, 24 Mar 2010 14:27:07 -0700 (PDT) In-Reply-To: <84d3ytsuep.fsf@linux-b2a3.site> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Magnus Henoch Cc: emacs-orgmode@gnu.org On Mar 24, 2010, at 2:47 PM, Magnus Henoch wrote: > Carsten Dominik 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