[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: The window-pub branch
From: |
grischka |
Subject: |
Re: The window-pub branch |
Date: |
Fri, 19 Nov 2010 14:38:13 +0100 |
User-agent: |
Thunderbird 2.0.0.23 (Windows/20090812) |
martin rudalics wrote:
> One exception is still an exception. Why do you need it?
Because `switch-to-buffer' is special.
Then what about
(defun switch-to-buffer (b) (display-buffer b 'special))
>> `set-window-buffer' can't be rewritten, for obvious reasons.
>
> Why not? You could rename the current low-level one to
> "set-window-buffer-internal".
`set-window-buffer' _is_ low-level. Emacs needs some mechanism to
bypass whatever people do in `my-display-buffer'.
Saying "Emacs" you insist on the absence of architecture. Maybe
you agree that direct access of application code to functions such
as 'split-window' and 'set-window-buffer' doesn't play well with
any attempts to wrap them into more user-friendly behavior.
Where a "wrapper" is a piece of code with exclusive access to the
functionality that it wraps. There must be no way to bypass the
wrapper except for the wrapper itself.
There's no single entry point for "hiding a buffer". The nearest
equivalent is probably `switch-to-prev-buffer'. But sometimes the
window gets deleted before and in the worst case *scratch* must be
recreated to show some buffer in the window.
I'm not interested in the details of existing bugs. I'm only
interested whether your new design is able to get past them.
Note that `display-buffer' and a hypothetical `undisplay-buffer' would
not be not orthogonal. It's hardly possible to tell whether a buffer
shown in a window was effectively put there by `display-buffer' or by
`set-window-buffer'.
One more point for not allowing applications to mess with
'set-window-buffer' (and friends).
> Also, while we're at it: I think I want hooks for "select-window",
> "set-window-buffer" and finally "split-window", too.
The latter two call `window-configuration-change-hook'. The easiest
thing would be to call that for `select-window' too. The problem is
that all these hooks don't provide much information about the window
configuration before the split, selection, ...
Sure, problems ... ;)
However it's not that there aren't ways to solve them. Such as
from Xlib manual:
"A feature called substructure redirect allows a window manager to
intercept any requests to map, move, resize, or change the border
width of windows. This allows the window manager to modify these
requests, if necessary, to ensure that they meet its window layout
policy."
Which in other words means a single hook that is sufficient for
everything a window-manager might want to do.
martin
- Re: The window-pub branch, grischka, 2010/11/18
- Re: The window-pub branch, martin rudalics, 2010/11/18
- Re: The window-pub branch, grischka, 2010/11/18
- Re: The window-pub branch, martin rudalics, 2010/11/19
- Re: The window-pub branch,
grischka <=
- Re: The window-pub branch, martin rudalics, 2010/11/19
- Re: The window-pub branch, grischka, 2010/11/19
- Re: The window-pub branch, martin rudalics, 2010/11/20
- Re: The window-pub branch, grischka, 2010/11/20
- Re: The window-pub branch, martin rudalics, 2010/11/20
- Re: The window-pub branch, grischka, 2010/11/20
- Re: The window-pub branch, martin rudalics, 2010/11/21
- Re: The window-pub branch, grischka, 2010/11/21
- Re: The window-pub branch, martin rudalics, 2010/11/21
- Re: The window-pub branch, Stefan Monnier, 2010/11/21