1

Some programs, like many terminal emulators and gVim, hide the mouse pointer as soon as the keyboard is in use. Obviously, this is helpful when the mouse pointer happens to obscure some text behind it.

Is there a way to make Emacs do the same? (Running version 26.0 in X under Linux, if that makes any difference.)

  • Oh, just realised, it does hide the mouse pointer, but only when inserting characters, not when merely moving the cursor or doing anything else with the keyboard. I’ll make this a wiki answer. – Amir Jul 19 '17 at 19:26
2

You can use the mouse-avoidance-mode, see here for documentation.

To test it simply enter M-x mouse-avoidance-mode and then select an option (see documentation link above)

To have it permanently use M-x customize-group RET avoid RET. Then set it up and save it.

1

As pointed out in the Emacs manual, by default “Emacs hides the mouse pointer each time you type a self-inserting character” (emphasis mine).

If hiding only on self-inserting characters is not enough, customize mouse-avoidance-mode and set it to banish, which will force the mouse pointer to a corner of the frame on any keystroke.

1

You can use

(setq make-pointer-invisible t)
  • This is already the default, and will only hide the pointer when typing a “self-inserting character”. – Amir Jul 23 '17 at 9:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.