GNU bug report logs - #8632
23.2; shell-script[bash] doesn't handle bitshift $(( 1 << 16 ))

Previous Next

Package: emacs;

Reported by: Ben Wong <bug-gnu-emacs+gnu.org <at> wongs.net>

Date: Fri, 6 May 2011 23:35:01 UTC

Severity: normal

Merged with 15941

Found in versions 23.2, 24.2

Done: Stefan Monnier <monnier <at> iro.umontreal.ca>

Bug is archived. No further changes may be made.

Full log


Message #8 received at 8632 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Ben Wong <bug-gnu-emacs+gnu.org <at> wongs.net>
Cc: 8632 <at> debbugs.gnu.org
Subject: Re: bug#8632: 23.2;
	shell-script[bash] doesn't handle bitshift $(( 1 << 16 ))
Date: Fri, 13 May 2011 16:12:54 -0300
> In shell-script mode (bash minor mode) Emacs 23.2 incorrectly parses the
> following line as a HERE DOCUMENT.

> 	echo $(( 1 << 16 ))

> It is confused because sh-font-lock-open-heredoc (in sh-script.el)
> does not know about bash's ARITHMETIC EXPANSION.

Indeed, thanks for spotting this.

> There should be a function, similar to sh-in-comment-or-string, which
> parses the script looking for arithmetic expansion.

I guess the way to do it would be to try to handle $(( as
a string-opener in sh-syntax-propertize-function and then write
code to jump to the matching )) to mark it as the string-closer.

Patch welcome,


        Stefan




This bug report was last modified 11 years and 186 days ago.

Previous Next


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