GNU bug report logs - #2910
23.0.60; Shell-script coloring bug

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Severity: minor; Reported by: Reuben Thomas <rrt@HIDDEN>; Keywords: confirmed; merged with #21244, #26217, #30170; dated Mon, 6 Apr 2009 22:00:02 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.
Merged 2910 21244 26217 30170. Request was from Noam Postavsky <npostavs@HIDDEN> to control <at> debbugs.gnu.org. Full text available.
Forcibly Merged 2910 21244 26217. Request was from Noam Postavsky <npostavs@HIDDEN> to control <at> debbugs.gnu.org. Full text available.
bug Marked as found in versions 25.0.95. Request was from npostavs@HIDDEN to control <at> debbugs.gnu.org. Full text available.
Added tag(s) confirmed. Request was from npostavs@HIDDEN to control <at> debbugs.gnu.org. Full text available.

Message received at 2910@HIDDEN:


Received: (at 2910) by emacsbugs.donarmstrong.com; 9 Apr 2009 11:07:10 +0000
From rrt@HIDDEN Thu Apr  9 04:07:10 2009
X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02
	(2008-06-10) on rzlab.ucr.edu
X-Spam-Level: 
X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available.
	hammytokens:Tokens not available.
X-Spam-Status: No, score=-3.0 required=4.0 tests=HAS_BUG_NUMBER autolearn=ham
	version=3.2.5-bugs.debian.org_2005_01_02
Received: from exprod7og126.obsmtp.com (exprod7og126.obsmtp.com [64.18.2.206])
	by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with SMTP id n39B76TR025266
	for <2910@HIDDEN>; Thu, 9 Apr 2009 04:07:07 -0700
Received: from source ([209.85.221.108]) by exprod7ob126.postini.com ([64.18.6.12]) with SMTP
	ID DSNKSd3W1UUL/MrMCQ7J0PFn7fW+JJUAYweQ@HIDDEN; Thu, 09 Apr 2009 04:07:08 PDT
Received: by qyk6 with SMTP id 6so921629qyk.32
        for <2910@HIDDEN>; Thu, 09 Apr 2009 04:07:01 -0700 (PDT)
Received: by 10.224.67.140 with SMTP id r12mr2607909qai.282.1239275220914;
        Thu, 09 Apr 2009 04:07:00 -0700 (PDT)
Received: from mord.local (78-105-4-25.zone3.bethere.co.uk [78.105.4.25])
        by mx.google.com with ESMTPS id 34sm144570yxm.28.2009.04.09.04.06.58
        (version=TLSv1/SSLv3 cipher=RC4-MD5);
        Thu, 09 Apr 2009 04:06:59 -0700 (PDT)
Date: Thu, 9 Apr 2009 12:06:56 +0100 (BST)
From: Reuben Thomas <rrt@HIDDEN>
To: Glenn Morris <rgm@HIDDEN>
cc: 2910 <at> debbugs.gnu.org
Subject: Re: bug#2910: 23.0.60; Shell-script coloring bug
In-Reply-To: <vbljqa2vpa.fsf@HIDDEN>
Message-ID: <alpine.DEB.2.00.0904091201520.2553@HIDDEN>
References: <alpine.DEB.2.00.0904062245360.2553@HIDDEN> <vbljqa2vpa.fsf@HIDDEN>
User-Agent: Alpine 2.00 (DEB 1167 2008-08-23)
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed

On Thu, 9 Apr 2009, Glenn Morris wrote:

>
> The discussion at
>
> http://lists.gnu.org/archive/html/bug-bash/2009-04/msg00040.html
>
> would indicate this was just a "typo" in the online posix docs.
> Is any change in Emacs needed?

If you read the thread again, you'll see that there's no disagreement 
between me and the others over what the correct syntax is, just a 
disagreement over whether the POSIX document does in fact represent it. 
Emacs is definitely getting the coloring wrong.

As Eric Blake says:

Which means the POSIX-mandated syntax should really be represented as:

for name [in [word...] ;] do
   compound-list
done

which neatly demonstrates both the points I raised in my bug report.

-- 
http://rrt.sc3d.org/ | robber, n.  a candid man of affairs (Bierce)




Acknowledgement sent to Reuben Thomas <rrt@HIDDEN>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs@HIDDEN>. Full text available.
Information forwarded to bug-submit-list@HIDDEN, Emacs Bugs <bug-gnu-emacs@HIDDEN>:
bug#2910; Package emacs. Full text available.

