emacs-devel
[Top][All Lists]
Advanced

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

Re: window.el modify current emacs23 behavior of anything.


From: Stefan Monnier
Subject: Re: window.el modify current emacs23 behavior of anything.
Date: Tue, 20 Sep 2011 18:08:25 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

> When `bury-buffer' restores the buffer previously shown in the selected
> window, it also restores that buffer's `window-start' and `window-point'
> position in the window.  If the window is selected, this implicitly
> moves the buffer's point to the window's point.  This means that if the
> restored buffer's point was changed before calling `bury-buffer', that
> position is lost.

Oh, I see the problem:

Try M-: (progn (set-window-start (selected-window) (point)) (goto-char 
(point-min)))

and you'll see the that set-window-point wins even though it's run
before the goto-char.

That's why a sit-for works around the problem: it causes the
set-window-start to be "executed", letting the subsequent goto-char do
its job.

So maybe the right fix is to remove the call to set-window-start.


        Stefan



reply via email to

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