With a common base face it is possible for a user to set a face
attribute to all rainbow-delimiter faces by manipulating just
rainbow-delimiters-base-face.
instead of tracking it on our own.
This does change the observable behavior of highlighting when there are
many unmatched closing delimiters, but the old behavior was
non-contractual and very dependent on the value of jit-lock-chunk-size.
Use cond instead of unless + if to reduce indentation, extract a common
subexpression to a variable, introduce a variable so a multiline function
call can be written in a single line.
In fact, nuke the infrastructure altogether.
Parens as characters without a backslash are nasty and they really should
never be used:
- This syntax is discouraged by the GNU Emacs Lisp Reference Manual.
- They confuse many a minor mode, such as show-paren-mode.
- The way we currently handle them partially solves the problem, but
is a hack made of eldritch magic, implemented by gluing special cases
together hoping they'll work...
- ...but it doesn't really work, and it's pretty easy to get
mishighlighted delimiters anyway.
- They confuse the Emacs Lisp indentation engine. Really.
- It's the major mode's job to set the syntax-table properties on
individual characters.
Because of these reasons, it's just easier to drop this misfeature
and rely on people to start using ?\( instead.
And because the whole point of
rainbow-delimiters-escaped-char-predicate-list is to allow for this,
nuke it too. It was never *really* a documented part of the API.
Position 5 of the list returned by syntax-ppss is non-nil iff
the character is escaped according to the syntax table. Use it to
remove the special case for Lisps other than Emacs Lisp.
The special case for Emacs Lisp is still there, to catch ?(.
This form, however, is deprecated, confuses many a minor mode and
confuses the emacs-lisp-mode indentation engine, so the special case
will likely go away soon, too.
After this change, rainbow-delimiters--apply-color just calls
rainbow-delimiters--propertize-delimiter, so remove it and rename
the latter to the former.