From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: meingbg Newsgroups: gmane.emacs.bugs Subject: bug#5140: shell mode color coding for bash Date: Mon, 7 Dec 2009 09:17:25 +0100 Message-ID: Reply-To: meingbg , 5140@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=000e0ce03f2c6cd0e6047a1f16f5 X-Trace: ger.gmane.org 1260189748 17510 80.91.229.12 (7 Dec 2009 12:42:28 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 7 Dec 2009 12:42:28 +0000 (UTC) To: bug-gnu-emacs@gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Dec 07 13:42:21 2009 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1NHcuz-0001Gu-4s for geb-bug-gnu-emacs@m.gmane.org; Mon, 07 Dec 2009 13:42:21 +0100 Original-Received: from localhost ([127.0.0.1]:49168 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NHcuy-0004fm-QV for geb-bug-gnu-emacs@m.gmane.org; Mon, 07 Dec 2009 07:42:20 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NHYwR-0007TT-N0 for bug-gnu-emacs@gnu.org; Mon, 07 Dec 2009 03:27:35 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NHYwM-0007Rx-7k for bug-gnu-emacs@gnu.org; Mon, 07 Dec 2009 03:27:34 -0500 Original-Received: from [199.232.76.173] (port=33097 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NHYwL-0007Rp-SC for bug-gnu-emacs@gnu.org; Mon, 07 Dec 2009 03:27:30 -0500 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:47206) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NHYwL-0003YR-81 for bug-gnu-emacs@gnu.org; Mon, 07 Dec 2009 03:27:29 -0500 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id nB78RPXI029707; Mon, 7 Dec 2009 00:27:27 -0800 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.14.3/8.14.3/Submit) id nB78P4o9029392; Mon, 7 Dec 2009 00:25:04 -0800 Resent-Date: Mon, 7 Dec 2009 00:25:04 -0800 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: meingbg Original-Sender: svenssonaxel@gmail.com Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs 2Resent-Date: Mon, 07 Dec 2009 08:25:04 +0000 Resent-Message-ID: Resent-Sender: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: report 5140 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by submit@emacsbugs.donarmstrong.com id=B.126017386028737 (code B ref -1); Mon, 07 Dec 2009 08:25:04 +0000 Original-Received: (at submit) by emacsbugs.donarmstrong.com; 7 Dec 2009 08:17:40 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id nB78HcE9028734 for ; Mon, 7 Dec 2009 00:17:39 -0800 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NHYml-0002pS-6Q for bug-gnu-emacs@gnu.org; Mon, 07 Dec 2009 03:17:35 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NHYmg-0002oR-EA for bug-gnu-emacs@gnu.org; Mon, 07 Dec 2009 03:17:34 -0500 Original-Received: from [199.232.76.173] (port=54683 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NHYmg-0002oN-AX for bug-gnu-emacs@gnu.org; Mon, 07 Dec 2009 03:17:30 -0500 Original-Received: from mail-ew0-f215.google.com ([209.85.219.215]:51825) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NHYmf-0002um-QZ for bug-gnu-emacs@gnu.org; Mon, 07 Dec 2009 03:17:30 -0500 Original-Received: by ewy7 with SMTP id 7so5066194ewy.32 for ; Mon, 07 Dec 2009 00:17:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:date :x-google-sender-auth:message-id:subject:from:to:content-type; bh=D3cjK2KBQP1hFhGhOkln9YOG5b9Zj0YbO1E9IzqfCaM=; b=VIPMPIRkxgcfBpfWyz2ftzVcMMiZ+l/JtjC9v/e0xNY37j+t99Pob08DXro7003+NF ub4UG2P2o2QURhbsYT2QdB90GZrAZzsXaKzmRxwWGXw7UHock5t4mGWaE3PQLa1DBadV cJxs2qmwlRC+oaj1J4rE8ki+Mk6nn7t/N9FZI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:date:x-google-sender-auth:message-id:subject :from:to:content-type; b=LC8OubW8l9WWG/xud9K1/qEPPWvZurW/h3afoUOlXKob2yqG0NmMpB0vSrXzt0cCuA x/Rfg0YiDrdzdYE3vcnWJYCScXlY99Tcf8wr0H0Rr5wZHWkWoRw3kaZM7J6vuwWCIMi5 TTzMiiNYQPV2MmUFU2TIv8JHIkn623Y6vs5zE= Original-Received: by 10.213.1.205 with SMTP id 13mr14396083ebg.50.1260173845647; Mon, 07 Dec 2009 00:17:25 -0800 (PST) X-Google-Sender-Auth: 23a62931e1054120 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Resent-Date: Mon, 07 Dec 2009 03:27:34 -0500 X-Mailman-Approved-At: Mon, 07 Dec 2009 07:41:18 -0500 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:33353 Archived-At: --000e0ce03f2c6cd0e6047a1f16f5 Content-Type: text/plain; charset=ISO-8859-1 When editing a bash script with nested " and ` marks the color coding gets confused, coloring most text as a string. Sample code to reproduce the color coding follows (this code is debugged and runs as expected, so syntax should be ok) #!/bin/bash function list-dir { cat "$repo"/list } function init-repo { mkdir -p "$repo" touch "$repo"/list } function save-dir { init-repo dirname="`basename "$1"`" dirhash="`dir-to-repo "$1"`" saveline="$dirhash $dirname" if [ "`grep -Fc "$saveline" "$repo"/list`" -gt "0" ]; then echo "A directory with the same name and content is already in the repository." exit else echo "$saveline" >> "$repo"/list fi } In GNU Emacs 22.1.1 (x86_64-pc-linux-gnu, X toolkit, Xaw3d scroll bars) of 2008-05-02 on king, modified by Ubuntu Windowing system distributor `The X.Org Foundation', version 11.0.70000000 configured using `configure '--build=x86_64-linux-gnu' '--host=x86_64-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/emacs22:/etc/emacs:/usr/local/share/emacs/22.1/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/22.1/site-lisp:/usr/share/emacs/site-lisp:/usr/share/emacs/22.1/leim' '--with-x=yes' '--with-x-toolkit=athena' '--with-toolkit-scroll-bars' 'build_alias=x86_64-linux-gnu' 'host_alias=x86_64-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_US.UTF-8 locale-coding-system: utf-8 default-enable-multibyte-characters: t Major mode: Shell-script Minor modes in effect: tooltip-mode: t tool-bar-mode: t mouse-wheel-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t unify-8859-on-encoding-mode: t utf-translate-cjk-mode: t auto-compression-mode: t line-number-mode: t Recent input: C-k C-k C-k C-s f i l e - n a m e b a s e n a m e C-s C-s b a s e n a m e C-s C-s b a s e n a m e C-s C-s b a s e n a m e C-s C-s C-s C-s C-s C-s C-g C-g C-s b a s C-g C-g C-s b a s e C-s C-s C-s C-s C-x C-s C-w C-k C-x C-s M-x r e p o r t - e m a Recent messages: Quit [4 times] Mark set Mark saved where search started Mark set [4 times] call-interactively: End of buffer [2 times] Mark set [2 times] Wrote /sr/path/store Mark set Wrote /sr/path/store Loading emacsbug...done --000e0ce03f2c6cd0e6047a1f16f5 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable When editing a bash script with nested " and ` marks the color coding = gets confused, coloring most text as a string. Sample code to reproduce the= color coding follows (this code is debugged and runs as expected, so synta= x should be ok)


