GNU bug report logs - #18379
24.3.93; Bash font lock: pretty inconsistent treatment of `` and $()

Previous Next

Package: emacs;

Reported by: Carlos Pita <carlosjosepita <at> gmail.com>

Date: Mon, 1 Sep 2014 14:19:02 UTC

Severity: minor

Found in version 24.3.93

Done: Stefan Kangas <stefankangas <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
To: Carlos Pita <carlosjosepita <at> gmail.com>
Cc: occitan <at> esperanto.org, 18379 <at> debbugs.gnu.org
Subject: bug#18379: 24.3.93; Bash font lock: pretty inconsistent treatment of `` and $()
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




This bug report was last modified 154 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.