Subject: bug#45390: Shell-script mode doesn’t like redirection at beginning of command

From: Lars Ingebrigtsen <[email-masked]>
Date: Tue, 07 Jun 2022 14:02:52 +0200

Dario Gjorgjevski <[email-masked]> writes:

> The “for” and “echo” in the following example are not font-locked in
> shell-script mode, despite being syntactically valid.  (From my
> experience, the “>&2 echo ...” idiom is quite common in practice, too.)
>
>     >/dev/null for i in {1..5} ; do
>         echo $i
>     done
>     >&2 echo 'Error!'
>
> Additionally, the “for” and its “done” are not matched so the SMIE
> grammar also needs fixing.

(I'm going through old bug reports that unfortunately weren't resolved
at the time.)

I'm unable to reproduce most of this -- do/done seem to be matched, and
echo is font-locked.  (I tried this in Emacs 25.1 -> Emacs 29.)  The one
thing I can reproduce is the missing font-locking of the "for" keyword.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no