How did some of my text get highlighted with a magenta background? The Next CEO of Stack OverflowUnable to disable binding defined by undo-treeEmacs 24 keybindings for texWhat datatype is accepted by the last argument of the define-key function?What key sequence is killing a large chunk of my buffer?Is it possible to cancel a key combination half way through?How to find out what command I just accidentally ran with a keyboard shortcut?rebind C-RET in cua-mode to a different key?How to troubleshoot a key binding prompting for more key presses?How to bind mouse click to kill an inactive window, but not the bufferHow can I press a key combination including CTRL and ALT_GR on a Swedish keyboard?
AB diagonalizable then BA also diagonalizable
Can Sneak Attack be used when hitting with an improvised weapon?
Easy to read palindrome checker
Reference request: Grassmannian and Plucker coordinates in type B, C, D
Help understanding this unsettling image of Titan, Epimetheus, and Saturn's rings?
How many extra stops do monopods offer for tele photographs?
What CSS properties can the br tag have?
Would a grinding machine be a simple and workable propulsion system for an interplanetary spacecraft?
Is there such a thing as a proper verb, like a proper noun?
Why is the US ranked as #45 in Press Freedom ratings, despite its extremely permissive free speech laws?
(How) Could a medieval fantasy world survive a magic-induced "nuclear winter"?
Is "three point ish" an acceptable use of ish?
Is there a way to save my career from absolute disaster?
How to Implement Deterministic Encryption Safely in .NET
Are the names of these months realistic?
Computationally populating tables with probability data
Does Germany produce more waste than the US?
Do scriptures give a method to recognize a truly self-realized person/jivanmukta?
Do I need to write [sic] when including a quotation with a number less than 10 that isn't written out?
Can I use the word “Senior” as part of a job title directly in German?
IC has pull-down resistors on SMBus lines?
Expressing the idea of having a very busy time
Can you teleport closer to a creature you are Frightened of?
what's the use of '% to gdp' type of variables?
How did some of my text get highlighted with a magenta background?
The Next CEO of Stack OverflowUnable to disable binding defined by undo-treeEmacs 24 keybindings for texWhat datatype is accepted by the last argument of the define-key function?What key sequence is killing a large chunk of my buffer?Is it possible to cancel a key combination half way through?How to find out what command I just accidentally ran with a keyboard shortcut?rebind C-RET in cua-mode to a different key?How to troubleshoot a key binding prompting for more key presses?How to bind mouse click to kill an inactive window, but not the bufferHow can I press a key combination including CTRL and ALT_GR on a Swedish keyboard?
I pressed some combination of letters by mistake and part of my Python buffer got a purple background color (or magenta, fuschia, violet, orchid, depending on knowledge of colors).
The only way I found to undo it is to restart Emacs. How can I undo it otherwise?
key-bindings
add a comment |
I pressed some combination of letters by mistake and part of my Python buffer got a purple background color (or magenta, fuschia, violet, orchid, depending on knowledge of colors).
The only way I found to undo it is to restart Emacs. How can I undo it otherwise?
key-bindings
2
This looks like it could be a misfired secondary selection, though its color is yellow by default. Does clicking the left mouse button while holdingAlt
make it go away?
– undercat
8 hours ago
1
You can usewhat-cursor-position
C-u C-x =
while cursor stay in the area. It will tell you what font face that area is using right now, then you can find out what feature you enabled.
– Rangi Lin
7 hours ago
add a comment |
I pressed some combination of letters by mistake and part of my Python buffer got a purple background color (or magenta, fuschia, violet, orchid, depending on knowledge of colors).
The only way I found to undo it is to restart Emacs. How can I undo it otherwise?
key-bindings
I pressed some combination of letters by mistake and part of my Python buffer got a purple background color (or magenta, fuschia, violet, orchid, depending on knowledge of colors).
The only way I found to undo it is to restart Emacs. How can I undo it otherwise?
key-bindings
key-bindings
edited 26 mins ago
Drew
49k463107
49k463107
asked 10 hours ago
mmorinmmorin
2248
2248
2
This looks like it could be a misfired secondary selection, though its color is yellow by default. Does clicking the left mouse button while holdingAlt
make it go away?
– undercat
8 hours ago
1
You can usewhat-cursor-position
C-u C-x =
while cursor stay in the area. It will tell you what font face that area is using right now, then you can find out what feature you enabled.
– Rangi Lin
7 hours ago
add a comment |
2
This looks like it could be a misfired secondary selection, though its color is yellow by default. Does clicking the left mouse button while holdingAlt
make it go away?
– undercat
8 hours ago
1
You can usewhat-cursor-position
C-u C-x =
while cursor stay in the area. It will tell you what font face that area is using right now, then you can find out what feature you enabled.
– Rangi Lin
7 hours ago
2
2
This looks like it could be a misfired secondary selection, though its color is yellow by default. Does clicking the left mouse button while holding
Alt
make it go away?– undercat
8 hours ago
This looks like it could be a misfired secondary selection, though its color is yellow by default. Does clicking the left mouse button while holding
Alt
make it go away?– undercat
8 hours ago
1
1
You can use
what-cursor-position
C-u C-x =
while cursor stay in the area. It will tell you what font face that area is using right now, then you can find out what feature you enabled.– Rangi Lin
7 hours ago
You can use
what-cursor-position
C-u C-x =
while cursor stay in the area. It will tell you what font face that area is using right now, then you can find out what feature you enabled.– Rangi Lin
7 hours ago
add a comment |
3 Answers
3
active
oldest
votes
There's too little information in the question to be sure, so I can't definitively answer what happened. Rather I'll show how to investigate this and give some plausible cases.
I pressed some combination of letters by mistake
Once you realize that, press F1 l
or C-h l
(that's lowercase ell) to invoke the command view-lossage
. This displays the last 300 keys you pressed as well as other input events such as mouse clicks. Since Emacs 25, this also shows the commands that they invoked. In earlier versions, you have to use C-h k
to find what command a key or key sequence invokes, and that can give wrong results if you've changed some setting or moved to some buffer since that event, or for mouse events if you click in a different place.
If Emacs is behaving strangely, check the mode line (the line just above the bottom line, or at the bottom of the current window, that displays information such as the file name and line number) and the minibuffer (the line at the bottom where commands prompt for input). Maybe you switched to the buffer while some command (e.g. a search) was in progress? If the mode indication in the mode line has square brackets around the parentheses (e.g. [(Python …)]
instead of the normal (Python …)
), it means that a recursive edit is in progress, i.e. some command lets you edit the buffer. To exit the recursive edit and resume the command that started it, press C-M-c
. To exit the recursive edit and abort the command that started it, press C-]
or ESC ESC ESC
. If there's a prompt in the minibuffer, click there to switch back to that prompt.
If you want to know why a particular character is in a particular color or font, move the cursor to that character and run M-x describe-text-properties
. This command is also available from the menu ‘Edit’ → ‘Text Properties’ → ‘Describe Properties’ or C-mouse-2
‘Text Properties’ → ‘Describe Properties’. Typically text formatting is done through faces and the face's documentation should at least indicate which package is responsible for it.
The command M-x list-faces-display
(available as ‘Display Faces’ in the ‘Text Properties’ menu) shows the available faces. With the default light background theme, two faces use a purple background that matches the image in your question: isearch
and query-replace
, both used to highlight matching text during a search command. I don't know how you could have reached that my mistake, but based on the colors, it's the most plausible scenario.
Emacs has a built-in package to highlight things temporarily. It leaves a discrete clue in the modeline: the minor mode indicator Hi
.
Although anything could happen depending on what packages you have installed, highlighting is likely to be a per-buffer configuration. So if you can't figure out what's going on, it should be enough to close the file and reopen it.
add a comment |
The face of the highlighted text could be face secondary-selection
, although that has a yellow background by default.
You can tell what the face is by putting your cursor on a highlighted character and hitting C-u C-x =
. Near the bottom of buffer *Help*
describing that character it tells you what face is used.
If that's the case then you probably used the M-
(Meta key) modifier while dragging the mouse with the first mouse button (<mouse-1>
) pressed, and then released. (That makes the secondary selection empty.)
To get rid of it just hold the Meta key and click <mouse-1>
(without dragging it).
(If this is in fact the answer then please add tags secondary-selection
and mouse
to the question.)
add a comment |
On second thought, I'm guessing that you used Isearch, query-replace or hi-lock
. The default face for Isearch and query-replace, face isearch
, looks just like the highlighting you show.
Isearch highlighting appears when you search using C-s
, C-r
, C-M-s
, or C-M-r
. Query-replace highlighting appears when you use use M-%
or C-M-%
. Normally this search highlighting disappears when you're done with the command, but things can get "stuck".
Hi-lock highlighting appears when you use a hi-lock command, such as hi-lock-line-face-buffer
or hi-lock-face-buffer
(aka highlight-regexp
). Hi-lock commands are on prefix key C-x w
, by default.
Such commands either read a face name or automatically use the next face. If you previously used Isearch then the face chosen could easily be face isearch
, which looks like what you show. Hi-lock highlighting persists after the command that causes the highlighting. My guess would be that you used hi-locking, perhaps without realizing it.
If you see submenu Regexp Highlighting
in the menu-bar Edit
menu then hi-lock-mode
is on, and this is probably the explanation.
To get rid of hi-lock highlighting you can usually just turn off hi-lock-mode
by repeating that toggle command.
add a comment |
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "583"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2femacs.stackexchange.com%2fquestions%2f48676%2fhow-did-some-of-my-text-get-highlighted-with-a-magenta-background%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
There's too little information in the question to be sure, so I can't definitively answer what happened. Rather I'll show how to investigate this and give some plausible cases.
I pressed some combination of letters by mistake
Once you realize that, press F1 l
or C-h l
(that's lowercase ell) to invoke the command view-lossage
. This displays the last 300 keys you pressed as well as other input events such as mouse clicks. Since Emacs 25, this also shows the commands that they invoked. In earlier versions, you have to use C-h k
to find what command a key or key sequence invokes, and that can give wrong results if you've changed some setting or moved to some buffer since that event, or for mouse events if you click in a different place.
If Emacs is behaving strangely, check the mode line (the line just above the bottom line, or at the bottom of the current window, that displays information such as the file name and line number) and the minibuffer (the line at the bottom where commands prompt for input). Maybe you switched to the buffer while some command (e.g. a search) was in progress? If the mode indication in the mode line has square brackets around the parentheses (e.g. [(Python …)]
instead of the normal (Python …)
), it means that a recursive edit is in progress, i.e. some command lets you edit the buffer. To exit the recursive edit and resume the command that started it, press C-M-c
. To exit the recursive edit and abort the command that started it, press C-]
or ESC ESC ESC
. If there's a prompt in the minibuffer, click there to switch back to that prompt.
If you want to know why a particular character is in a particular color or font, move the cursor to that character and run M-x describe-text-properties
. This command is also available from the menu ‘Edit’ → ‘Text Properties’ → ‘Describe Properties’ or C-mouse-2
‘Text Properties’ → ‘Describe Properties’. Typically text formatting is done through faces and the face's documentation should at least indicate which package is responsible for it.
The command M-x list-faces-display
(available as ‘Display Faces’ in the ‘Text Properties’ menu) shows the available faces. With the default light background theme, two faces use a purple background that matches the image in your question: isearch
and query-replace
, both used to highlight matching text during a search command. I don't know how you could have reached that my mistake, but based on the colors, it's the most plausible scenario.
Emacs has a built-in package to highlight things temporarily. It leaves a discrete clue in the modeline: the minor mode indicator Hi
.
Although anything could happen depending on what packages you have installed, highlighting is likely to be a per-buffer configuration. So if you can't figure out what's going on, it should be enough to close the file and reopen it.
add a comment |
There's too little information in the question to be sure, so I can't definitively answer what happened. Rather I'll show how to investigate this and give some plausible cases.
I pressed some combination of letters by mistake
Once you realize that, press F1 l
or C-h l
(that's lowercase ell) to invoke the command view-lossage
. This displays the last 300 keys you pressed as well as other input events such as mouse clicks. Since Emacs 25, this also shows the commands that they invoked. In earlier versions, you have to use C-h k
to find what command a key or key sequence invokes, and that can give wrong results if you've changed some setting or moved to some buffer since that event, or for mouse events if you click in a different place.
If Emacs is behaving strangely, check the mode line (the line just above the bottom line, or at the bottom of the current window, that displays information such as the file name and line number) and the minibuffer (the line at the bottom where commands prompt for input). Maybe you switched to the buffer while some command (e.g. a search) was in progress? If the mode indication in the mode line has square brackets around the parentheses (e.g. [(Python …)]
instead of the normal (Python …)
), it means that a recursive edit is in progress, i.e. some command lets you edit the buffer. To exit the recursive edit and resume the command that started it, press C-M-c
. To exit the recursive edit and abort the command that started it, press C-]
or ESC ESC ESC
. If there's a prompt in the minibuffer, click there to switch back to that prompt.
If you want to know why a particular character is in a particular color or font, move the cursor to that character and run M-x describe-text-properties
. This command is also available from the menu ‘Edit’ → ‘Text Properties’ → ‘Describe Properties’ or C-mouse-2
‘Text Properties’ → ‘Describe Properties’. Typically text formatting is done through faces and the face's documentation should at least indicate which package is responsible for it.
The command M-x list-faces-display
(available as ‘Display Faces’ in the ‘Text Properties’ menu) shows the available faces. With the default light background theme, two faces use a purple background that matches the image in your question: isearch
and query-replace
, both used to highlight matching text during a search command. I don't know how you could have reached that my mistake, but based on the colors, it's the most plausible scenario.
Emacs has a built-in package to highlight things temporarily. It leaves a discrete clue in the modeline: the minor mode indicator Hi
.
Although anything could happen depending on what packages you have installed, highlighting is likely to be a per-buffer configuration. So if you can't figure out what's going on, it should be enough to close the file and reopen it.
add a comment |
There's too little information in the question to be sure, so I can't definitively answer what happened. Rather I'll show how to investigate this and give some plausible cases.
I pressed some combination of letters by mistake
Once you realize that, press F1 l
or C-h l
(that's lowercase ell) to invoke the command view-lossage
. This displays the last 300 keys you pressed as well as other input events such as mouse clicks. Since Emacs 25, this also shows the commands that they invoked. In earlier versions, you have to use C-h k
to find what command a key or key sequence invokes, and that can give wrong results if you've changed some setting or moved to some buffer since that event, or for mouse events if you click in a different place.
If Emacs is behaving strangely, check the mode line (the line just above the bottom line, or at the bottom of the current window, that displays information such as the file name and line number) and the minibuffer (the line at the bottom where commands prompt for input). Maybe you switched to the buffer while some command (e.g. a search) was in progress? If the mode indication in the mode line has square brackets around the parentheses (e.g. [(Python …)]
instead of the normal (Python …)
), it means that a recursive edit is in progress, i.e. some command lets you edit the buffer. To exit the recursive edit and resume the command that started it, press C-M-c
. To exit the recursive edit and abort the command that started it, press C-]
or ESC ESC ESC
. If there's a prompt in the minibuffer, click there to switch back to that prompt.
If you want to know why a particular character is in a particular color or font, move the cursor to that character and run M-x describe-text-properties
. This command is also available from the menu ‘Edit’ → ‘Text Properties’ → ‘Describe Properties’ or C-mouse-2
‘Text Properties’ → ‘Describe Properties’. Typically text formatting is done through faces and the face's documentation should at least indicate which package is responsible for it.
The command M-x list-faces-display
(available as ‘Display Faces’ in the ‘Text Properties’ menu) shows the available faces. With the default light background theme, two faces use a purple background that matches the image in your question: isearch
and query-replace
, both used to highlight matching text during a search command. I don't know how you could have reached that my mistake, but based on the colors, it's the most plausible scenario.
Emacs has a built-in package to highlight things temporarily. It leaves a discrete clue in the modeline: the minor mode indicator Hi
.
Although anything could happen depending on what packages you have installed, highlighting is likely to be a per-buffer configuration. So if you can't figure out what's going on, it should be enough to close the file and reopen it.
There's too little information in the question to be sure, so I can't definitively answer what happened. Rather I'll show how to investigate this and give some plausible cases.
I pressed some combination of letters by mistake
Once you realize that, press F1 l
or C-h l
(that's lowercase ell) to invoke the command view-lossage
. This displays the last 300 keys you pressed as well as other input events such as mouse clicks. Since Emacs 25, this also shows the commands that they invoked. In earlier versions, you have to use C-h k
to find what command a key or key sequence invokes, and that can give wrong results if you've changed some setting or moved to some buffer since that event, or for mouse events if you click in a different place.
If Emacs is behaving strangely, check the mode line (the line just above the bottom line, or at the bottom of the current window, that displays information such as the file name and line number) and the minibuffer (the line at the bottom where commands prompt for input). Maybe you switched to the buffer while some command (e.g. a search) was in progress? If the mode indication in the mode line has square brackets around the parentheses (e.g. [(Python …)]
instead of the normal (Python …)
), it means that a recursive edit is in progress, i.e. some command lets you edit the buffer. To exit the recursive edit and resume the command that started it, press C-M-c
. To exit the recursive edit and abort the command that started it, press C-]
or ESC ESC ESC
. If there's a prompt in the minibuffer, click there to switch back to that prompt.
If you want to know why a particular character is in a particular color or font, move the cursor to that character and run M-x describe-text-properties
. This command is also available from the menu ‘Edit’ → ‘Text Properties’ → ‘Describe Properties’ or C-mouse-2
‘Text Properties’ → ‘Describe Properties’. Typically text formatting is done through faces and the face's documentation should at least indicate which package is responsible for it.
The command M-x list-faces-display
(available as ‘Display Faces’ in the ‘Text Properties’ menu) shows the available faces. With the default light background theme, two faces use a purple background that matches the image in your question: isearch
and query-replace
, both used to highlight matching text during a search command. I don't know how you could have reached that my mistake, but based on the colors, it's the most plausible scenario.
Emacs has a built-in package to highlight things temporarily. It leaves a discrete clue in the modeline: the minor mode indicator Hi
.
Although anything could happen depending on what packages you have installed, highlighting is likely to be a per-buffer configuration. So if you can't figure out what's going on, it should be enough to close the file and reopen it.
answered 4 hours ago
Gilles♦Gilles
13.6k43575
13.6k43575
add a comment |
add a comment |
The face of the highlighted text could be face secondary-selection
, although that has a yellow background by default.
You can tell what the face is by putting your cursor on a highlighted character and hitting C-u C-x =
. Near the bottom of buffer *Help*
describing that character it tells you what face is used.
If that's the case then you probably used the M-
(Meta key) modifier while dragging the mouse with the first mouse button (<mouse-1>
) pressed, and then released. (That makes the secondary selection empty.)
To get rid of it just hold the Meta key and click <mouse-1>
(without dragging it).
(If this is in fact the answer then please add tags secondary-selection
and mouse
to the question.)
add a comment |
The face of the highlighted text could be face secondary-selection
, although that has a yellow background by default.
You can tell what the face is by putting your cursor on a highlighted character and hitting C-u C-x =
. Near the bottom of buffer *Help*
describing that character it tells you what face is used.
If that's the case then you probably used the M-
(Meta key) modifier while dragging the mouse with the first mouse button (<mouse-1>
) pressed, and then released. (That makes the secondary selection empty.)
To get rid of it just hold the Meta key and click <mouse-1>
(without dragging it).
(If this is in fact the answer then please add tags secondary-selection
and mouse
to the question.)
add a comment |
The face of the highlighted text could be face secondary-selection
, although that has a yellow background by default.
You can tell what the face is by putting your cursor on a highlighted character and hitting C-u C-x =
. Near the bottom of buffer *Help*
describing that character it tells you what face is used.
If that's the case then you probably used the M-
(Meta key) modifier while dragging the mouse with the first mouse button (<mouse-1>
) pressed, and then released. (That makes the secondary selection empty.)
To get rid of it just hold the Meta key and click <mouse-1>
(without dragging it).
(If this is in fact the answer then please add tags secondary-selection
and mouse
to the question.)
The face of the highlighted text could be face secondary-selection
, although that has a yellow background by default.
You can tell what the face is by putting your cursor on a highlighted character and hitting C-u C-x =
. Near the bottom of buffer *Help*
describing that character it tells you what face is used.
If that's the case then you probably used the M-
(Meta key) modifier while dragging the mouse with the first mouse button (<mouse-1>
) pressed, and then released. (That makes the secondary selection empty.)
To get rid of it just hold the Meta key and click <mouse-1>
(without dragging it).
(If this is in fact the answer then please add tags secondary-selection
and mouse
to the question.)
edited 14 mins ago
answered 32 mins ago
DrewDrew
49k463107
49k463107
add a comment |
add a comment |
On second thought, I'm guessing that you used Isearch, query-replace or hi-lock
. The default face for Isearch and query-replace, face isearch
, looks just like the highlighting you show.
Isearch highlighting appears when you search using C-s
, C-r
, C-M-s
, or C-M-r
. Query-replace highlighting appears when you use use M-%
or C-M-%
. Normally this search highlighting disappears when you're done with the command, but things can get "stuck".
Hi-lock highlighting appears when you use a hi-lock command, such as hi-lock-line-face-buffer
or hi-lock-face-buffer
(aka highlight-regexp
). Hi-lock commands are on prefix key C-x w
, by default.
Such commands either read a face name or automatically use the next face. If you previously used Isearch then the face chosen could easily be face isearch
, which looks like what you show. Hi-lock highlighting persists after the command that causes the highlighting. My guess would be that you used hi-locking, perhaps without realizing it.
If you see submenu Regexp Highlighting
in the menu-bar Edit
menu then hi-lock-mode
is on, and this is probably the explanation.
To get rid of hi-lock highlighting you can usually just turn off hi-lock-mode
by repeating that toggle command.
add a comment |
On second thought, I'm guessing that you used Isearch, query-replace or hi-lock
. The default face for Isearch and query-replace, face isearch
, looks just like the highlighting you show.
Isearch highlighting appears when you search using C-s
, C-r
, C-M-s
, or C-M-r
. Query-replace highlighting appears when you use use M-%
or C-M-%
. Normally this search highlighting disappears when you're done with the command, but things can get "stuck".
Hi-lock highlighting appears when you use a hi-lock command, such as hi-lock-line-face-buffer
or hi-lock-face-buffer
(aka highlight-regexp
). Hi-lock commands are on prefix key C-x w
, by default.
Such commands either read a face name or automatically use the next face. If you previously used Isearch then the face chosen could easily be face isearch
, which looks like what you show. Hi-lock highlighting persists after the command that causes the highlighting. My guess would be that you used hi-locking, perhaps without realizing it.
If you see submenu Regexp Highlighting
in the menu-bar Edit
menu then hi-lock-mode
is on, and this is probably the explanation.
To get rid of hi-lock highlighting you can usually just turn off hi-lock-mode
by repeating that toggle command.
add a comment |
On second thought, I'm guessing that you used Isearch, query-replace or hi-lock
. The default face for Isearch and query-replace, face isearch
, looks just like the highlighting you show.
Isearch highlighting appears when you search using C-s
, C-r
, C-M-s
, or C-M-r
. Query-replace highlighting appears when you use use M-%
or C-M-%
. Normally this search highlighting disappears when you're done with the command, but things can get "stuck".
Hi-lock highlighting appears when you use a hi-lock command, such as hi-lock-line-face-buffer
or hi-lock-face-buffer
(aka highlight-regexp
). Hi-lock commands are on prefix key C-x w
, by default.
Such commands either read a face name or automatically use the next face. If you previously used Isearch then the face chosen could easily be face isearch
, which looks like what you show. Hi-lock highlighting persists after the command that causes the highlighting. My guess would be that you used hi-locking, perhaps without realizing it.
If you see submenu Regexp Highlighting
in the menu-bar Edit
menu then hi-lock-mode
is on, and this is probably the explanation.
To get rid of hi-lock highlighting you can usually just turn off hi-lock-mode
by repeating that toggle command.
On second thought, I'm guessing that you used Isearch, query-replace or hi-lock
. The default face for Isearch and query-replace, face isearch
, looks just like the highlighting you show.
Isearch highlighting appears when you search using C-s
, C-r
, C-M-s
, or C-M-r
. Query-replace highlighting appears when you use use M-%
or C-M-%
. Normally this search highlighting disappears when you're done with the command, but things can get "stuck".
Hi-lock highlighting appears when you use a hi-lock command, such as hi-lock-line-face-buffer
or hi-lock-face-buffer
(aka highlight-regexp
). Hi-lock commands are on prefix key C-x w
, by default.
Such commands either read a face name or automatically use the next face. If you previously used Isearch then the face chosen could easily be face isearch
, which looks like what you show. Hi-lock highlighting persists after the command that causes the highlighting. My guess would be that you used hi-locking, perhaps without realizing it.
If you see submenu Regexp Highlighting
in the menu-bar Edit
menu then hi-lock-mode
is on, and this is probably the explanation.
To get rid of hi-lock highlighting you can usually just turn off hi-lock-mode
by repeating that toggle command.
edited 10 mins ago
answered 23 mins ago
DrewDrew
49k463107
49k463107
add a comment |
add a comment |
Thanks for contributing an answer to Emacs Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2femacs.stackexchange.com%2fquestions%2f48676%2fhow-did-some-of-my-text-get-highlighted-with-a-magenta-background%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
2
This looks like it could be a misfired secondary selection, though its color is yellow by default. Does clicking the left mouse button while holding
Alt
make it go away?– undercat
8 hours ago
1
You can use
what-cursor-position
C-u C-x =
while cursor stay in the area. It will tell you what font face that area is using right now, then you can find out what feature you enabled.– Rangi Lin
7 hours ago