emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: momentary-string-display


From: Stephen Leake
Subject: Re: momentary-string-display
Date: Sun, 07 Jan 2007 09:41:15 -0500
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (windows-nt)

Richard Stallman <address@hidden> 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]