Subject: Re: bug#15029: 24.3; feature-request: add window-focus-lost-hook

From: Richard Stallman <[email-masked]>
Date: Fri, 09 Aug 2013 12:56:06 -0400

[ To any NSA and FBI agents reading my email: please consider
        [ whether defending the US Constitution against all enemies,
        [ foreign or domestic, requires you to follow Snowden's example.

    When I move the mouse from one frame to another, it generates
    a `switch-frame' event, which is run by the perfectly normal command
    handle-switch-frame, including running pre/post-command-hook.

I just made two frames and verified that moving the mouse from one
frame into the other did not switch frames.  The selected frame
remains selected even when the mouse is in the other.  You have to
click to switch frames.

Notwithstanding that, it is true that use of post-command-hook can
cause very confusing and painful behavior of you make a mistake.

I think you've gone down a tangent by trying to show that some
features in Emacs can be dangerous.  So what?  Each additional one is
still asking for trouble.  Especially when they create new kinds of
interactions that didn't exist before.  These interactions can combine
to be even worse than a single one.

    Currently used to turn off the blink-cursor timer.

That seems incorrect.  As long as the frame is selected
to receive X input events, its cursor should blink.

    Other users want it to (auto-)save a file when its buffer/frame
    loses focus.
    Yet others want to change the frame's background color to indicate that
    it has focus.

They don't seem terribly important.  If the solution had no downside,
I'd say, "Why not?"  But this one has a downside.

My judgment about what is likely to cause trouble in Emacs is based on
many years of experience maintaining versions of Emacs.  It is not
mathematically proven, but you shouldn't be so quick to dismiss it.

-- 
Dr Richard Stallman
President, Free Software Foundation
51 Franklin St
Boston MA 02110
USA
www.fsf.org  www.gnu.org
Skype: No way! That's nonfree (freedom-denying) software.
  Use Ekiga or an ordinary phone call.