|
From: | Joost Kremers |
Subject: | Re: Is it ok to use (redisplay), or should this be left to the experts? |
Date: | Tue, 12 Feb 2019 00:27:09 +0100 |
User-agent: | mu4e 1.1.0; emacs 26.1 |
Hi Stefan, Sorry about the late reply... On Thu, Jan 10 2019, Stefan Monnier wrote:
The problem is that although full screen is activated before calculating the text width, (window-total-width) still reports the window width that existedbefore full screen was activated.Adding a call to `redisplay` is fine to handle such cases.This said, it may be insufficient (e.g. the window-manager may actuallyexecute the full-screen request asynchronously).I think a better solution is to use window-size-change-functions in order to detect when the window-total-width changes and only change thetext width at that point.
The new text width only needs to be calculated once, so if I solve this with a function in `window-size-change-functions', the function would need to remove itself from that hook again. I guess it's feasible to call remove-hook inside the function, right?
-- Joost Kremers Life has its moments
[Prev in Thread] | Current Thread | [Next in Thread] |