From: Martin Vath <martin@mvath.de>
To: 26217@debbugs.gnu.org
Subject: bug#26217: 25.2; shell syntax does not know for i do
Date: Wed, 22 Mar 2017 10:10:44 +0100 (CET) [thread overview]
Message-ID: <alpine.DEB.2.11.1703220953060.31460@lounge.imp.fu-berlin.de> (raw)
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.)
next reply other threads:[~2017-03-22 9:10 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-22 9:10 Martin Vath [this message]
2023-10-13 12:07 ` bug#26217: bug#2910: 23.0.60; Shell-script coloring bug Mauro Aranda
2023-10-13 16:06 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-14 12:44 ` Mauro Aranda
2023-10-14 14:58 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-14 15:01 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-14 16:43 ` Dmitry Gutov
2023-10-14 19:07 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-14 19:49 ` Dmitry Gutov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=alpine.DEB.2.11.1703220953060.31460@lounge.imp.fu-berlin.de \
--to=martin@mvath.de \
--cc=26217@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).