#!/bin/bash

function list-dir {
cat "$repo"/lis= t
}

function init-repo {
mkdir -p "$repo"
touch &= quot;$repo"/list
}

function save-dir {
init-repo
dirna= me=3D"`basename "$1"`"
dirhash=3D"`dir-to-repo "$1"`"
saveline=3D"$dir= hash $dirname"
if [ "`grep -Fc "$saveline" "$re= po"/list`" -gt "0" ]; then
echo "A directory wi= th the same name and content is already in the repository."
exit
else
echo "$saveline" >> "$repo"/list<= br>fi
}









In GNU Emacs 22.1.1 (x86_= 64-pc-linux-gnu, X toolkit, Xaw3d scroll bars)
=A0of 2008-05-02 on king,= modified by Ubuntu
Windowing system distributor `The X.Org Foundation', version 11.0.70000= 000
configured using `configure=A0 '--build=3Dx86_64-linux-gnu' = '--host=3Dx86_64-linux-gnu' '--prefix=3D/usr' '--shared= statedir=3D/var/lib' '--libexecdir=3D/usr/lib' '--localstat= edir=3D/var' '--infodir=3D/usr/share/info' '--mandir=3D/usr= /share/man' '--with-pop=3Dyes' '--enable-locallisppath=3D/e= tc/emacs22:/etc/emacs:/usr/local/share/emacs/22.1/site-lisp:/usr/local/shar= e/emacs/site-lisp:/usr/share/emacs/22.1/site-lisp:/usr/share/emacs/site-lis= p:/usr/share/emacs/22.1/leim' '--with-x=3Dyes' '--with-x-to= olkit=3Dathena' '--with-toolkit-scroll-bars' 'build_alias= =3Dx86_64-linux-gnu' 'host_alias=3Dx86_64-linux-gnu' 'CFLAG= S=3D-DDEBIAN -DSITELOAD_PURESIZE_EXTRA=3D5000 -g -O2' 'LDFLAGS=3D-g= -Wl,--as-needed' 'CPPFLAGS=3D''

