I have a ThinkPad with a trackpad, and emacs exits from C-s and also from interactive replace using M-%, whenever I brush my hand over the trackpad while touch-typing - which happens far too often. With my previous laptop I worked around this problem by disabling the trackpad completely, but I can't do that here because the trackpad is an important fallback for when my erratic Bluetooth mouse stops working. How can I make C-s and M-% ignore touchpad scrolling?
UPDATE: It's not caused by mouse movement as I originally thought, but by mouse scrolling, or something even more obscure. From C-h l
I can see that emacs is interpreting my brushing the touchpad as mouse-4/5/6/7, so I've tried
(global-set-key (kbd "<mouse-4>") (lambda () (interactive)))
(global-set-key (kbd "<mouse-5>") (lambda () (interactive)))
(global-set-key (kbd "<mouse-6>") (lambda () (interactive)))
(global-set-key (kbd "<mouse-7>") (lambda () (interactive)))
but that doesn't fix the problem, it just stops emacs complaining.
M-%
, is the problem when entering the search query and replacement text, or only at the “query replacing …” prompt? Are you running Emacs in a terminal or a GUI, which version, and on which OS? TypeC-s
, then move the mouse just enough to exit incremental search, and typeC-h l
; this shows the last input that Emacs received from the OS. Copy-paste the part afterC-s
. – Gilles 'SO- stop being evil' Mar 14 '16 at 19:52emacs -Q
(no init file) or mention whatever libraries etc. are needed to reproduce the problem. – Drew Mar 14 '16 at 20:22