Subject: Re: bug#18379: 24.3.93; Bash font lock: pretty inconsistent treatment of `` and $()
From: Stefan Kangas <[email-masked]>
To: Carlos Pita <[email-masked]>
Cc: Andreas Schwab <[email-masked]>, [email-masked], [email-masked]
Date: Tue, 11 Mar 2025 12:52:17 -0400
List-Id: <debbugs-submit.debbugs.gnu.org>

Carlos Pita <[email-masked]> writes:

> Hi Andreas,
>
>> They have different quoting rules, with `...` using rules similar to
>> double quotes, whereas $(...) is a fully nesting construct.
>
> True, but both contains bash code for a subshell which is far from being
> an uninterpreted string. IMO the important distintion to highlight is
> "intepreted code" vs "uninterpreted string", not the ability to nest vs
> the inability to nest (due to different quoting rules).
>
> I've been checking how other editors do this. vim works the way I'm
> proposing, while scintilla based editors do it the emacs way. Regarding
> my second observation before, neither vim nor scintilla treat the
> leading word in a command substution in any special way, which I think
> is sensible.

I think the conclusion here is that there are two ways to do this, and
the way we currently do this is not obviously wrong.  Thus, I think we
are unlikely to make any changes here at this point.

These days, I would probably look into `bash-ts-mode` as an alternative.

I'm therefore closing this bug report.