From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Barry Margolin Newsgroups: gmane.emacs.help Subject: Re: Why save-excursion doesn't restore cursor position after 3 kill-line calls? Date: Sat, 29 Nov 2008 03:21:11 -0500 Organization: A noiseless patient Spider Message-ID: 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 X-Trace: ger.gmane.org 1227948053 17666 80.91.229.12 (29 Nov 2008 08:40:53 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 29 Nov 2008 08:40:53 +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 09:41:56 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 1L6LOm-0005i5-1O for geh-help-gnu-emacs@m.gmane.org; Sat, 29 Nov 2008 09:41:56 +0100 Original-Received: from localhost ([127.0.0.1]:32951 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L6LNc-00089h-1N for geh-help-gnu-emacs@m.gmane.org; Sat, 29 Nov 2008 03:40:44 -0500 Original-Path: news.stanford.edu!headwall.stanford.edu!news.glorb.com!news2!news.motzarella.org!motzarella.org!news.motzarella.org!barmar Original-Newsgroups: gnu.emacs.help Original-Lines: 28 Original-X-Trace: news.motzarella.org U2FsdGVkX182nfTl6li3mMLEWihi6GONLBJELOClBKVU0v0jwQWitpvuvgtZNQDk0Hj5LgpPaSDfPGpAJdUjRGbVe4vWcou/I9+Pn+E80CPmJn/B/E6npeGTdeuw6RqnqIwdibNpLAY= Original-X-Complaints-To: Please send complaints to abuse@motzarella.org with full headers Original-NNTP-Posting-Date: Sat, 29 Nov 2008 08:21:11 +0000 (UTC) X-Auth-Sender: U2FsdGVkX19aUK3DJ1P9xdgp+4YY2AadHbW91+m4gdU= Cancel-Lock: sha1:skwhXSrRz8lE8L+EFhSJmNUUeOE= User-Agent: MT-NewsWatcher/3.5.3b3 (Intel Mac OS X) Mail-Copies-To: nobody Original-Xref: news.stanford.edu gnu.emacs.help:164891 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:60219 Archived-At: 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. -- Barry Margolin, barmar@alum.mit.edu Arlington, MA *** PLEASE post questions in newsgroups, not directly to me *** *** PLEASE don't copy me on replies, I'll read them in the group ***