Am 15.01.2011 16:49, schrieb Barry Warsaw:
On Jan 14, 2011, at 09:49 PM, Glenn Linderman wrote:

So here is a minimal test case:


"""
"
"""

def foo( bar ):
_ # cursor stays at left margin instead of indenting.

Confirmed with r390 of python-mode.el.  It's definitely that embedded double
quote.  Change it to a single quote and indentation works just fine.

I know Andreas has been working hard in this area for the past week or so, so
I'll let him follow up.  I'm not filing this as a bug, but if you look at

     https://bugs.launchpad.net/python-mode

you'll see several tqs related problems (most are fix committed).

-Barry

P.S. Welcome to the list!


Hi Barry,

gladly announce: just checked in a syntax independend
string parser with branch `paragraph-fill-warts',
addressing a similar bug.

A syntax independend parser delivers much more BTW than
this workaround ... :-)

Beside fixing/re-designing `py-fill-paragraph'
`py-fill-string' based on the new parser, a couple of
new functions are available.

Made an extract from thing-at-point-utils.el, called
`triplequoted.el'

Also delivering files needed by resp. holding the parser.

The full stuff is at

https://code.launchpad.net/s-x-emacs-werkstatt/

RATIONALE of re-design:

When detecting if inside a triple-quoted-string etc.,
the borders of the object are already known in this
course. Which might be given to fill the string...


Available forms for example:


`ar-triplequoted-atpt' - finds triplequoted strings under cursor
`ar-bounds-of-triplequoted-atpt'

...


`ar-triplequoted-dq-atpt' -  triplequoted strings using doublequotes
...


`ar-triplequoted-sq-atpt' - triplequoted strings using singlequotes
...


`ar-quoted-atpt'

...


`ar-doublequoted-atpt'

...


`ar-singlequoted-atpt'

...


Status: experimental,


Remaining/new BUG :(

error message when loading:


"Error in menu-bar-update-hook: (wrong-type-argument stringp nil)"


Comments welcome

Enjoy


Andreas

--
https://code.launchpad.net/~a-roehler/python-mode/python-mode-components
https://code.launchpad.net/s-x-emacs-werkstatt/


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

Reply via email to