unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#2910: 23.0.60; Shell-script coloring bug
@ 2009-04-06 21:46 Reuben Thomas
  2009-04-09  6:21 ` Glenn Morris
  0 siblings, 1 reply; 3+ messages in thread
From: Reuben Thomas @ 2009-04-06 21:46 UTC (permalink / raw)
  To: emacs-pretest-bug

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)






^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#2910: 23.0.60; Shell-script coloring bug
  2009-04-06 21:46 bug#2910: 23.0.60; Shell-script coloring bug Reuben Thomas
@ 2009-04-09  6:21 ` Glenn Morris
  2009-04-09 11:06   ` Reuben Thomas
  0 siblings, 1 reply; 3+ messages in thread
From: Glenn Morris @ 2009-04-09  6:21 UTC (permalink / raw)
  To: Reuben Thomas; +Cc: 2910


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?







^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#2910: 23.0.60; Shell-script coloring bug
  2009-04-09  6:21 ` Glenn Morris
@ 2009-04-09 11:06   ` Reuben Thomas
  0 siblings, 0 replies; 3+ messages in thread
From: Reuben Thomas @ 2009-04-09 11:06 UTC (permalink / raw)
  To: Glenn Morris; +Cc: 2910

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)






^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-04-09 11:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-06 21:46 bug#2910: 23.0.60; Shell-script coloring bug Reuben Thomas
2009-04-09  6:21 ` Glenn Morris
2009-04-09 11:06   ` Reuben Thomas

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).