From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Angelo Graziosi Newsgroups: gmane.emacs.bugs Subject: bug#15613: Wrong indentation in Shell-script[sh] mode? Date: Wed, 16 Oct 2013 00:23:15 +0200 Message-ID: <525DC053.9050601@alice.it> References: <525C59B0.7090804@alice.it> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1381875869 21400 80.91.229.3 (15 Oct 2013 22:24:29 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 15 Oct 2013 22:24:29 +0000 (UTC) Cc: 15613@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Oct 16 00:24:31 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VWD2M-0006I0-OP for geb-bug-gnu-emacs@m.gmane.org; Wed, 16 Oct 2013 00:24:22 +0200 Original-Received: from localhost ([::1]:43954 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VWD2M-0005oo-AK for geb-bug-gnu-emacs@m.gmane.org; Tue, 15 Oct 2013 18:24:22 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34423) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VWD2B-0005oT-0q for bug-gnu-emacs@gnu.org; Tue, 15 Oct 2013 18:24:18 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VWD23-00067x-44 for bug-gnu-emacs@gnu.org; Tue, 15 Oct 2013 18:24:10 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:38656) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VWD23-00067t-14 for bug-gnu-emacs@gnu.org; Tue, 15 Oct 2013 18:24:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1VWD22-0003m0-Eq for bug-gnu-emacs@gnu.org; Tue, 15 Oct 2013 18:24:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Angelo Graziosi Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 15 Oct 2013 22:24:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 15613 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-Cc: bug-emacs Original-Received: via spool by submit@debbugs.gnu.org id=B.138187583214484 (code B ref -1); Tue, 15 Oct 2013 22:24:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 15 Oct 2013 22:23:52 +0000 Original-Received: from localhost ([127.0.0.1]:52675 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VWD1r-0003lX-Hn for submit@debbugs.gnu.org; Tue, 15 Oct 2013 18:23:52 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:60819) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VWD1p-0003lH-PG for submit@debbugs.gnu.org; Tue, 15 Oct 2013 18:23:50 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VWD1c-00061C-JX for submit@debbugs.gnu.org; Tue, 15 Oct 2013 18:23:44 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:38971) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VWD1c-000618-H6 for submit@debbugs.gnu.org; Tue, 15 Oct 2013 18:23:36 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34248) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VWD1V-0005nJ-Uz for bug-gnu-emacs@gnu.org; Tue, 15 Oct 2013 18:23:36 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VWD1P-0005x6-7m for bug-gnu-emacs@gnu.org; Tue, 15 Oct 2013 18:23:29 -0400 Original-Received: from smtp203.alice.it ([82.57.200.99]:29516) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VWD1O-0005wb-Sw for bug-gnu-emacs@gnu.org; Tue, 15 Oct 2013 18:23:23 -0400 Original-Received: from [192.168.1.100] (95.246.9.207) by smtp203.alice.it (8.6.060.28) (authenticated as angelo.graziosi@alice.it) id 52494B43014EE2A1; Wed, 16 Oct 2013 00:23:18 +0200 User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:24.0) Gecko/20100101 Thunderbird/24.0.1 In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:79293 Archived-At: 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.