From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?ISO-8859-1?Q?Andreas_R=F6hler?= Newsgroups: gmane.emacs.help Subject: Re: sh-script.el : don't colorize $(( 4 << 2 )) as here-document Date: Sat, 21 Nov 2009 18:27:20 +0100 Message-ID: <4B0822F8.4070909@easy-emacs.de> References: <4B06640D.2060206@sdesigns.eu> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1258841528 31922 80.91.229.12 (21 Nov 2009 22:12:08 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 21 Nov 2009 22:12:08 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Thomas Gambier Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Nov 21 23:12:01 2009 Return-path: Envelope-to: geh-help-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 1NByAZ-0003dh-Kh for geh-help-gnu-emacs@m.gmane.org; Sat, 21 Nov 2009 23:11:03 +0100 Original-Received: from localhost ([127.0.0.1]:46613 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NBtlB-0005aQ-0A for geh-help-gnu-emacs@m.gmane.org; Sat, 21 Nov 2009 12:28:33 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NBtkm-0005Y7-Bm for help-gnu-emacs@gnu.org; Sat, 21 Nov 2009 12:28:08 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NBtkh-0005Qv-UI for help-gnu-emacs@gnu.org; Sat, 21 Nov 2009 12:28:08 -0500 Original-Received: from [199.232.76.173] (port=44268 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NBtkh-0005Qk-NB for help-gnu-emacs@gnu.org; Sat, 21 Nov 2009 12:28:03 -0500 Original-Received: from moutng.kundenserver.de ([212.227.126.171]:58969) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NBtkg-000203-T4 for help-gnu-emacs@gnu.org; Sat, 21 Nov 2009 12:28:03 -0500 Original-Received: from [192.168.178.27] (p54BE9BED.dip0.t-ipconnect.de [84.190.155.237]) by mrelayeu.kundenserver.de (node=mreu0) with ESMTP (Nemesis) id 0MY20C-1NgkRi1x6O-00Uuoe; Sat, 21 Nov 2009 18:28:00 +0100 User-Agent: Thunderbird 2.0.0.19 (X11/20081227) In-Reply-To: <4B06640D.2060206@sdesigns.eu> X-Provags-ID: V01U2FsdGVkX19b81YS49FuJwLDRtlBxMf8iNlVXvSvTQ9IZU/ VLWGATFxUr27wLXZoUkD/lrh/jwURpoUZD5H+RXCQ81krBS8yv jeYN5Cr2VADxPXQCmKBsFrCUKGxPuCKMjGEyI67sho= X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:70011 Archived-At: Thomas Gambier wrote: > Hello, > > when I'm writing something like this in bash script value=$(( 4 << 2 )), > Emacs keep thinking it's the beginning of here-document and will > colorize in yellow all the code below this expression. > > I've seen that a bug in sh-script.el was corrected so that << between "" > won't be interpreted as a beginning of here-document > (http://lists.gnu.org/archive/html/help-gnu-emacs/2003-06/msg00158.html). > Is there any solution to don't consider also << between $(( )) ? I > looked into sh-script.el to try to correct it myself but I'm not very at > ease with lisp and regular expression and I didn't find what to change. > That's why I ask help here. If it's not possible, I will disable the > feature as explained in the previous link. > > Best regards. > Hi, AFAIS it's inside (defconst sh-here-doc-open-re (concat "<<-?\\s-*\\\\?\\(\\(?:['\"][^'\"]+['\"]\\|\\sw\\)+\\)" sh-escaped-line-re "\\(\n\\)")) If you say, `sh-here-doc-open-re' must start at bol or only permit whitespace before, inserting a ^[ \t]* into the regexp (setq sh-here-doc-open-re (concat "^[ \t]*<<-?\\s-*\\\\?\\(\\(?:['\"][^'\"]+['\"]\\|\\sw\\)+\\)" sh-escaped-line-re "\\(\n\\)")) it works here. HTH Andreas -- https://code.launchpad.net/s-x-emacs-werkstatt/ http://bazaar.launchpad.net/~a-roehler/python-mode/python-mode.el/