emacs-pretest-bug
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: sh-mode font-lock error


From: Stefan Monnier
Subject: Re: sh-mode font-lock error
Date: Wed, 19 Jul 2006 00:32:14 -0400
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

> Thanks. I get the impression (catching up on emacs mailing lists) you
> are trying to fix font-locking of quoted and nested things. FYI, the
> following (not uncommon, I would have thought) construct currently
> does not fontify correctly. I'm pretty sure it used to...

> #!/bin/bash

> echo "the time is `date`"

> ## now everything is fontified as string.
> [ $i -eq $j ] && {
>     echo "blah"
>     exit 1
> }

I believe the patch below (just installed) fixes it,


        Stefan


--- sh-script.el        18 jui 2006 17:01:45 -0400      1.183
+++ sh-script.el        19 jui 2006 00:31:04 -0400      
@@ -985,7 +985,7 @@
   ;; FIXME: This can (and often does) match multiple lines, yet it makes no
   ;; effort to handle multiline cases correctly, so it ends up being
   ;; rather flakey.
-  (if (re-search-forward 
"\"\\(?:\\(?:.\\|\n\\)*?[^\\]\\(\\\\\\\\\\)*\\)?\\(\\$(\\|`\\)" limit t)
+  (if (re-search-forward 
"\"\\(?:\\(?:.\\|\n\\)*?[^\\]\\(\\\\\\\\\\)*\\)??\\(\\$(\\|`\\)" limit t)
       ;; bingo we have a $( or a ` inside a ""
       (let ((char (char-after (point)))
             (continue t)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]