[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug in python-guess-indent (python-mode)
From: |
David Reitter |
Subject: |
bug in python-guess-indent (python-mode) |
Date: |
Fri, 20 Apr 2007 18:13:00 +0100 |
There is a bug that brings up an `wrong type argument' error in
`python-guess-indent' when doing M-x python-mode in situations where
there is little actual indentation in the buffer, such as when the
buffer just contains a line like this:
for line in IN:
A simple fix for the problem is attached. (It will cause `python-
guess-indent' not to set the indentation variable locally in such a
case.)
PS.: Sorry if my mail client wraps lines diffs. I have no control
over this. Please apply manually in case that happens.
Index: python.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/progmodes/python.el,v
retrieving revision 1.57
diff -c -r1.57 python.el
*** lisp/progmodes/python.el 28 Mar 2007 01:21:46 -0000 1.57
--- lisp/progmodes/python.el 20 Apr 2007 17:06:13 -0000
***************
*** 461,467 ****
(let ((initial (current-indentation)))
(if (zerop (python-next-statement))
(setq indent (- (current-indentation) initial)))
! (if (and (>= indent 2) (<= indent 8)) ; sanity check
(setq done t))))))
(when done
(when (/= indent (default-value 'python-indent))
--- 461,467 ----
(let ((initial (current-indentation)))
(if (zerop (python-next-statement))
(setq indent (- (current-indentation) initial)))
! (if (and indent (>= indent 2) (<= indent 8)) ; sanity check
(setq done t))))))
(when done
(when (/= indent (default-value 'python-indent))
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- bug in python-guess-indent (python-mode),
David Reitter <=