* bug in python-guess-indent (python-mode)
@ 2007-04-20 17:13 David Reitter
2007-05-08 1:35 ` Stefan Monnier
0 siblings, 1 reply; 2+ messages in thread
From: David Reitter @ 2007-04-20 17:13 UTC (permalink / raw)
To: emacs- devel
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))
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: bug in python-guess-indent (python-mode)
2007-04-20 17:13 bug in python-guess-indent (python-mode) David Reitter
@ 2007-05-08 1:35 ` Stefan Monnier
0 siblings, 0 replies; 2+ messages in thread
From: Stefan Monnier @ 2007-05-08 1:35 UTC (permalink / raw)
To: David Reitter; +Cc: emacs- devel
> 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.)
Thanks, installed.
Stefan
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-05-08 1:35 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-04-20 17:13 bug in python-guess-indent (python-mode) David Reitter
2007-05-08 1:35 ` Stefan Monnier
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.