From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stephen Leake Newsgroups: gmane.emacs.devel Subject: Re: momentary-string-display Date: Sun, 07 Jan 2007 09:41:15 -0500 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1168180911 23244 80.91.229.12 (7 Jan 2007 14:41:51 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 7 Jan 2007 14:41:51 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jan 07 15:41:49 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1H3ZDY-0004Xx-Gj for ged-emacs-devel@m.gmane.org; Sun, 07 Jan 2007 15:41:48 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1H3ZDY-0006ES-46 for ged-emacs-devel@m.gmane.org; Sun, 07 Jan 2007 09:41:48 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1H3ZDJ-0006BY-H8 for emacs-devel@gnu.org; Sun, 07 Jan 2007 09:41:33 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1H3ZDE-00064N-NC for emacs-devel@gnu.org; Sun, 07 Jan 2007 09:41:33 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1H3ZDE-00064C-Ep for emacs-devel@gnu.org; Sun, 07 Jan 2007 09:41:28 -0500 Original-Received: from [207.172.157.102] (helo=smtp02.lnh.mail.rcn.net) by monty-python.gnu.org with esmtp (Exim 4.52) id 1H3ZDC-0005M4-EW; Sun, 07 Jan 2007 09:41:26 -0500 Original-Received: from mr02.lnh.mail.rcn.net ([207.172.157.22]) by smtp02.lnh.mail.rcn.net with ESMTP; 07 Jan 2007 09:41:27 -0500 Original-Received: from smtp01.lnh.mail.rcn.net (smtp01.lnh.mail.rcn.net [207.172.4.11]) by mr02.lnh.mail.rcn.net (MOS 3.7.5a-GA) with ESMTP id MTA93185; Sun, 7 Jan 2007 09:41:24 -0500 (EST) Original-Received: from 208-59-165-113.c3-0.slvr-ubr1.lnh-slvr.md.cable.rcn.com (HELO ACS1100007992) ([208.59.165.113]) by smtp01.lnh.mail.rcn.net with ESMTP; 07 Jan 2007 09:41:25 -0500 Original-To: rms@gnu.org, emacs-devel@gnu.org In-Reply-To: (Richard Stallman's message of "Sat, 06 Jan 2007 22:47:40 -0500") User-Agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (windows-nt) X-Junkmail-Status: score=10/50, host=mr02.lnh.mail.rcn.net X-Junkmail-SD-Raw: score=unknown, refid=str=0001.0A090209.45A104D6.00A7,ss=1,fgs=0, ip=207.172.4.11, so=2006-05-09 23:27:51, dmn=5.2.125/2006-10-10 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:64914 Archived-At: Richard Stallman writes: > Does this code work? > > ;; If that pushed message start off the screen, > ;; scroll to start it at the top of the screen. > (save-excursion > (move-to-window-line 0) > (if (> (point) pos) > (goto-char pos) > (recenter 0))) Yes. And that is more elegant. I had rejected using 'save-excursion' because I thought point had to move in the case where the scrolling had to happen. But in fact it is only the window that needs to move, and the window position is _not_ preserved by 'save-excursion'. Hmm. I guess I thought the window position _was_ preserved by 'save-excursion'. But the doc for 'save-excursion' does not say that. -- -- Stephe