unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Zoom: a window management minor mode -- best practices and questions
@ 2018-05-02 16:31 Andrea Cardaci
  2018-05-02 17:32 ` Eli Zaretskii
  0 siblings, 1 reply; 23+ messages in thread
From: Andrea Cardaci @ 2018-05-02 16:31 UTC (permalink / raw)
  To: emacs-devel; +Cc: Eli Zaretskii

[-- Attachment #1: Type: text/plain, Size: 2097 bytes --]

Hi,

This is a follow-up discussion for a bug I reported (
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=31312), since the
conversation was moving away from the bug itself I'm starting a new thread
as suggested by Eli.

> In that case, could you explain in more detail what zoom.el attempts
> to do

Zoom (https://github.com/cyrus-and/zoom) aims to enforce a fixed window
layout so that the selected window is always *big enough*. I think the
screencast at the project page is quite clear about the usage.

The implementation is very simple, every time a window change is *detected*
the following happens:
1. `balance-windows` is called;
2. the selected window is resized.

This, in practice, has the effect of disabling the manual resizing of
windows.

The problem is that to implement the "every time a window change is
detected" part I currently hook several functions, specifically:

    (add-hook 'window-size-change-functions #'zoom--handler)
    (advice-add #'select-window :after #'zoom--handler)

This is clearly an hack-ish solution but Zoom works fairly well most of the
times. On the other thread Martin suggested to replace `advice-add` with an
hook to `buffer-list-update-hook`, but the main issue remains that
`zoom--handler` actually resizes windows in the
`window-size-change-functions` hook.

Moreover, this solution causes the handler to be called several times and
most of them are useless. (Additional guards can be added but still...)

> and what does it need from Emacs core to be able to do that?

My knowledge of the Emacs internals is quite limited but at the highest
level of abstraction what AFAIK is missing is a way to enforce custom
window layouts and manage the windows size. This part seems quite fragile /
extremely hard to work with (just look at the implementation of
`balance-windows`). In addition to that there are some features that
further complicate the situation, e.g., side windows and not resizable
windows.

Said that, I'm definitely not in a position to make any feature requests
but I would appreciate any feedback or suggestions.


Thanks,

Andrea

[-- Attachment #2: Type: text/html, Size: 3905 bytes --]

^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2018-05-10 10:37 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-05-02 16:31 Zoom: a window management minor mode -- best practices and questions Andrea Cardaci
2018-05-02 17:32 ` Eli Zaretskii
2018-05-02 18:41   ` Andrea Cardaci
2018-05-02 18:58     ` Eli Zaretskii
2018-05-03  7:11       ` martin rudalics
2018-05-03  9:50         ` Andrea Cardaci
2018-05-03  9:46       ` Andrea Cardaci
2018-05-03  7:11     ` martin rudalics
2018-05-03  9:47       ` Andrea Cardaci
2018-05-07 12:32         ` Andrea Cardaci
2018-05-07 18:19           ` Eli Zaretskii
2018-05-08 10:40             ` Andrea Cardaci
2018-05-08 14:53               ` Noam Postavsky
2018-05-08 15:03                 ` Andrea Cardaci
2018-05-09 12:33                 ` Stefan Monnier
2018-05-08 17:52               ` Eli Zaretskii
2018-05-09  7:00           ` martin rudalics
2018-05-09 16:06             ` Andrea Cardaci
2018-05-10  6:27               ` martin rudalics
2018-05-10 10:11                 ` Andrea Cardaci
2018-05-10 10:27                   ` martin rudalics
2018-05-10 10:34                     ` Andrea Cardaci
2018-05-10 10:37                       ` martin rudalics

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).