From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thorsten Jolitz Subject: Re: save-excursion in Org files Date: Sat, 07 Jul 2012 23:31:54 +0200 Message-ID: <87liiv9s1h.fsf@googlemail.com> References: <87pq879svk.fsf@googlemail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:44515) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SncZ8-0005Lj-3C for emacs-orgmode@gnu.org; Sat, 07 Jul 2012 17:29:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SncZ6-0003vH-Aa for emacs-orgmode@gnu.org; Sat, 07 Jul 2012 17:29:21 -0400 Received: from plane.gmane.org ([80.91.229.3]:48060) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SncZ6-0003v4-3c for emacs-orgmode@gnu.org; Sat, 07 Jul 2012 17:29:20 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1SncZ2-0005w3-Et for emacs-orgmode@gnu.org; Sat, 07 Jul 2012 23:29:16 +0200 Received: from g231235015.adsl.alicedsl.de ([92.231.235.15]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 07 Jul 2012 23:29:16 +0200 Received: from tjolitz by g231235015.adsl.alicedsl.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 07 Jul 2012 23:29:16 +0200 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Thorsten Jolitz writes: > in elisp code, with point in entry1, I do a save-excursion that inserts > another entry2 and does some work there. After existing from the > save-excursion form, I add e.g. a global ID with org-id-get-create - and > would expect to find it in entry1 when save-excursion did its job right. > But I find it in entry2. > > So when I am in one entry and do some inserting in a save-excursion, I > cannot expect to find myself at the same position in the same entry > after save-excursion finished? save-excursion does seem to work better than human reception: ,------------------------------- | before save excusion1: 271 | before save excusion2: 271 | after save excursion2: 271 | before end save excusion1: 455 | after save excusion1: 271 | after postprocess: 271 `------------------------------- I enclosed the whole thing in another save-excursion, an found out that there was some point movement after the original save-excursion that I had overlooked. Sorry for the noise. -- cheers, Thorsten