<div>Dear Barry,</div><div><br></div><div>Within a multi-line string, using quotes switches out of string mode. This can cause the remainder of the code to end up in string-mode. Try either of these:</div><div><br></div><div>

s=&quot;&quot;&quot;</div><div>a semi-quoted &quot;string inside the string switches syntax highlighting</div><div>out of string mode and when the string really ends, real code ends up</div><div>in string-mode&quot;&quot;&quot;</div>

<div><br></div><div>                                  </div><div>def func_highlighted_as_string():</div><div>    a=1</div><div><br></div><div>t=&quot;&quot;&quot;</div><div>It also interprets a &quot;string with # in it&quot; as an unbalanced-quote</div>

<div>                                  # since it thinks the hash mark is</div><div>                                  # an actual comment&quot;&quot;&quot;</div><div><br></div><div><br></div><div><br></div><div>Emacs  : GNU Emacs 23.2.50.1 (i386-apple-darwin9.8.0, NS apple-appkit-949.54)</div>

<div> of 2010-08-18 on <a href="http://braeburn.aquamacs.org">braeburn.aquamacs.org</a> - Aquamacs Distribution 2.1</div><div>Package: python-mode 5.1.0aq</div><div><br></div><div>current state:</div><div>==============</div>

<div>(setq</div><div> py-python-command &quot;python&quot;</div><div> py-indent-offset 4</div><div> py-block-comment-prefix &quot;##&quot;</div><div> py-temp-directory &quot;/var/folders/oA/oAy-YWg-FoSh1QxGzAILA++++TI/-Tmp-/&quot;</div>

<div> py-beep-if-tab-change t</div><div> )</div><div><br></div>