Subject: bug#18379: 24.3.93; Bash font lock: pretty inconsistent treatment of `` and $()

From: Stefan Monnier <[email-masked]>
Date: Tue, 02 Sep 2014 20:23:35 -0400

> The syntax table treats ` as an string quote character, so
>
> `if [[ $x == x ]]; then echo x; else echo y fi`
> $(if [[ $x == x ]]; then echo x; else echo y fi)
>
> are highlighted in a very different way although they are semantically
> equivalent.

This is largely historical, I think (with the $(...) highlighting
appearing more recently).  I don't have a strong opinion either way, but
highlighting it differently could be construed as a feature as well
(letting the user choose between the two quoting mechanisms based on
how she likes it to be highlighted).

IOW we could change it, but the motivation to do so is not very high and
it's not "obviously better".

> Related to do above, I don't know whether the different highlighting of
> the first word in:
>
> $(if [[ $x == x ]]; then echo x; else echo y fi)
> if [[ $x == x ]]; then echo x; else echo y fi
>
> is intended or accidental, but it looks pretty weird.

I don't know either, but I agree it's weird.  Patch welcome.

        Stefan