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: Andrea Cardaci
Subject: Re: Zoom: a window management minor mode -- best practices and questions
Date: Mon, 7 May 2018 14:32:28 +0200

> > Otherwise, I would use 'buffer-list-update-hook' instead of advising
> > 'select-window' to make sure that all occurences of selecting a window
> > get caught.  And I would experimentally try to not zoom immediately in
> > 'buffer-list-update-hook' and 'window-configuration-change-hook' but
> > simply feed these occurrencs to 'pre-redisplay-function' to reduce the
> > number of times you zoom.  'window-pixel-height-before-size-change'
> > and 'window-pixel-width-before-size-change' should allow to easily do
> > the 'window-size-change-functions' part in 'pre-redisplay-function' as
> > well.  Though my personal experiences with 'pre-redisplay-function'
> > are not bright enough to recommend it for sure.
>
> I will try this approach, thanks.

I've been trying this, I like the separation between checking whether
a relayout is needed or not and the actual relayout.

There's one problem with `buffer-list-update-hook` though, it gets
called (multiple times) even wen the buffer list is not changed, e.g.,
simply by clicking in the buffer. Is this the expected behaviour?

Besides this, if there's no way to get rid of false positives in event
handling (i.e., a relayout is triggered but no actual change happened)
I guess I need a way to decide if a relayout is *really* needed. A
naive way would be saving the current window and buffer but I'm not
sure if we can do better.

Also, oddly enough, `pre-redisplay-function` is never called on macOS
(Emacs 26.1)...



reply via email to

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