From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Martin Vath Newsgroups: gmane.emacs.bugs Subject: bug#26217: 25.2; shell syntax does not know for i do Date: Wed, 22 Mar 2017 10:10:44 +0100 (CET) Message-ID: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: TEXT/PLAIN; format=flowed; charset=US-ASCII X-Trace: blaine.gmane.org 1490182637 29343 195.159.176.226 (22 Mar 2017 11:37:17 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 22 Mar 2017 11:37:17 +0000 (UTC) User-Agent: Alpine 2.11 (DEB 23 2013-08-11) To: 26217@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Mar 22 12:37:11 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cqeZg-0006ls-Pu for geb-bug-gnu-emacs@m.gmane.org; Wed, 22 Mar 2017 12:37:08 +0100 Original-Received: from localhost ([::1]:50271 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cqeZm-0001en-L8 for geb-bug-gnu-emacs@m.gmane.org; Wed, 22 Mar 2017 07:37:14 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37423) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cqeZf-0001e4-8l for bug-gnu-emacs@gnu.org; Wed, 22 Mar 2017 07:37:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cqeZa-0004HU-SV for bug-gnu-emacs@gnu.org; Wed, 22 Mar 2017 07:37:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:40499) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cqeZa-0004HN-Hu for bug-gnu-emacs@gnu.org; Wed, 22 Mar 2017 07:37:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cqeZa-0004ey-Bl for bug-gnu-emacs@gnu.org; Wed, 22 Mar 2017 07:37:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Martin Vath Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 22 Mar 2017 11:37:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 26217 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.149018257817848 (code B ref -1); Wed, 22 Mar 2017 11:37:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 22 Mar 2017 11:36:18 +0000 Original-Received: from localhost ([127.0.0.1]:38698 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cqeYs-0004dn-3Y for submit@debbugs.gnu.org; Wed, 22 Mar 2017 07:36:18 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:59222) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cqcIK-0007ge-Qu for submit@debbugs.gnu.org; Wed, 22 Mar 2017 05:11:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cqcIE-00066B-9y for submit@debbugs.gnu.org; Wed, 22 Mar 2017 05:10:59 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:34701) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cqcIE-000667-3Z for submit@debbugs.gnu.org; Wed, 22 Mar 2017 05:10:58 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50191) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cqcIC-00020Z-Ux for bug-gnu-emacs@gnu.org; Wed, 22 Mar 2017 05:10:57 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cqcI8-00065j-VM for bug-gnu-emacs@gnu.org; Wed, 22 Mar 2017 05:10:56 -0400 Original-Received: from mo6-p00-ob.smtp.rzone.de ([2a01:238:20a:202:5300::9]:21928) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cqcI8-00065c-Ll for bug-gnu-emacs@gnu.org; Wed, 22 Mar 2017 05:10:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1490173849; l=1026; s=domk; d=mvath.de; h=Content-Type:MIME-Version:Subject:To:From:Date; bh=Kruo4BuqfYnACEB5d1aNuC/zXe69AZrRzE+HJtxR4qI=; b=MmLX2X5dDR5WQsHG6R+PizxvyBaR+wZDZvLRzFqqQ0KO0sQ0eHUHZF6QED6iVhWGaN OU0AWiZmBvOZ83U7yJA1nfYStezFiyAPzLT6wwr5/JTQPIrQUsPDq93h+SELQbHlbaXN sxQE8BnZxEz8otfXTCfPqg61XIa8ndRf1jEHg= X-RZG-AUTH: :IW0WYUmmW/LXBXEy1oS2GmByExLj9zw/4tEKkyX4yPukPF7l2T7gNKXmVFk= X-RZG-CLASS-ID: mo00 Original-Received: from lounge.imp.fu-berlin.de ([160.45.112.18]) by smtp.strato.de (RZmta 40.1 AUTH) with ESMTPSA id c0b836t2M9AnliY (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (curve secp521r1 with 521 ECDH bits, eq. 15360 bits RSA)) (Client did not present a certificate) for ; Wed, 22 Mar 2017 10:10:49 +0100 (CET) X-X-Sender: vaeth@lounge.imp.fu-berlin.de X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Mailman-Approved-At: Wed, 22 Mar 2017 07:36:17 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.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" Xref: news.gmane.org gmane.emacs.bugs:130796 Archived-At: 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.)