The Emacs parenthesis-matching feature is designed to show automatically how parentheses (and other matching delimiters) match in the text. Whenever you type a self-inserting character that is a closing delimiter, the cursor moves momentarily to the location of the matching opening delimiter, provided that is on the screen. If it is not on the screen, Emacs displays some of the text near it in the echo area. Either way, you can tell which grouping you are closing off.
If the opening delimiter and closing delimiter are mismatched—such as in ‘[x)’—a warning message is displayed in the echo area.
Three variables control parenthesis match display:
blink-matching-paren turns the feature on or off:
disables it, but the default is
t to enable match display.
blink-matching-delay says how many seconds to leave the
cursor on the matching opening delimiter, before bringing it back to
the real location of point; the default is 1, but on some systems it
is useful to specify a fraction of a second.
blink-matching-paren-distance specifies how many characters
back to search to find the matching opening delimiter. If the match
is not found in that distance, scanning stops, and nothing is displayed.
This is to prevent the scan for the matching delimiter from wasting
lots of time when there is no match. The default is 102400.
Show Paren mode provides a more powerful kind of automatic matching. Whenever point is before an opening delimiter or after a closing delimiter, both that delimiter and its opposite delimiter are highlighted. Use the command M-x show-paren-mode to enable or disable this mode.
Show Paren mode uses the faces
show-paren-mismatch to highlight parentheses; you can customize
them to control how highlighting looks. See Face Customization.