If you don't use click-to-focus, Emacs can gain and lose focus every time
you move the mouse, even inadvertently.  It would be very bad for this to
have any lasting effect.  I think such hooks should not exist.


Hello, Dr. Stallman.

Thank you for your thoughtful feedback.

I agree that it may not make sense for users in focus-follows-mouse
environments to use these hooks.  I don't think it follows that these
hooks should not exist.  They default to nil -- people who don't want
them don't have to use them.

There is a large class of programmers (web developers) who expect their
editor to *be able* to behave this way.  True, they will need to take
responsibility not to break their environments by abusing these hooks,
but Emacs already requires a degree of responsibility from those
configuring it.

Perhaps I am misunderstanding how hooks are run?  I have assumed that
running a nil hook is a no-op.  If not, perhaps we can add a check to
the C event handler and call Frun_hooks only if the hook has been set?

I'm not trying to force anyone to run lisp on focus change.  I'm hoping
to encourage wider use of Emacs in the web development communities.

Best,
Brian Jenkins