My EMACS (26.3) thinks the line after
for i (`seq 1 10`) echo $i
should be indented. Is this a bug?
Emacs Stack Exchange is a question and answer site for those using, extending or developing Emacs. It only takes a minute to sign up.Sign up to join this community
sh-use-smie is set to t the Simple Minded Indentation Engine (SMIE) is used for indentation. As you experience, the
sh-mode setup for SMIE does not cover all the alternate complex commands of zsh yet.
Note that those forms should not be used in new programs. I cite the zsh doc:
These are non-standard and are likely not to be obvious even to seasoned shell programmers; they should not be used anywhere that portability of shell code is a concern.
Nevertheless, it may be that you have to fight with such forms in legacy software.
If you set
sh-use-smie to nil the line after the short form of the alternate form of
for is not indented.
Disclaimer: I do not know the negative consequences of setting
sh-use-smie to nil.