all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Lennart Borgman <lennart.borgman@gmail.com>
To: "Andreas Röhler" <andreas.roehler@easy-emacs.de>
Cc: help-gnu-emacs@gnu.org
Subject: Re: sh-script.el : don't colorize $(( 4 << 2 )) as here-document
Date: Sat, 21 Nov 2009 18:38:52 +0100	[thread overview]
Message-ID: <e01d8a50911210938x6c27e253n1f34f4f51a284a92@mail.gmail.com> (raw)
In-Reply-To: <4B0822F8.4070909@easy-emacs.de>

On Sat, Nov 21, 2009 at 6:27 PM, Andreas Röhler
<andreas.roehler@easy-emacs.de> wrote:
> 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.


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.




  reply	other threads:[~2009-11-21 17:38 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-20  9:40 sh-script.el : don't colorize $(( 4 << 2 )) as here-document Thomas Gambier
2009-11-21 17:27 ` Andreas Röhler
2009-11-21 17:38   ` Lennart Borgman [this message]
2009-11-21 19:27     ` Andreas Röhler
2009-11-24  9:32       ` Thomas Gambier
     [not found] <mailman.11231.1258815847.2239.help-gnu-emacs@gnu.org>
2009-11-24  2:51 ` Stefan Monnier
  -- strict thread matches above, loose matches on Subject: below --
2009-11-19 17:18 Thomas Gambier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e01d8a50911210938x6c27e253n1f34f4f51a284a92@mail.gmail.com \
    --to=lennart.borgman@gmail.com \
    --cc=andreas.roehler@easy-emacs.de \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.