emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug in python-guess-indent (python.el)


From: David Reitter
Subject: bug in python-guess-indent (python.el)
Date: Sun, 29 Apr 2007 12:29:55 +0100

this bug still seems to be present in the current CVS HEAD version of python.el. I posted it on April 20th and got no response, so here it is again.


==
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))





reply via email to

[Prev in Thread] Current Thread [Next in Thread]