Barry Warsaw wrote:
> On Sep 9, 2009, at 5:56 AM, Andreas Roehler wrote:
> 
>> checking for the triple-quoted-bug:
>>
>> with python.el,
>>
>> (nth 8 (syntax-ppss)) shows the correct result.
>>
>> Unfortunately with python-mode.el (nth 8 (syntax-ppss)) fails.
>>
>> From there I assume, setting the syntax-table properly
>> might solve the bug
> 
> I haven't looked at this stuff in ages.  Has the syntax table grown more
> support for the kind of things Python's triple quoted strings needs?
> 
> -Barry
> 


Hi Barry,

after

(put-text-property TRIPLE-QUOTE-START-LAST-CHAR-POS 
TRIPLE-QUOTE-END-FIRST-CHAR-POS 'py-mode-syntax-table '(15 . 34))

doublequotes may be inserted inside triple quoted
string - no fontification-bug then. Similar thing in python.el AFAIU.

Strange thing I don't understand in context with checks
inside triple quoted string (TQS):

text-properties-at ->
(face font-lock-string-face py-mode-syntax-table (15 . 34) fontified t)

But (syntax-after pos) inside
returns different syntax-classes, (7) or (2)

Does it query an underlying syntax-table?

Below my test-text.py, triple quoted string starts at pos 330

Used

(put-text-property 330 347 'py-mode-syntax-table '(15 . 34))

Probably the right thing is:

(put-text-property (copy-marker 330) (copy-marker 347) 'py-mode-syntax-table 
'(15 . 34))

Cheers

Andreas

;;;;;;;;;;;;;;

#! /usr/bin/env python
 # -*- coding: utf-8 -*-

""" """
import re, sys, os, pdb, random, time
import MySQLdb
from urllib2 import Request, urlopen, URLError, HTTPError
# Get the command line arguments
args = sys.argv
# pdb.set_trace()
# Get the name of the file to count the words in
filename = args[1]

def usage():
    print """Usage: %s
....
""" % (
        os.path.basename(sys.argv[0]))
def main():
    if len(sys.argv)==1:
        usage()
        sys.exit()
if __name__=="__main__":
    main()

;;;;;;;;
_______________________________________________
Python-mode mailing list
Python-mode@python.org
http://mail.python.org/mailman/listinfo/python-mode

Reply via email to