emacs-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#26217: closed (25.2; shell syntax does not know for i do)


From: GNU bug Tracking System
Subject: bug#26217: closed (25.2; shell syntax does not know for i do)
Date: Sat, 14 Oct 2023 15:03:01 +0000

Your message dated Sat, 14 Oct 2023 11:01:40 -0400
with message-id <jwvpm1hjljr.fsf-monnier+emacs@gnu.org>
and subject line Re: bug#2910: 23.0.60; Shell-script coloring bug
has caused the debbugs.gnu.org bug report #26217,
regarding 25.2; shell syntax does not know for i do
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs@gnu.org.)


-- 
26217: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=26217
GNU Bug Tracking System
Contact help-debbugs@gnu.org with problems
--- Begin Message --- Subject: 25.2; shell syntax does not know for i do Date: Wed, 22 Mar 2017 10:10:44 +0100 (CET) User-agent: Alpine 2.11 (DEB 23 2013-08-11)
1. M-x shell-script-mode
2. Type: "
for i do echo 1; done
for i; do echo 1; done
"

Despite both lines are correct full loops according to POSIX
and in fact understood by all current shells (see below),
this does not correspond to the indentation of emacs and
coloring of "do" in the first line.

That the first line is indeed valid by POSIX and understood
by the shells was discussed recently in the German Usegroup
de.comp.os.unix.shell (OT under "Funktion aus find aufrufen"),
but you can also check the grammer for "for_clause" in
http://pubs.opengroup.org/onlinepubs/000095399/utilities/xcu_chap02.html
noting that it is valid that "linebreak" expands to the empty
string. Another hint that this is intentional in POSIX is the
explicit mentioning of "do" in Section 2.4 of the above page
as the _third_ word in a for command.

Tested on GNU Emacs 25.2.1 and GNU Emacs 24.4.1

(Removing further build data, since the issue was reproduced
on different machines and distributions before reporting.)



--- End Message ---
--- Begin Message --- Subject: Re: bug#2910: 23.0.60; Shell-script coloring bug Date: Sat, 14 Oct 2023 11:01:40 -0400 User-agent: Gnus/5.13 (Gnus v5.13)
>> I haven't found problems, but I'm suspicious because it seems too easy.
> Welcome to the world of Emacs, where "if it's easy it must be right".

BTW, pushed to `master`, thank you.


        Stefan



--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]