[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: temp stop syntax coloring on region of mismatched quotes
From: |
Drew Adams |
Subject: |
RE: temp stop syntax coloring on region of mismatched quotes |
Date: |
Thu, 4 Dec 2008 08:45:48 -0800 |
> sometimes in some source code, the double quote doesn't match and
> makes the rest of the code from that point on syntax colored wrong.
> Very annoying.
>
> Is there anyway to make it not syntax color the region of text where
> the quote becomes odd? For example, i have this text in the middle
> of a html file:
>
> <pre class="code">
> <img src="\([^"]+\)" alt="math surface" width="\([0-9]+\)"
> height="\
> ([0-9]+\)">
> </pre>
>
> and from this poitn on all syntax coloring gets wrong.
> My usual workaround is to add a html comment
> <!-- " -->
> right after the line, but that's kinda a pain. I wish to temporarily
> tell emacs to not do syntax coloring on the problematic region. Is
> there a way?
Temporarily? Yes: just insert another `"' character. Seriously. Remove it later,
or leave it in, in a comment, as you suggested. Typing `"' is the quickest way I
know of to handle this temporarily.
More than temporarily - e.g. for code that needs to have an unpaired `"' char:
no, not that I know of (except for adding a comment, if the code is not
read-only).
I agree about the annoyance, but this is likely to be a hard nut to crack in a
satisfactory and general way.
I highlight "..." (and `...') in Info, for instance, and the odd `"' throws off
highlighting for the rest of the current Info node (or until another odd `"').
Fortunately, this occurs rarely in Info, but it is annoying when it happens.
http://www.emacswiki.org/emacs/InfoPlus