Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Weird Emacs highlighting problem

Tags:

emacs

Hi I'm new to emacs on the mac and i mistakenly pressed a couple of wrong buttons that caused some lines of text to highlight pink (see below).

Is there a way i can get rid of this highlighting? What exactly is it?

enter image description here

like image 510
locoboy Avatar asked Oct 20 '25 03:10

locoboy


2 Answers

This is almost certainly caused by the dreaded "Secondary Selection." You likely did this by performing the command M-Drag-mouse-1 (i.e. accidentally holding down alt while selecting text with the mouse).

One of the highlights (if you'll excuse the pun) of reading the Emacs manual was figuring out exactly what this was and (more importantly) how to get rid of it: M-mouse-1 anywhere in any frame will clear the secondary selection overlay. Alternatively, this post points out that running the function (delete-overlay mouse-secondary-overlay) will also clear the highlight.

like image 168
D. Gillis Avatar answered Oct 22 '25 03:10

D. Gillis


For me it looks like you have hit Ctrl+SPC. Thist stands for set-mark-command. Try pressing Ctrl+G.

like image 33
Rajish Avatar answered Oct 22 '25 03:10

Rajish