GNU bug report logs -
#26217
25.2; shell syntax does not know for i do
Previous Next
Reported by: Martin Vath <martin <at> mvath.de>
Date: Wed, 22 Mar 2017 11:37:02 UTC
Severity: minor
Tags: confirmed, patch
Merged with 2910,
21244,
30170,
46093,
48193
Found in versions 25.0.95, 25.2
Done: Stefan Monnier <monnier <at> iro.umontreal.ca>
Bug is archived. No further changes may be made.
Full log
Message #20 received at 26217 <at> debbugs.gnu.org (full text, mbox):
Martin Vath <martin <at> mvath.de> writes:
> 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.
This Bug Report (and the other ones merged with it) have two parts:
- No highlight for "do" in:
for i do echo 1; done
This works if using bash-ts-mode, which claims in its docstring it can
support Bash or sh.
I don't know what's the decision (if there is one) about situations like
these. If the bugs in lang-mode are fixed by lang-ts-mode, will these
bug reports be treated as: wontfix? fixed? open in case someone wants to
spend time in lang-mode?
- Wrong indentation for lines after:
for i do echo 1; done
I took a look at this, and ISTM that giving "do" a special treatment
like sh-smie--sh-keyword-p gives to "in" might fix this, perhaps by
reusing sh-smie--sh-keyword-in-p.
I know very little about SMIE, so I'm CCing Stefan M.
This bug report was last modified 1 year and 272 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.