From mboxrd@z Thu Jan 1 00:00:00 1970 From: Magnus Henoch Subject: Re: [PATCH] Use save-excursion in org-map-dblocks Date: Wed, 24 Mar 2010 13:47:58 +0000 Message-ID: <84d3ytsuep.fsf@linux-b2a3.site> References: <841vfbszvp.fsf@linux-b2a3.site> <9AD8954E-F77B-45E0-84FB-3000DF3C4B4C@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NuQwR-00034x-Vq for emacs-orgmode@gnu.org; Wed, 24 Mar 2010 09:48:16 -0400 Received: from [140.186.70.92] (port=46881 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NuQwQ-00034p-I8 for emacs-orgmode@gnu.org; Wed, 24 Mar 2010 09:48:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1NuQwO-00067A-Tl for emacs-orgmode@gnu.org; Wed, 24 Mar 2010 09:48:14 -0400 Received: from lo.gmane.org ([80.91.229.12]:40363) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NuQwO-000672-Ne for emacs-orgmode@gnu.org; Wed, 24 Mar 2010 09:48:12 -0400 Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1NuQwM-0004z2-P5 for emacs-orgmode@gnu.org; Wed, 24 Mar 2010 14:48:10 +0100 Received: from host213-123-170-251.in-addr.btopenworld.com ([213.123.170.251]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 24 Mar 2010 14:48:10 +0100 Received: from magnus.henoch by host213-123-170-251.in-addr.btopenworld.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 24 Mar 2010 14:48:10 +0100 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: emacs-orgmode@gnu.org 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. -- Magnus Henoch