emacs-devel
[Top][All Lists]
Advanced

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

RE: save-frame-excursion?


From: Drew Adams
Subject: RE: save-frame-excursion?
Date: Sun, 26 Jul 2009 10:00:33 -0700

> so the problem is not just that focus switches to some
> other frame, but that a new frame is created.
> Note also that make-frame's docstring says:
> 
>    This function itself does not make the new frame the 
>    selected frame. The previously selected frame
>    remains selected.  However, the window system may
>    select the new frame for its own reasons, for
>    instance if the frame appears under the mouse pointer
>    and your setup is for focus to follow the pointer.
> 
> So the really better fix would be to make sure make-frame 
> doesn't change the focus (especially since the above note
> is not quite correct: even for click-to-focus WMs, the new
> frames may get selected just by virtue of being new, which
> is most likely what you're seeing).


1. Yes, please do make sure that `make-frame' does not change the focus. That
fix is long overdue. Thx.


2. In addition, please make `display-buffer' also DTRT in this regard.
`display-buffer' should never cause display of the buffer in another frame to
select the buffer (with its frame receiving the focus). But that is what
happens, on MS Windows for instance:

emacs -Q
(setq pop-up-frames t)
(display-buffer "*scratch*") ; with another buffer selected

The frame with *scratch* is raised and receives the focus - buffer *scratch* is
selected. This contradicts the documented behavior of `display-buffer', and it
has done so since day one AFAIK.

This is the case not only when *scratch*'s frame is created; it happens each
time `display-buffer' is called.

That is, fixing `make-frame' will not fix the problem of focus changing whenever
a buffer is displayed. There are two fixes that are needed.






reply via email to

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