Message received at 2910@HIDDEN:


Received: (at 2910) by emacsbugs.donarmstrong.com; 9 Apr 2009 06:21:59 +0000
From rgm@HIDDEN Wed Apr  8 23:21:59 2009
X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02
	(2008-06-10) on rzlab.ucr.edu
X-Spam-Level: 
X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available.
	hammytokens:Tokens not available.
X-Spam-Status: No, score=-6.0 required=4.0 tests=HAS_BUG_NUMBER,
	X_DEBBUGS_NO_ACK autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02
Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10])
	by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n396Lus6029169
	for <2910@HIDDEN>; Wed, 8 Apr 2009 23:21:57 -0700
Received: from rgm by fencepost.gnu.org with local (Exim 4.67)
	(envelope-from <rgm@HIDDEN>)
	id 1Lrne5-0002Qp-Tn; Thu, 09 Apr 2009 02:21:53 -0400
From: Glenn Morris <rgm@HIDDEN>
To: Reuben Thomas <rrt@HIDDEN>
Cc: 2910 <at> debbugs.gnu.org
Subject: Re: bug#2910: 23.0.60; Shell-script coloring bug
References: <alpine.DEB.2.00.0904062245360.2553@HIDDEN>
X-Spook: White Water defense information warfare [Hello to all my
X-Ran: a>?=7~^6u9+bSh3Zn`Aq<2B"l@'p}K%'~#fwf}RA;9czdtM]clVNoFLcH)'nJU`Etowhk-
X-Hue: magenta
X-Debbugs-No-Ack: yes
X-Attribution: GM
Date: Thu, 09 Apr 2009 02:21:53 -0400
Message-ID: <vbljqa2vpa.fsf@HIDDEN>
User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii


The discussion at

http://lists.gnu.org/archive/html/bug-bash/2009-04/msg00040.html

would indicate this was just a "typo" in the online posix docs.
Is any change in Emacs needed?





Information forwarded to bug-submit-list@HIDDEN, Emacs Bugs <bug-gnu-emacs@HIDDEN>:
bug#2910; Package emacs. Full text available.
Severity set to `minor' from `normal' Request was from Glenn Morris <rgm@HIDDEN> to control@HIDDEN. Full text available.

Message received at submit@HIDDEN:


Received: (at submit) by emacsbugs.donarmstrong.com; 6 Apr 2009 21:52:31 +0000
From rrt@HIDDEN Mon Apr  6 14:52:31 2009
X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02
	(2008-06-10) on rzlab.ucr.edu
X-Spam-Level: 
X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available.
	hammytokens:Tokens not available.
X-Spam-Status: No, score=0.1 required=4.0 tests=FOURLA autolearn=no
	version=3.2.5-bugs.debian.org_2005_01_02
Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10])
	by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n36LqRKX022985
	for <submit@HIDDEN>; Mon, 6 Apr 2009 14:52:28 -0700
Received: from mail.gnu.org ([199.232.76.166]:32854 helo=mx10.gnu.org)
	by fencepost.gnu.org with esmtp (Exim 4.67)
	(envelope-from <rrt@HIDDEN>)
	id 1Lqwjy-0001Ss-QY
	for emacs-pretest-bug@HIDDEN; Mon, 06 Apr 2009 17:52:26 -0400
Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60)
	(envelope-from <rrt@HIDDEN>)
	id 1Lqwjw-0006er-8e
	for emacs-pretest-bug@HIDDEN; Mon, 06 Apr 2009 17:52:26 -0400
Received: from exprod7og111.obsmtp.com ([64.18.2.175]:37611)
	by monty-python.gnu.org with smtp (Exim 4.60)
	(envelope-from <rrt@HIDDEN>)
	id 1Lqwjv-0006eh-SZ
	for emacs-pretest-bug@HIDDEN; Mon, 06 Apr 2009 17:52:24 -0400
Received: from source ([209.85.219.161]) by exprod7ob111.postini.com ([64.18.6.12]) with SMTP
	ID DSNKSdp5lmrWsnEUoEyRhUfoTsH/ouzS38Jc@HIDDEN; Mon, 06 Apr 2009 14:52:23 PDT
Received: by ewy5 with SMTP id 5so1946394ewy.15
        for <emacs-pretest-bug@HIDDEN>; Mon, 06 Apr 2009 14:52:21 -0700 (PDT)
