unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Jonathan Kotta <jpkotta@gmail.com>
To: 23810@debbugs.gnu.org
Subject: bug#23810: avoid.el: mouse-avoidance-ignore-p does not ignore file-notify events
Date: Mon, 20 Jun 2016 12:41:36 -0500	[thread overview]
Message-ID: <CALDneat65EdxYCvDxpPmXHwOvkN=18mEmcF-f-mgyk=8HB25Rw@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1333 bytes --]

I use mpd and ncmpcpp.  mpd allows sending sound data to a fifo, and
ncmpcpp can read from that fifo and do sound visualizations with the data.
So when mpd is playing, it is constantly writing to the fifo and generating
file-notify events.  I'm not entirely sure why Emacs is receiving these
events, but it is, and it causes mouse avoidance to kick in without
typing.  I can't reproduce the the problem reliably, but it occurs
regularly.  The attached patch fixes it for me, and it just makes sense for
mouse-avoidance-ignore-p to ignore file-notify events.  I'm not sure if
there are additional types of events that it should also ignore; I couldn't
find an exhaustive list of all the event types.

diff --git a/lisp/avoid.el b/lisp/avoid.el
index 3d43539..e42e08a 100644
--- a/lisp/avoid.el
+++ b/lisp/avoid.el
@@ -335,7 +335,7 @@ redefine this function to suit your own tastes."
      (let ((modifiers (event-modifiers (car last-input-event))))
        (or (memq (car last-input-event)
  '(mouse-movement scroll-bar-movement
-   select-window focus-out))
+   select-window focus-out file-notify))
    (memq 'click modifiers)
    (memq 'double modifiers)
    (memq 'triple modifiers)


-- 
Thanks,

Jonathan Kotta

Hofstadter's Law:
    It always takes longer than you expect, even
    when you take into account Hofstadter's Law.

[-- Attachment #2: Type: text/html, Size: 2125 bytes --]

             reply	other threads:[~2016-06-20 17:41 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-20 17:41 Jonathan Kotta [this message]
2017-05-04 16:54 ` bug#23810: avoid.el: mouse-avoidance-ignore-p does not ignore file-notify events Jonathan Kotta
2017-05-05  0:42   ` npostavs

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CALDneat65EdxYCvDxpPmXHwOvkN=18mEmcF-f-mgyk=8HB25Rw@mail.gmail.com' \
    --to=jpkotta@gmail.com \
    --cc=23810@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).