Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I had it once, and I cannot figure out how to turn it on again. In c++-mode (maybe in other modes as well), when I placed the cursor either right before an opening brace or right after it, apart from highlighting the braces themselves, emacs would also highlight the text which the pair surounds. How this feature called? How can I have it again?


share|improve this question
up vote 4 down vote accepted
(show-paren-mode t)
(setq show-paren-style 'expression)

Emacs manual on show-paren-mode, however it does not mention show-paren-style. This emacs-fu blog post does.

share|improve this answer

The package 'mic-paren' does this, along with telling you where the matching paren is if it's not visible. Check it out here.

This is my preferred setup:

(setq paren-dont-touch-blink t)
(require 'mic-paren)
(setq paren-match-face 'highlight)
(setq paren-sexp-mode t))

Which does highlight the text between parens.

share|improve this answer

Are you thinking about hl-sexp mode.? I only use it for elisp mode. Never coded cpp.

enter image description here

share|improve this answer
This is very nice!! How ever not what I was looking for. I want something which highlight the region bounded between two matching braces only when the cursor is visiting either of the braces. Thanks anyway. I'll try what you linked to - it looks nice. – Dror Jul 1 '11 at 15:01
It was a long time but how do you enable such block highlighting? – Amumu Jul 16 '14 at 18:04

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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