From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lennart Borgman Newsgroups: gmane.emacs.help Subject: Re: sh-script.el : don't colorize $(( 4 << 2 )) as here-document Date: Sat, 21 Nov 2009 18:38:52 +0100 Message-ID: References: <4B06640D.2060206@sdesigns.eu> <4B0822F8.4070909@easy-emacs.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1258841527 31896 80.91.229.12 (21 Nov 2009 22:12:07 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 21 Nov 2009 22:12:07 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: =?UTF-8?Q?Andreas_R=C3=B6hler?= Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Nov 21 23:12:00 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-0003SB-Tm for geh-help-gnu-emacs@m.gmane.org; Sat, 21 Nov 2009 23:11:04 +0100 Original-Received: from localhost ([127.0.0.1]:51385 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NBtw3-0005Eb-Gc for geh-help-gnu-emacs@m.gmane.org; Sat, 21 Nov 2009 12:39:47 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NBtvb-0005AJ-OA for help-gnu-emacs@gnu.org; Sat, 21 Nov 2009 12:39:19 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NBtvX-0004zm-7w for help-gnu-emacs@gnu.org; Sat, 21 Nov 2009 12:39:19 -0500 Original-Received: from [199.232.76.173] (port=41693 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NBtvW-0004zb-Vk for help-gnu-emacs@gnu.org; Sat, 21 Nov 2009 12:39:15 -0500 Original-Received: from mail-yx0-f191.google.com ([209.85.210.191]:50038) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NBtvW-0003pL-8A for help-gnu-emacs@gnu.org; Sat, 21 Nov 2009 12:39:14 -0500 Original-Received: by yxe29 with SMTP id 29so10807102yxe.14 for ; Sat, 21 Nov 2009 09:39:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=fD+iUOq70WH2kIExMDV1S9efhaNVaA6CsCZs8lYHuP4=; b=nW/ctnM9AF5WzUtme0Sxs12POd4KGeQEXxOP2oBXFJuNZPciQ6gQoz+tqKNkOYtvmv RCnKF/MEov3WWf1+ifD7ixlVeFT1g8CAQQwoYS84t8kQ25ja12WfiW4fRlgheV5MXsGJ Uc6HNCUPg8YpgWuGy+5ICE42IVKmlsBfE/+Uk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; b=V1J6AgDwcNCjPlZ5syrOv39L4CyGS8cWEzAioNRt6yOeZtww27umlL6kCoFKj4fmxi G5hpK7aNbcaKnQHPjT3vNBD0gViLAN424ozohJoRJwpC+8JLzSu/fKKwCKre0bFph5pW B80tVyYzF0mOR6fHBYvQKTjk53lrDwzgsakmk= Original-Received: by 10.101.129.1 with SMTP id g1mr3034306ann.124.1258825152085; Sat, 21 Nov 2009 09:39:12 -0800 (PST) In-Reply-To: <4B0822F8.4070909@easy-emacs.de> X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) 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:70009 Archived-At: On Sat, Nov 21, 2009 at 6:27 PM, Andreas R=C3=B6hler wrote: > Thomas Gambier wrote: >> Hello, >> >> when I'm writing something like this in bash script value=3D$(( 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 > =C2=A0(concat "<<-?\\s-*\\\\?\\(\\(?:['\"][^'\"]+['\"]\\|\\sw\\)+\\)" > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0sh-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 > =C2=A0(concat "^[ \t]*<<-?\\s-*\\\\?\\(\\(?:['\"][^'\"]+['\"]\\|\\sw\\)+\= \)" > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0sh-escaped-line-re "\\(\n\\)")) > > it works here. I have some trouble understanding those regexp. What are the proper syntax for sh heredoc? I have some support for it in MuMaMo and just noticed that the example Andreas mentioned did not work as I expected.