From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.bugs Subject: bug#12170: save-excursion fails boundary case with recenter Date: Fri, 10 Aug 2012 18:46:39 +0200 Message-ID: <50253AEF.4020705@gmx.at> References: <000001cd7696$b0e93d60$12bbb820$@com> <5024D593.7080305@gmx.at> <003601cd76fd$b21cd590$165680b0$@com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1344617219 24282 80.91.229.3 (10 Aug 2012 16:46:59 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 10 Aug 2012 16:46:59 +0000 (UTC) Cc: 12170@debbugs.gnu.org, Bill Brodie To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Aug 10 18:46:59 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1SzsMO-0007o6-L3 for geb-bug-gnu-emacs@m.gmane.org; Fri, 10 Aug 2012 18:46:52 +0200 Original-Received: from localhost ([::1]:43809 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SzsMN-0004Xc-Rj for geb-bug-gnu-emacs@m.gmane.org; Fri, 10 Aug 2012 12:46:51 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:50072) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SzsMK-0004PN-1B for bug-gnu-emacs@gnu.org; Fri, 10 Aug 2012 12:46:48 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SzsMH-0007iK-Ns for bug-gnu-emacs@gnu.org; Fri, 10 Aug 2012 12:46:47 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:37689) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SzsMH-0007iF-KV for bug-gnu-emacs@gnu.org; Fri, 10 Aug 2012 12:46:45 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1SzsUH-00011b-IT for bug-gnu-emacs@gnu.org; Fri, 10 Aug 2012 12:55:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: martin rudalics Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 10 Aug 2012 16:55:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 12170 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 12170-submit@debbugs.gnu.org id=B12170.13446176863908 (code B ref 12170); Fri, 10 Aug 2012 16:55:01 +0000 Original-Received: (at 12170) by debbugs.gnu.org; 10 Aug 2012 16:54:46 +0000 Original-Received: from localhost ([127.0.0.1]:47232 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SzsU1-00010y-Tx for submit@debbugs.gnu.org; Fri, 10 Aug 2012 12:54:46 -0400 Original-Received: from mailout-de.gmx.net ([213.165.64.23]:58771) by debbugs.gnu.org with smtp (Exim 4.72) (envelope-from ) id 1SzsTz-00010p-L4 for 12170@debbugs.gnu.org; Fri, 10 Aug 2012 12:54:44 -0400 Original-Received: (qmail invoked by alias); 10 Aug 2012 16:46:26 -0000 Original-Received: from 62-47-41-199.adsl.highway.telekom.at (EHLO [62.47.41.199]) [62.47.41.199] by mail.gmx.net (mp019) with SMTP; 10 Aug 2012 18:46:26 +0200 X-Authenticated: #14592706 X-Provags-ID: V01U2FsdGVkX1/uRH5JqcHuaLjZziRjQiRnobP9qzg9h4T5JGQN4b MyYfyc3rZLIbyZ In-Reply-To: X-Y-GMX-Trusted: 0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:63011 Archived-At: > As mentioned by Martin, this is a misunderstanding about what > save-excursion does and what `point' is. As a matter of fact, I thought so initially but did not mention it. > Every buffer can have many different `point's (it basically has one per > window, accessible via `window-point' and changeable via > `set-window-point', plus one for itself, called `point'). > `save-excursion' preserves only `point'. > `recenter' changes `window-point'. The scenario shows up with one single window showing that buffer. > But `point' and `window-point' are linked (point is set to window-point > and vice-versa in various occasions), so they're often confused. > > It seems your real problem is not that `point' changes but that the > cursor ends up in a different position than the one you wanted (the > cursor position, is represented by `window-point' rather than by > `point'), right? > > If so, you want to preserve window-point. And there's nothing quite > like save-excursion to preserve window-point. You can try > save-window-excursion, tho it will do a lot more than you asked for. > Or otherwise manually read window-point at the beginning and > set-window-point at the end. Neither of these cut it. Maybe the purpose of `recenter' is to overrule, if necessary, any further point movement until the next redisplay. But I still don't understand how putting in a call of `set-window-start' with NOFORCE t can calm it. martin