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

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

Re: Is it ok to use (redisplay), or should this be left to the experts?


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:43:24 +0100
User-agent: mu4e 1.1.0; emacs 26.1


On Fri, Jan 11 2019, Eli Zaretskii wrote:
It seems that a call to (redisplay) also does the trick, but I'm hesitant to add this, because, well, I'm not sure why, exactly, it's just that I'm not entirely sure when, i.e., in what circumstances, (redisplay) is meant to be used, what side effects to watch out for (in any), etc.

There should be no problem with invoking 'redisplay', it just slows down the program a bit, especially if the code in question will or
might be executed frequently.

It's only called once, when the relevant minor mode is activated for the first time, so that shouldn't be an issue.

 However, sit-for is IMO better, because
in some use cases you must allow for the window manager to respond to the full-screen request and for Emacs to receive a notification from
the window manager.  And that means waiting for some short time.

An unpredictable amount of time, I guess. Although it's unlikely to be very long, if I handle the problem by introducing an artificial delay, it would have to be long enough to handle the slowest of slow computers. Which might be a noticeable delay, which would inconvenience everyone else...

So I guess what I'm asking is whether someone can tell me whether (redisplay) is the right way to deal with this issue, or whether there is a better way. Or perhaps the user is SOL and needs to do some local configuration to get things to behave?

I cannot answer this because it isn't clear to me who initiated
full-screen: the user or the package. If it's the package, then the package should also accommodate these issues, perhaps only when the
frame size changes significantly.

Yes, it's the package that initiates full-screen. And I suspect that in most cases, it will be a significant size-change.

So I'm leaning toward Stefan's proposed solution, which is to use `window-size-change-functions'...

Thanks,

--
Joost Kremers
Life has its moments



reply via email to

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