You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Just to note that the focus in and out hooks seem to be depreciated in 27.1. I think that the after-focus-change-function was only introduced in 27.1 so might need an if on version number to support that.
Note that it still seems to work on 28 but just throws a warning.
New frame focus state inspection interface.
The hooks 'focus-in-hook' and 'focus-out-hook' are now obsolete.
Instead, attach to 'after-focus-change-function' using 'add-function'
and inspect the focus state of each frame using 'frame-focus-state'. https://www.masteringemacs.org/article/whats-new-in-emacs-27-1
The text was updated successfully, but these errors were encountered:
Indeed, after-focus-change is supposed to be "more accurate" in terms of when it fires (apparently, focus-{in,out}-hook had some problems where it would trigger in situations where no obvious user-facing focus action had taken place). It is, however, much more manual to use; we'd have to check each individual frame for its focus state and then decide what to do based on that.
It's still not removed in Emacs 29 yet (last compiled approximately a week ago) and with Emacs generally having quite a long "grace period" for these kinds of things, I think the current solution will continue to "work" for quite a while. Still, if someone wanted to convert it to use the new interface I would certainly not object!
Hi,
Just to note that the focus in and out hooks seem to be depreciated in 27.1. I think that the after-focus-change-function was only introduced in 27.1 so might need an if on version number to support that.
Note that it still seems to work on 28 but just throws a warning.
The text was updated successfully, but these errors were encountered: