unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#26217: 25.2; shell syntax does not know for i do
@ 2017-03-22  9:10 Martin Vath
  2023-10-13 12:07 ` bug#26217: bug#2910: 23.0.60; Shell-script coloring bug Mauro Aranda
  0 siblings, 1 reply; 9+ messages in thread
From: Martin Vath @ 2017-03-22  9:10 UTC (permalink / raw)
  To: 26217

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.)





^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2023-10-14 19:49 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-22  9:10 bug#26217: 25.2; shell syntax does not know for i do Martin Vath
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

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).