I am using pretty much the default theme color however, I do want to change the highlighted background color inside the parenthesis.

Is there any specific Face Attributes setting for this specific case?

enter image description here

1 Answer 1

(set-face-attribute 'show-paren-match-expression nil :background "yellow")

See Faces in the Elisp manual, in particular Face Attribute Functions, and Matching Parentheses.

If you want to tweak a face, positioning the cursor on a character and hitting C-u C-x = (what-cursor-position) will open a buffer with information about the faces used to display that character (that's how I found out about show-paren-match-expression). If you click on a face that interests you Emacs will open its documentation, saying in which library it's defined, with a link to the library. Click it. Most definitions have a :group keyword, for example :group 'paren-showing-faces. You can invoke customize-group and give it that keyword as argument, i.e. you can type M-x customize-group RET paren-showing-faces RET and you'll be brought to a buffer with a list of options for that topic.

  • Thank you. It solved! My face used to display was sp-pair-overlay-face so I've added (custom-set-faces '(sp-pair-overlay-face ((t nil)))) and there is no highlighted background which what I wanted.
    – user76333
    Feb 8, 2021 at 10:46
  • @kphex Wait if you just want to disable it ;-) you are better off using just (setq show-paren-style 'parenthesis), provided you use show-paren-mode for highlighting matching pairs. See the manual at the Matching Parentheses node. Feb 8, 2021 at 10:59
  • Sorry for the confusion but I wanted to do something with the highlighted color (light green color from my question). (setq show-paren-style 'parenthesis) brought back the highlight for some reason... Thank you for your alternative suggestion though ;)
    – user76333
    Feb 8, 2021 at 13:02
  • @kphex No need to apologize, I told you about that setting in case you could be better served by it :-) Feb 8, 2021 at 13:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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