looking for a discussion of things python(-mode) ish

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

looking for a discussion of things python(-mode) ish

Rohan Nicholls-3
Hi all,

I was looking for information about ptyhon.el and ipython.el and have
started making ipython work with python.el, when I stumbled on the
consolidation attempt of the two modes.

I checked out the python-mode launchpad project, and am now sending an
email.  Do I need to sign up to the python mailing list to see any
discussions?  Or does this email get me added to some secret list? ;)

I am very interested in getting everything under one roof, although
the discussion I read in January seems to indicate that this will
never be.

Just to sum up reasons that I had started using python.el
 - python-mode had shown no sign of life for about 5 years
 - The killer was the triple quote bug.  I was horribly stung by this,
   and at that point tossed python-mode even though the integration
   with ipython.el is hard to beat.
 - I am an emacs user, having given up on xemacs a couple of years
   ago, and it shows no sign of improving, so emacs specificity is not
   a problem for me, in fact it is a plus, as the various incompatible
   bits of the two systems do not start clogging up the code.

So my questions are:
 - Is the triple quote threat solved in python-mode (because it is in python.el)
 - It seems development has started up again, would this be correct,
   and is there a list of things to fix somewhere?  Also has Beverley
   Eyre compiled that list of features she mentioned back in January?

Please reply to me directly, esp. about a python-mode mailing list, so
I can sign up.

Thanks in advance for info. :)

Rohan
_______________________________________________
Python-mode mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/python-mode
Reply | Threaded
Open this post in threaded view
|

Re: looking for a discussion of things python(-mode) ish

Barry Warsaw
On Sep 8, 2009, at 4:43 AM, Rohan Nicholls wrote:

> I checked out the python-mode launchpad project, and am now sending an
> email.  Do I need to sign up to the python mailing list to see any
> discussions?  Or does this email get me added to some secret list? ;)

While I approved your message, you should explicitly join here

http://mail.python.org/mailman/listinfo/python-mode

> I am very interested in getting everything under one roof, although
> the discussion I read in January seems to indicate that this will
> never be.
>
> Just to sum up reasons that I had started using python.el
> - python-mode had shown no sign of life for about 5 years

That's changed now.

> - The killer was the triple quote bug.  I was horribly stung by this,
>   and at that point tossed python-mode even though the integration
>   with ipython.el is hard to beat.

I personally am rarely enough bitten by this to care, but I would love  
to have someone port python.el's approach to python-mode.el.  IIRC,  
python.el uses regexps and python-mode.el uses the syntax table.  The  
syntax table has the advantage of being much faster, which mattered a  
lot at one time, but it's not flexibly enough to handle Python's  
quoting rules.

> - I am an emacs user, having given up on xemacs a couple of years
>   ago, and it shows no sign of improving, so emacs specificity is not
>   a problem for me, in fact it is a plus, as the various incompatible
>   bits of the two systems do not start clogging up the code.

python-mode.el works just fine in both Emacs and XEmacs.

> So my questions are:
> - Is the triple quote threat solved in python-mode (because it is in  
> python.el)

I don't believe it has ever been ported over.

> - It seems development has started up again, would this be correct,
>   and is there a list of things to fix somewhere?  Also has Beverley
>   Eyre compiled that list of features she mentioned back in January?

Yes, it's being actively developed, but my sense of it is that python-
mode.el pretty much works well for everyone using it, so I wouldn't  
say there's a ton of itches that need scratching.  We add support for  
new syntax every time a new Python version comes out.  It's probably  
not as Python 3.x friendly as it should be.

-Barry


_______________________________________________
Python-mode mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/python-mode

PGP.sig (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: looking for a discussion of things python(-mode) ish

Andreas Röhler-2
Barry Warsaw wrote:

> On Sep 8, 2009, at 4:43 AM, Rohan Nicholls wrote:
>
>> I checked out the python-mode launchpad project, and am now sending an
>> email.  Do I need to sign up to the python mailing list to see any
>> discussions?  Or does this email get me added to some secret list? ;)
>
> While I approved your message, you should explicitly join here
>
> http://mail.python.org/mailman/listinfo/python-mode
>
>> I am very interested in getting everything under one roof, although
>> the discussion I read in January seems to indicate that this will
>> never be.
>>
>> Just to sum up reasons that I had started using python.el
>> - python-mode had shown no sign of life for about 5 years
>
> That's changed now.
>
>> - The killer was the triple quote bug.  I was horribly stung by this,
>>   and at that point tossed python-mode even though the integration
>>   with ipython.el is hard to beat.
>
> I personally am rarely enough bitten by this to care, but I would love
> to have someone port python.el's approach to python-mode.el.  IIRC,
> python.el uses regexps and python-mode.el uses the syntax table.



Hi,

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

Cheers

Andreas


 The

> syntax table has the advantage of being much faster, which mattered a
> lot at one time, but it's not flexibly enough to handle Python's quoting
> rules.
>
>> - I am an emacs user, having given up on xemacs a couple of years
>>   ago, and it shows no sign of improving, so emacs specificity is not
>>   a problem for me, in fact it is a plus, as the various incompatible
>>   bits of the two systems do not start clogging up the code.
>
> python-mode.el works just fine in both Emacs and XEmacs.
>
>> So my questions are:
>> - Is the triple quote threat solved in python-mode (because it is in
>> python.el)
>
> I don't believe it has ever been ported over.
>
>> - It seems development has started up again, would this be correct,
>>   and is there a list of things to fix somewhere?  Also has Beverley
>>   Eyre compiled that list of features she mentioned back in January?
>
> Yes, it's being actively developed, but my sense of it is that
> python-mode.el pretty much works well for everyone using it, so I
> wouldn't say there's a ton of itches that need scratching.  We add
> support for new syntax every time a new Python version comes out.  It's
> probably not as Python 3.x friendly as it should be.
>
> -Barry
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Python-mode mailing list
> [hidden email]
> http://mail.python.org/mailman/listinfo/python-mode

_______________________________________________
Python-mode mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/python-mode
Reply | Threaded
Open this post in threaded view
|

Re: looking for a discussion of things python(-mode) ish

Barry Warsaw
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


_______________________________________________
Python-mode mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/python-mode

PGP.sig (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: looking for a discussion of things python(-mode) ish

Andreas Röhler-2
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
[hidden email]
http://mail.python.org/mailman/listinfo/python-mode