3

When the cursor in next to a parenthesis, bracket, or brace, it highlights it and the matching one (if any). This is expected.

But by "highlights", I mean it entirely hides the things under a small block of color that nearly matches the text, making it impossible to read which kind of symbol it is. Is there a way to change this highlight style to a border-like box instead?

Here's a screenshot of my issue:

enter image description here

Ness
  • 165
  • 7

1 Answers1

4

If you don't want such highlighting at all then turn off show-paren-mode.

If you do want it, but you want it to use a different color:

  1. Put your cursor on that highlighted text and hit C-u C-x =. Near the bottom of buffer *Help* it tells you what face is used for the highlighting.

  2. M-x customize-face and enter that face. Then change its attributes (e.g. foreground, background colors) as you like. Then save your changes.

Drew
  • 75,699
  • 9
  • 109
  • 225
  • How do I use that *Help* area? I'm not sure I'm even seeing a font face. I can't customize "fontified" if that's what you mean. Here are screenshots: https://imgur.com/a/bZCHH – Ness Apr 16 '18 at 15:41
  • There is no `face` text property on the character that you asked about in that image. You do not see `face` listed with the text properties, along with property `fontified`. You need to put the cursor just before (a block cursor will appear to be on top of) the parenthesis character, and then hit `C-u C-x =`. – Drew Apr 16 '18 at 21:29
  • I understand it now. I set the foreground to black so the highlighted symbols are at least readable. However, the "Box around text" attribute doesn't do anything when I enable it or change any of its settings. That's the highlight style I want, but what could have broken it? – Ness Apr 18 '18 at 14:34
  • `Box around text` works for me. But it can depend on your platform, the font used, etc. Try customizing some other face, which is used more generally (not just for parens), setting, say `Box around text` with `Width` 2, `Color` Red, and `Style` None, to see whether that works. If it doesn't then try changing the font of the face. IOW, experiment, starting with checking whether it works at all with your setup. And start with `emacs -Q`, to be sure that something in your init file is not interfering. – Drew Apr 18 '18 at 14:50
  • Some settings work, and some don't. Underline works, but overline, strikethrough, and slant don't work. Could it be related to the fact that I'm using a PuTTY-like client? – Ness Apr 25 '18 at 16:34