Triple-quoted string font-lock problem

Bug #328790 reported by Jreese99
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-mode.el
Fix Released
Medium
Andreas Roehler

Bug Description

Font-lock in xemacs is not displaying triple-quoted strings correctly.
For example:

"""
This is "a test" string
on multiple lines.
"""

The phrases "This is " and " string on multiple lines." are formatted
as strings, but "a test" is not formatted as a string.

It appears that the triple quote is being treated as three
individual quotation marks instead of as a single entity.

A fix for this will be greatly appreciated. I *love* python-mode.el!

[http://sourceforge.net/tracker/index.php?func=detail&aid=963247&group_id=86916&atid=581349]

Related branches

Revision history for this message
Barry Warsaw (barry) wrote :

This is not something python-mode can realistically address.
 As you properly guess, because of limitations in Emacs'
(and XEmacs') built-in syntax table implementation,
python-mode has no choice but to treat triple quoted strings
as three separate entities.

Revision history for this message
Edloper (edloper) wrote :

See patch #1023335 (Handle triple-quoted strings correctly):

http://sourceforge.net/tracker/index.php?
func=detail&aid=1023335&group_id=86916&atid=581351

It might not be the prettiest solution, but it works. :)

Revision history for this message
franckyinuk (fmesirard-job) wrote :

I have merged Edloper's fix with version 5.1.0 and it works for me.
Thanks Edloper

Revision history for this message
Brett Hoerner (bretthoerner) wrote :

Is the above patch the best fix for triple quotes strings that bleed out? ie: http://i40.tinypic.com/b51rpv.jpg

Revision history for this message
Andreas Roehler (a-roehler) wrote :

Hi Ed,

while closing this bug, let me thank you.

Think your approach has been valid, even if the solution --following python.el-- now differs in proceeding.
See https://code.launchpad.net/~a-roehler/python-mode/tqs-302834-amend

Andreas

Changed in python-mode:
status: New → Fix Committed
Changed in python-mode:
status: Fix Committed → Fix Released
assignee: nobody → Andreas Roehler (a-roehler)
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.