Locally configure or disable show-paren-mode18 May 2016, by Artur Malabarba.
show-paren-mode is a minor-mode that highlights the bracket at point (be it
round, square, or curly) as well as its corresponding open/close counterpart. I
find it a must-have for Elisp and Clojure programming. On the other hand, when
editing Ruby code, it also highlights whole block delimiters, like
end, and all that must-haviness quickly turns into
The catch here is that
show-paren-mode is a global minor-mode. So you can’t
just enable it locally in
lisp-mode-hook, and if you try to do
(show-paren-mode -1) in
ruby-mode-hook you’re going to disable it globally
every time you visit a ruby file.
show-paren-function checks the value of the variable
show-paren-mode, so we can pseudo-disable it by setting this variable locally.
With this, the mode will still be active in
ruby-mode buffers, but it won’t
actually do anything.
Alternatively, you could reset
show-paren-data-function to its original value
ruby-mode-hook). This will keep only the basic bracket