A really bad idea.

John Hunter jdhunter at ace.bsd.uchicago.edu
Tue Nov 19 04:28:43 EST 2002


>>>>> "Christian" == Christian Tanzer <tanzer at swing.co.at> writes:

    Christian> Time machine? python.org only has 4.6.

CVS -
http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/python/python/dist/src/Misc/python-mode.el  

Now at v4.28.

The one feature I'm unhappy with in python mode is text wrapping

If you have

  class counting_dict(dict):
      """A specialized dictionary for counting.  This help string goes on and on and on"""
      def __call__(self, key):
        key = key.strip()	
        self[ key ] = self.get( key , 0 ) + 1 


and execute fill-paragraph in the help string, it returns

  class counting_dict(dict): """A specialized dictionary for counting.
      This help string goes on and on and on""" def __call__(self, key):
      key = key.strip() self[ key ] = self.get( key , 0 ) + 1

rather than something like

  class counting_dict(dict):
      """A specialized dictionary for counting.  This help string goes
      on and on and on"""
      def __call__(self, key):
        key = key.strip()	
        self[ key ] = self.get( key , 0 ) + 1 


Ditto for comments, filling the comment string in 

  # xreadlines will split the file by newlines.  votes is now a list of favorite ice creams.
  votes = file('votes.dat').xreadlines()

gives 

  # xreadlines will split the file by newlines.  votes is now a list of
  favorite ice creams.  votes = file('votes.dat').xreadlines()
 
when it should give

  # xreadlines will split the file by newlines.  votes is now a list of
  # favorite ice creams.
  votes = file('votes.dat').xreadlines()

Is there a function in python-mode that I should be using for this?
or is on the todo wish list?  matlab-mode actually gets this right (at
least for '%' comments), so some enterprising individual could go lift
that code....

John Hunter




More information about the Python-list mailing list