From: bwarsaw at cnri.reston.va.us (Barry A. Warsaw)
Date: Thu, 29 Apr 1999 11:36:16 -0400 (EDT)
Subject: Emacs' python-mode buggy?
References: <7g8np4$kvf@chronicle.concentric.net>
	<000901be9203$b4c32e40$199e2299@tim>
Message-ID: <14120.31856.181562.574382@anthem.cnri.reston.va.us>
Content-Length: 1100
X-UID: 1433                                                  

>>>>> "TP" == Tim Peters <tim_one at email.msn.com> writes:

    |     """
    |        "Hi!" I'm a doc string
    |     """

    TP> Emacs "sees" it as a sequence of 4 strings with some crap in
    TP> the middle:

    |     ""
    |     "\n        "
    |     Hi!
    |     " I'm a doc string\n    "
    |     ""

    TP> elisp is too slow to do the character-at-a-time parsing that
    TP> would be needed to fix cases like this, so-- like all other
    TP> language modes --pymode settles for what it can get.  AFAIK it
    TP> should *never* screw up in the absence of triple-quoted
    TP> strings, though, and you can help it make sense of those by
    TP> pretending you're the Emacs C parsing function, using
    TP> judicious backslash escapes until you stop confusing yourself
    TP> <wink>.

Try something like the following for fun

-------------------- snip snip --------------------
'''Hey!  I thought I warned you.
Don't even think about it!
'''
# yikes! Emacs thinks this is a string
# add a turd '
# now we're happy again
-------------------- snip snip --------------------

-B




