[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: address@hidden: pyhon mode indentation problem]
From: |
joakim |
Subject: |
Re: address@hidden: pyhon mode indentation problem] |
Date: |
Thu, 15 Jun 2006 19:20:15 +0200 |
User-agent: |
Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.51 (gnu/linux) |
Slawomir Nowaczyk <address@hidden> writes:
I posted some more info on this on "bugs" list.
Short recap:
- It doesnt work for me like it does for you, but it did, in an older
emacs
- I can solve this problem with this redefinition:
(defun python-skip-comments/blanks (&optional backward)
"Skip comments and blank lines.
BACKWARD non-nil means go backwards, otherwise go forwards. Backslash is
treated as whitespace so that continued blank lines are skipped.
Doesn't move out of comments -- should be outside or at end of line."
(with-syntax-table python-space-backslash-table
(forward-comment (if backward
;(+ most-negative-fixnum 1000)
-10000000
most-positive-fixnum))))
(only change is the large negative value, not quite as large as
most-negative-fixnum)
so, it seems like a bug in "forward-comment", at least here, in my setup.
> On Thu, 15 Jun 2006 11:09:49 -0400
> Richard Stallman <address@hidden> wrote:
>
> #> Maybe someone would like to work on this.
>
> This particular thing is, AFAIU, not a bug.
>
> Nevertheless, is anybody maintaining python.el? I tried using it once
> and it seemed rather cumbersome. I am not sure if I have time and/or
> skills to improve it... but if nobody else is working on it, I might
> give it a shot.
>
> #> the problem is especially obvious on the line marked #1, or #2 Try
> #> moving the indentation to column 0. Emacs will say "sole
> #> indentation".
>
> I am not sure I understand:
>
> If I move the #1 line so that it starts at column 0 (i.e. is not
> indentated at all) and press TAB, it will indent correctly, with 4
> spaces. After that, though, subsequent TABs will result in "sole
> indentation" message -- this is a feature: TAB in python-mode cycles
> through all possible (syntactically valid) indentations (of which
> there is only one in this case).
>
> Or did you mean something else by "moving the indentation to column 0"?
>
> Similarly, calling 'indent-for-tab-command' (this is what TAB is bound
> for me in emacs -q) on line #2 indents it properly with 4 spaces (it
> is indented with 3 in your email). Subsequent TABs give message "sole
> indentation" -- which it is.
>
> What did you expect to happen?
>
> --
> Best wishes,
> Slawomir Nowaczyk
> ( address@hidden )
>
> Never attribute to malice that which can be adequately
> explained by stupidity.
--
Joakim Verona
http://www.verona.se