Important settings:
=A0 value of $LC_ALL: nil
=A0 value of $LC_CO= LLATE: nil
=A0 value of $LC_CTYPE: nil
=A0 value of $LC_MESSAGES: nil=
=A0 value of $LC_MONETARY: nil
=A0 value of $LC_NUMERIC: nil
=A0 = value of $LC_TIME: nil
=A0 value of $LANG: en_US.UTF-8
=A0 locale-coding-system: utf-8
=A0 d= efault-enable-multibyte-characters: t

Major mode: Shell-script
Minor modes in effect:
=A0 tooltip-mode: t
=A0 tool-bar-mode: t
= =A0 mouse-wheel-mode: t
=A0 menu-bar-mode: t
=A0 file-name-shadow-mode: t
=A0 global-font-loc= k-mode: t
=A0 font-lock-mode: t
=A0 blink-cursor-mode: t
=A0 unify= -8859-on-encoding-mode: t
=A0 utf-translate-cjk-mode: t
=A0 auto-comp= ression-mode: t
=A0 line-number-mode: t

Recent input:
C-k C-k C-k <C-home> = C-s f i l e - n a m e <backspace>
<right> <C-backspace&g= t; <C-backspace> b a s e n a m e
C-s C-s <right> <C-back= space> <C-backspace> b a s e
n a m e C-s C-s <right> <C-backspace> <C-backspace>
b= a s e n a m e C-s C-s <right> <C-backspace> <C-backspace>= ;
b a s e n a m e C-s C-s <C-home> C-s C-s C-s <C-home> C-s C-g C-g C-s b a s C-g C-g <help-echo> <help-echo>
<h= elp-echo> <C-home> C-s b a s e C-s C-s C-s C-s <down>
&l= t;C-home> <C-end> <up> <C-end> <C-end> <right= > <right>
<backspace> <C-end> <C-end> <return> C-x C-s <do= wn>
<down> <up> <up> <down> <down> <= ;down> <down> <down>
<down> <up> <C-home&= gt; <down> <down> <down> <down> <down>
<down> <down> <up> <up> <up> <up> <u= p> <down-mouse-1>
<mouse-movement> <mouse-movement>= ; <drag-mouse-1> C-w
C-k C-x C-s <help-echo> <help-echo&= gt; <help-echo> <help-echo>
<help-echo> <help-echo> <help-echo> <up> <up>= <up>
<up> <up> <help-echo> <help-echo> &= lt;help-echo> <help-echo>
<down> <down> <down&g= t; <down> <down> <down> <down> <down>
<down> <down> <down> <down> <down> <down&g= t; <down> <down>
<down> <down> <down> <= ;down> <down> <down> <down> <down>
<down&= gt; <down> <down> <down> <down> <down> <do= wn> <down>
<down> <down> <down> <down> <down> <down&g= t; <down> <down>
<down> <down> <down> <= ;down> <down> <down> <down> <down>
<down&= gt; <down> <down> <down> <down> <up> <up&g= t; <up> <up>
<up> <up> <up> <up> <up> <up> <up>= ; <up> <up> <up> <up>
<up> <up> <= ;up> <up> <up> <up> <up> <up> <up> &= lt;up> <up>
<up> <up> <up> <up> <up> <up> <up>= ; <up> <up> <up> <up>
<up> <up> <= ;up> <up> <up> <up> <up> <up> <up> &= lt;up> <up>
<up> <up> <up> <up> <up> <up> <up>= ; <up> <up> <up> <up>
<up> <up> <= ;up> <up> <down> <down> <down> <down> <= down>
<down> <down> <down> <down> <down> <down&g= t; <down> <down>
<up> <up> M-x r e p o r t - e = m a <tab> <return>

Recent messages:
Quit [4 times] Mark set
Mark saved where search started
Mark set [4 times]
call-i= nteractively: End of buffer [2 times]
Mark set [2 times]
Wrote /sr/pa= th/store
Mark set
Wrote /sr/path/store
Loading emacsbug...done

--000e0ce03f2c6cd0e6047a1f16f5--