GNU bug report logs - #45390
Shell-script mode doesn’t like redirection at beginning of command

Previous Next

Package: emacs;

Reported by: Dario Gjorgjevski <dario.gjorgjevski <at> gmail.com>

Date: Wed, 23 Dec 2020 10:34:02 UTC

Severity: normal

To reply to this bug, email your comments to 45390 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#45390; Package emacs. (Wed, 23 Dec 2020 10:34:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Dario Gjorgjevski <dario.gjorgjevski <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 23 Dec 2020 10:34:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Dario Gjorgjevski <dario.gjorgjevski <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: Shell-script mode doesn’t like redirection at
 beginning of command
Date: Wed, 23 Dec 2020 11:33:18 +0100
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.

Best regards,
Dario

-- 
$ keyserver=hkps://hkps.pool.sks-keyservers.net
$ keyid=744A4F0B4F1C9371
$ gpg --keyserver $keyserver --search-keys $keyid




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#45390; Package emacs. (Tue, 07 Jun 2022 12:04:01 GMT) Full text and rfc822 format available.

Message #8 received at 45390 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Dario Gjorgjevski <dario.gjorgjevski <at> gmail.com>
Cc: 45390 <at> debbugs.gnu.org
Subject: Re: bug#45390: Shell-script mode doesn’t like
 redirection at beginning of command
Date: Tue, 07 Jun 2022 14:02:52 +0200
Dario Gjorgjevski <dario.gjorgjevski <at> gmail.com> 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




This bug report was last modified 3 years and 13 days ago.

Previous Next


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