From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: tyler Newsgroups: gmane.emacs.help Subject: Re: Why save-excursion doesn't restore cursor position after 3 kill-line calls? Date: Sat, 29 Nov 2008 13:28:55 -0400 Message-ID: <877i6mjvag.fsf@blackbart.sedgenet> References: <429c5cab-0015-4eb6-a794-ce990c6255d6@q26g2000prq.googlegroups.com> <9700303c-f0d1-42b6-b1d0-a74e3fe2ab33@t26g2000prh.googlegroups.com> <1227911769.432128@arno.fh-trier.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1227979779 20512 80.91.229.12 (29 Nov 2008 17:29:39 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 29 Nov 2008 17:29:39 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Nov 29 18:30:43 2008 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1L6TeM-0005NI-8F for geh-help-gnu-emacs@m.gmane.org; Sat, 29 Nov 2008 18:30:34 +0100 Original-Received: from localhost ([127.0.0.1]:47656 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L6TdC-0008BU-8h for geh-help-gnu-emacs@m.gmane.org; Sat, 29 Nov 2008 12:29:22 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1L6Tcq-00088w-6B for help-gnu-emacs@gnu.org; Sat, 29 Nov 2008 12:29:00 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1L6Tco-00086H-JH for help-gnu-emacs@gnu.org; Sat, 29 Nov 2008 12:28:59 -0500 Original-Received: from [199.232.76.173] (port=45092 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L6Tco-00086B-F6 for help-gnu-emacs@gnu.org; Sat, 29 Nov 2008 12:28:58 -0500 Original-Received: from main.gmane.org ([80.91.229.2]:51378 helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1L6Tco-0006hd-4P for help-gnu-emacs@gnu.org; Sat, 29 Nov 2008 12:28:58 -0500 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1L6Tcl-0000uv-HW for help-gnu-emacs@gnu.org; Sat, 29 Nov 2008 17:28:55 +0000 Original-Received: from hlfxns0149w-142177126087.pppoe-dynamic.ns.aliant.net ([142.177.126.87]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 29 Nov 2008 17:28:55 +0000 Original-Received: from tyler.smith by hlfxns0149w-142177126087.pppoe-dynamic.ns.aliant.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 29 Nov 2008 17:28:55 +0000 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 32 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: hlfxns0149w-142177126087.pppoe-dynamic.ns.aliant.net User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) Cancel-Lock: sha1:8ltL8UpCBCDdpkg/koqND29IwWo= X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:60230 Archived-At: Barry Margolin writes: > In article , > tyler wrote: > >> Thanks. I think I understand, at least generally, what's going on now. >> Markers are a new concept for me, so I'll have to do some more reading >> to sort out the details. > > Here's a simple example that may help. Suppose you have a buffer > containing: > > 1 abcdef > 2 123456 > 3 wxyz > > and point is on line 2 between 3 and 4. You write a function that uses > save-excursion while it deletes line 1. When the save-excursion ends, > point will still be between 3 and 4, although this will now be line 1. > > The intent is to continue pointing to the same text that it originally > pointed to. But if that text itself is deleted, this is obviously not > possible. Any markers that were within the deleted text will end up > pointing to the place where the text used to be. Thanks, that does help! Tyler -- I never loan my books, for people never return them. The only books remaining in my library are those I’ve borrowed from others.