5

Recently, I change my laptop from old Thinkpad to newer laptop with much larger touchpad. I've found that I frequently touch the sensitive touchpad while I'm using emacs. And with some mysterious combination, very often there will be a highlight appear on the emacs buffer. The highlight is persist. Cannot be removed by navigating cursor or mouse click. It's not emacs selection mark. The only way I can remove it is to close the buffer and reload the file.

This is very annoying. Anybody know what is it, how to remove it, and best if I can prevent it from occur in the first place.

enter image description here

8

It's the secondary selection. Clicking and dragging sets the primary selection, and middle click pastes from that selection. Holding alt while clicking and dragging sets the secondary selection, and M-mouse-2 pastes from it. Very few applications use the secondary selection any more, but it's quite handy when you have two things to copy and paste. See section 12.3.3 Secondary Selection in the Emacs manual for more information.

There's no command to cancel the secondary selection, but if you left-click with Alt (M-mouse-1), it'll make the secondary selection empty.

| improve this answer | |
  • 1
    Just alt + click again somewhere, that selection mark will goes away. Thanks a lot. – Sake Jun 3 at 8:11
  • Please consider adding the info in @Sake's comment to the answer. (Comments can be deleted at any time.) – Drew Jun 3 at 16:31
1

I use package disable-mouse:

(package-install "use-package") ; once, if not already installed

(require 'use-package)
(use-package disable-mouse
    :ensure t
    :diminish disable-mouse-global-mode
    :commands global-disable-mouse-mode
    :init (global-disable-mouse-mode))
| improve this answer | |

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.