When you type closing parenthesis (or maybe it works for other paired symbols too), and opening parenthesis is not visible on the screen, Emacs “jumps” to opening parenthesis to show you where it is. This is very handy.

I want to make period for which opening parenthesis is shown shorter (say, half a second). This shouldn't be hard, but the problem is that I don't know what this functionality is called, so I cannot search Emacs variables/functions.

  • 1
    Side note: you don't have to wait for the cursor to come back. You probably knew this, but some users don't realize it, so they find the delay excruciating. – Stefan Aug 18 '15 at 22:14

I think you want to adjust the parameters for Blinking Parentheses. In particular, you can adjust blink-matching-delay, which:

This variable specifies the number of seconds to keep indicating the matching parenthesis. A fraction of a second often gives good results, but the default is 1, which works on all systems.

  • That's it. Unfortunately, it doesn't seem to like value of 0.5. According to description of blink-matching-delay it should be set to number of [whole] seconds. Is there any way to set it to half of second? – Mark Karpov Aug 18 '15 at 12:10
  • @Mark: not sure. The text above is from the manual, which implies that fractions work on some systems but not all of them. Maybe try other fractional values? – Dan Aug 18 '15 at 12:13
  • Doesn't seem to work. For some reason it always uses 1 second delay. I need to read source code, this may be a bug. – Mark Karpov Aug 18 '15 at 12:17
  • 3
    It uses sit-for internally. I've tested it and it works OK with floating point intervals, so my system supports it (it would be strange if GNU/Linux didn't support that). I'm going to report this. – Mark Karpov Aug 18 '15 at 12:24
  • 1
    Here what Emacs devs say: The behavior you're describing was a recent regression, and it was fixed in b892438d7 (yesterday). I will pull/rebuild Emacs and I should be fine. Accepting your answer. – Mark Karpov Aug 18 '15 at 16:43

Emacs comes with the package show-paren-mode. Instead of temporarily blinking the corresponding parenthesis when one is written, the parenthesis corresponding to the one under the cursor is highlighted.

There are also other packages with some additional bells and whistles. I prefer mic-paren. This package is faster and it can highlight both forward and backward at the same time, should the cursor be between parentheses like )(.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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