bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#32672: 27.0.50; image resize on window resizing


From: martin rudalics
Subject: bug#32672: 27.0.50; image resize on window resizing
Date: Sun, 23 Sep 2018 10:26:37 +0200

>> Shouldn't you debounce the call to 'image-size-buffer-change' as well?
>> After all, the buffer list seems to change more often than the size of
>> windows.
>
> When I tried debounce for buffer-list-update-hook, it used the last call
> in sequence:
>
> 1 ... current: *scratch* ... window-buffer: *scratch*
> 2 ... current: *scratch* ... window-buffer: *info*
>
> that was unsuitable for the logic of 'image-size-buffer-change'.

I'm afraid that 'buffer-list-update-hook' is too coarse for your
purpose - it gets called too often for unrelated events like creating
or killing some completely unrelated buffer.  If you think that
running a hook after selecting a window with NORECORD nil would fit
the bill better, let's try it.  Many people have asked for such a hook
and we always rejected it (Bug#7381, Bug#16436).  Maybe it is time to
reconsider.

> So maybe instead of 'debounce', we need to implement and use 'throttle'
> or at least implement the 'immediate' option that uses the first call:
>
> https://css-tricks.com/debouncing-throttling-explained-examples/

We'd probably need to come up with examples from our code base in
order to decide what to implement and how.

martin





reply via email to

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