From: Angelo Graziosi <angelo.graziosi@alice.it>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: 15613@debbugs.gnu.org
Subject: bug#15613: Wrong indentation in Shell-script[sh] mode?
Date: Wed, 16 Oct 2013 00:23:15 +0200 [thread overview]
Message-ID: <525DC053.9050601@alice.it> (raw)
In-Reply-To: <jwvr4bmmwl2.fsf-monnier+emacsbugs@gnu.org>
Il 15/10/2013 16.37, Stefan Monnier ha scritto:
>> In the current trunk the indentation for bash scripts looks as in this test
>> case:
>
>> $ cat test_indent.sh
>> #!/bin/bash
>
>> if [ "${foo_a}" != "${foo_b}" ]; then
>
>> if [ "${foo_c}" = "${foo_d}" ]; then
>> echo
>> echo "Hello..."
>> echo
>> exit 1
>> fi
>
>> fi
>
> This works correctly if you use (setq sh-use-smie t) which I recommend.
>
> It is currently not the default setting because it doesn't yet support
> all the indentation-config variables of the old indentation code, and
> doesn't support the "guess indentation settings" feature either. But in
> most other respects it should work "as well or better".
Why, by default, the last "fi" should be under the previous and not
under _its_ "if"? Should "indent" mean that the matching if-fi, {-},
begin-end, if-endif etc. start the same column?
Instead the test case shows that all statements after the first "if"
if [ "${foo_a}" != "${foo_b}" ]; then
are considered belonging to its block statements. All the next formatted
code is lost.
This should be called "regression"..
Ciao,
Angelo.
next prev parent reply other threads:[~2013-10-15 22:23 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-14 20:53 bug#15613: Wrong indentation in Shell-script[sh] mode? Angelo Graziosi
2013-10-15 14:37 ` Stefan Monnier
2013-10-15 14:56 ` Glenn Morris
2013-10-15 22:26 ` Angelo Graziosi
2013-10-15 22:23 ` Angelo Graziosi [this message]
2013-10-16 22:41 ` Glenn Morris
2013-10-17 1:03 ` Stefan Monnier
2013-10-17 2:03 ` Glenn Morris
2013-10-17 3:57 ` Stefan Monnier
2013-10-17 16:46 ` Angelo Graziosi
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=525DC053.9050601@alice.it \
--to=angelo.graziosi@alice.it \
--cc=15613@debbugs.gnu.org \
--cc=monnier@iro.umontreal.ca \
/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).