emacs-devel
[Top][All Lists]
Advanced

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

Re: managing windows in two frames


From: Stephen Leake
Subject: Re: managing windows in two frames
Date: Sat, 07 Sep 2013 03:49:35 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (windows-nt)

martin rudalics <address@hidden> writes:

>> C-x 6 is available. But display-buffer is not used for displaying a
>> buffer in the current window now, so I think this cannot be handled by
>> the same mechanism. At least not without major changes.
>
> `display-buffer-same-window'?  Or what am I missing?

`find-file' does not call `display-buffer'; `find-file-other-window'
does call `display-buffer'. (I just checked by enabling Edebug in
display-buffer.)

`find-file' calls `switch-to-buffer' which calls `pop-to-buffer'.

The same is true for all the other "put a buffer in this window"
user level functions I've encountered.

`display-buffer-same-window' is an action for `display-buffer'.

Ah! We could change the implementation of `find-file' to use
`display-buffer' with an action of `display-buffer-same-window'; that
action would be changed by prefix C-x 4 or C-x 5.

`find-file-other-window' could then be implemented by setting
`display-buffer-overriding-action' and calling `find-file'.
 
That would make sense, and should be mostly transparent to users. All
the other similar functions would have to be changed in a similar way -
I haven't tried to enumerate them. We could implement C-x 4 and 5 for
the current uses of `display-buffer' first, and see how people like it.

-- 
-- Stephe



reply via email to

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