python.el all of a sudden started acting weird... putting in "real"
TABs, and not positioning the cursor properly, so I decided maybe I
should finally get off my duff and switch to python-mode.el -- so it
doesn't put in "real" TABs, but it also was sometimes not positioning
the cursor properly :(
I finally figured out the cause, but not a cure... I had a large block
comment string and above that python-mode works, below it does not.
Now in trying to reproduce this to report it, I tried a smaller case,
but it works!
A big block comment like this doesn't seem to throw off the indentation
The sad part, then, is that the effect is string content dependent!
Maybe it has something to do with single quote stuff inside triple quote
stuff? Well, maybe. I had 2.5 such.
So here is a minimal test case:
def foo( bar ):
_ # cursor stays at left margin instead of indenting.
Is this something that is fixable? I didn't try triple single quotes
containing unbalanced single quotes or mixing the type of quotes, but
those are things that should be tested too, given this failure.
It really shouldn't matter what is inside the triple quotes. Before I
figured out what the problem was related to, I experienced some bizarre
behavior with python.el (but not with python-mode.el, but I don't know
what triggered it, to try again), where with the unbalanced strings, it
was displaying some code as code, but then after point somewhere (next
line) was displaying a block in brown as if it were a string. I thought
I had accidentally hit a key I didn't know what it did and changed some
setting in python.el that I didn't know about (which is most of
them).... it was probably related to this issue, however.
And, sorry, I don't know yet how to search for preexisting problems and
reported bugs yet, or where to report them, but I found this list and
joined it, thinking I'd be asking for help changing configuration
settings from "goofy" to "normal", but in making a test case to report,
came to a better understanding of the bug, enough to think it is one.
> 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).
> P.S. Welcome to the list!
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
Also delivering files needed by resp. holding the parser.