Received: by 10.216.7.212 with SMTP id 62mr1324377wep.92.1239054392589;
        Mon, 06 Apr 2009 14:46:32 -0700 (PDT)
Received: from mord.local (78-105-4-25.zone3.bethere.co.uk [78.105.4.25])
        by mx.google.com with ESMTPS id u14sm13037667gvf.19.2009.04.06.14.46.31
        (version=TLSv1/SSLv3 cipher=RC4-MD5);
        Mon, 06 Apr 2009 14:46:32 -0700 (PDT)
Date: Mon, 6 Apr 2009 22:46:30 +0100 (BST)
From: Reuben Thomas <rrt@HIDDEN>
To: emacs-pretest-bug@HIDDEN
Subject: 23.0.60; Shell-script coloring bug
Message-ID: <alpine.DEB.2.00.0904062245360.2553@HIDDEN>
User-Agent: Alpine 2.00 (DEB 1167 2008-08-23)
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; format=flowed; charset=UTF-8
Content-Transfer-Encoding: 8BIT
X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4)

In shell-script mode (at least for Shell-script[sh]), in the following line:

for i do

the token “do” is not colored as a keyword, which it should be. From
the relevant POSIX documentation:

http://www.opengroup.org/onlinepubs/000095399/utilities/xcu_chap02.html#tag_02

The format for the for loop is as follows:

     for name [ in [word ... ]]do
         compound-list


     done

Note that there is no explicit mention of semi-colons (this appears to
be the issue, as if the line is changed to

for i; do

then it is colored correctly, although in fact this syntax is NOT
permitted by POSIX, although bash accepts it.) A semi-colon is only
needed (and indeed, rqeuired) when an “in” clause is used, as the
“word” list mentioned above must end in a semicolon.

Hence, two things seem to need fixing:

1. In Shell-script[sh,bash] modes, “for name do” should color “do” as
    a keyword.

2. In Shell-script[sh], “for name; do” should *not* color “do” as a
    keyword.


In GNU Emacs 23.0.60.1 (i486-pc-linux-gnu, GTK+ Version 2.14.3)
  of 2008-10-13 on rothera, modified by Debian
  (emacs-snapshot package, version 1:20081013-1)
Windowing system distributor `The X.Org Foundation', version 11.0.10600000
configured using `configure  '--build' 'i486-linux-gnu' '--host' 
'i486-linux-gnu' '--prefix=/usr' '--sharedstatedir=/var/lib' 
'--libexecdir=/usr/lib' '--localstatedir=/var' '--infodir=/usr/share/info' 
'--mandir=/usr/share/man' '--with-pop=yes' 
'--enable-locallisppath=/etc/emacs-snapshot:/etc/emacs:/usr/local/share/emacs/23.0.60/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/23.0.60/site-lisp:/usr/share/emacs/site-lisp' 
'--with-x=yes' '--with-x-toolkit=gtk' 'build_alias=i486-linux-gnu' 
'host_alias=i486-linux-gnu' 'CFLAGS=-DDEBIAN -DSITELOAD_PURESIZE_EXTRA=5000 
-g -O2' 'LDFLAGS=-g -Wl,--as-needed' 'CPPFLAGS=''

Important settings:
   value of $LC_ALL: nil
   value of $LC_COLLATE: nil
   value of $LC_CTYPE: nil
   value of $LC_MESSAGES: nil
   value of $LC_MONETARY: nil
   value of $LC_NUMERIC: nil
   value of $LC_TIME: nil
   value of $LANG: en_GB.UTF-8
   value of $XMODIFIERS: nil
   locale-coding-system: utf-8-unix
   default-enable-multibyte-characters: t

-- 
http://rrt.sc3d.org/ | impatience, n.  the urge to do nothing
Listening to: 'Sanctus and Benedictus' from 'Mass of the Children and other
sacred music' (The Cambridge Singers / John Rutter)




Acknowledgement sent to Reuben Thomas <rrt@HIDDEN>:
New bug report received and forwarded. Copy sent to Emacs Bugs <bug-gnu-emacs@HIDDEN>. Full text available.
Report forwarded to bug-submit-list@HIDDEN, Emacs Bugs <bug-gnu-emacs@HIDDEN>:
bug#2910; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Fri, 19 Jan 2018 13:30:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.