goofansu
goofansu

Reputation: 2277

Is there anyway to disable mouse prompt?

I disabled mouse scrolling with (mouse-wheel-mode -1), but when I drag mouse or click mouse, there will warnings like "triple-mouse-4 is undefined", "mouse-3 is undefined" etc.

Is there anyway to disable these prompt as it's very annoying.

FYI, I'm using Emacs 24.3 with X11 in OS X Mavericks

Upvotes: 2

Views: 387

Answers (1)

sho
sho

Reputation: 56

Define them as 'ignore.

(dolist (k mwheel-installed-bindings)
  (global-set-key k 'ignore))

If you want to disable only mouse scrolling, the following code is better than (mouse-wheel-mode -1)

(substitute-key-definition 'mwheel-scroll 'ignore global-map)

If you want to disable mouse key bindings, see the code at Disable mouse clicks in Emacs (but (global-set-key k 'ignore) instead of (global-unset-key k))

The following advice also solves the problem. It disables all messages shown by undefined. Here I use the macro noflet provided by the package noflet. Please install noflet by package-install. Since noflet is very powerful, I think the solution above is more safe.

(require 'noflet)
(defadvice undefined (around no-message activate)
  (noflet ((message (msg &rest args)))
    ad-do-it))

Upvotes: 4

Related Questions