emacs-devel
[Top][All Lists]
Advanced

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

Re: Zoom: a window management minor mode -- best practices and questions


From: Eli Zaretskii
Subject: Re: Zoom: a window management minor mode -- best practices and questions
Date: Wed, 02 May 2018 21:58:18 +0300

> From: Andrea Cardaci <address@hidden>
> Date: Wed, 2 May 2018 20:41:38 +0200
> Cc: address@hidden
> 
> The handler should be triggered in these cases:
> - a window is resized;

This is the one I mentioned as missing.

> - a window is selected;

Hooking select-window will take care of this one.

> - a window is created (this is actually included in the "a window is resized" 
> case);

If you mean that the selected window is resized as result of creating
a new window, then yes, "window is resized" takes care of this.  (What
about deleting a window, btw?)

> - a window changes its buffer (because it's possible to exclude certain 
> windows from zooming so the layout
> should be updated accordingly).

The hook suggested by Martin should take care of this.

> Besides, doesn't this in principle suffer of the same 
> do-something-that-triggers-the-hook-inside-such-hook
> problem like `window-size-change-functions`?

No, because pre-redisplay-functions are run _before_ anything
significant in redisplay, so your chances to confuse redisplay are
nil.

> > Alternatively, we could provide some control to disable resizing of
> > the selected window
> 
> Please elaborate on this point. How can it help this situation?

Well, as you said, the main purpose of Zoom is to prevent resizing of
the selected window due to Emacs's own considerations.  My
interpretation of this was that you want to control the size of the
selected window, and disallow anything else changing it.  So if you
change the size at select-window time, and the size is not allowed to
change after that, you have reached your purpose, right?



reply via email to

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