|
From: | Thomas Gambier |
Subject: | Re: sh-script.el : don't colorize $(( 4 << 2 )) as here-document |
Date: | Tue, 24 Nov 2009 10:32:56 +0100 |
User-agent: | Thunderbird 2.0.0.23 (X11/20090817) |
Hi, Andreas Röhler wrote:
seems you got me. :-) Thanks. Preceding whitespaces resp. tabs are permitted by "-" in "<<-", so it's not possible to exclude it. Well, the only clean solution I see is based on a check if "<<" is inside a command like $(( 4 << 2 )) BTW, how it's called in english? Beside of writing such a check and include it into sh-script.el a quick and dirty solution might be (setq sh-here-doc-open-re (concat "<<-?\\s-" sh-here-document-word)) Then only customized `sh-here-document-word' will be accepted with some whitespace before, nothing else. Works here...
It worked here except I had to change the variable name "sh-here-document-word" because it was used as the word to insert after typing <<. I will use this for now.
Thanks a lot. Stefan Monnier wrote:
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.Ever heard of M-x report-emacs-bug?
You're right, I've just send a bug report using this function.So I'm happy with Andreas' solution and hopefully it will be corrected in next version of sh-script.el
Regards. Thomas.
[Prev in Thread] | Current Thread | [Next in Thread] |