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: Fri, 28 Nov 2008 19:18:53 -0400 Message-ID: <87bpvzjv6q.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=us-ascii X-Trace: ger.gmane.org 1227914370 19921 80.91.229.12 (28 Nov 2008 23:19:30 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 28 Nov 2008 23:19:30 +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 00:20:31 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 1L6CdT-000256-GO for geh-help-gnu-emacs@m.gmane.org; Sat, 29 Nov 2008 00:20:31 +0100 Original-Received: from localhost ([127.0.0.1]:49655 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L6CcJ-0002gF-I3 for geh-help-gnu-emacs@m.gmane.org; Fri, 28 Nov 2008 18:19:19 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1L6Cc0-0002fz-J8 for help-gnu-emacs@gnu.org; Fri, 28 Nov 2008 18:19:00 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1L6Cby-0002fb-Vd for help-gnu-emacs@gnu.org; Fri, 28 Nov 2008 18:19:00 -0500 Original-Received: from [199.232.76.173] (port=41200 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L6Cby-0002fY-NI for help-gnu-emacs@gnu.org; Fri, 28 Nov 2008 18:18:58 -0500 Original-Received: from main.gmane.org ([80.91.229.2]:56595 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 1L6Cby-0003Xi-AM for help-gnu-emacs@gnu.org; Fri, 28 Nov 2008 18:18:58 -0500 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1L6Cbu-0002yR-66 for help-gnu-emacs@gnu.org; Fri, 28 Nov 2008 23:18:54 +0000 Original-Received: from h148hlfxns0149w-142177125.pppoe-dynamic.ns.aliant.net ([142.177.125.148]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 28 Nov 2008 23:18:54 +0000 Original-Received: from tyler.smith by h148hlfxns0149w-142177125.pppoe-dynamic.ns.aliant.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 28 Nov 2008 23:18:54 +0000 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 31 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: h148hlfxns0149w-142177125.pppoe-dynamic.ns.aliant.net User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) Cancel-Lock: sha1:MndygF9dhMGMUot6IrsR7f3ZOuA= 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:60209 Archived-At: Andreas Politz writes: > tyler wrote: >> >> The real question is why save-excursion *doesn't* do this. The >> documentation states that point is restored. Either 'restoring' point >> means something other than setting point to equal the previously saved >> value, or there is something missing in the documentation. >> > > save-excursion stores a marker, not the 'byte' number. When you kill > the line where point is, this marker gets replaced to the beginning of > the line. > > ,----[ (info "(elisp)Excursions") ] > | *Warning:* Ordinary insertion of text adjacent to the saved point > | value relocates the saved value, just as it relocates all markers. > | More precisely, the saved value is a marker with insertion type `nil'. > | *Note Marker Insertion Types::. Therefore, when the saved point value > | is restored, it normally comes before the inserted text. > `---- > 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. Tyler --