GNU bug report logs -
#2703
23.0.91; Error in Python indenter
Previous Next
Full log
Message #13 received at 2703 <at> debbugs.gnu.org (full text, mbox):
> The position check in the outer loop makes no sense to me.
Indeed it makes no sense. I think the intention is to prevent
inf-looping, but it's done incorrectly. I'm not 100% convinced that
your patch avoids inf-looping, so I reworked the code some more to make
the termination more clear. It's also simpler.
Thanks for digging into it and finding the culprit.
Stefan
=== modified file 'lisp/progmodes/python.el'
*** lisp/progmodes/python.el 2011-09-10 21:15:28 +0000
--- lisp/progmodes/python.el 2011-11-09 14:53:11 +0000
***************
*** 948,969 ****
"Go to start of current statement.
Accounts for continuation lines, multi-line strings, and
multi-line bracketed expressions."
! (beginning-of-line)
! (python-beginning-of-string)
! (let (point)
! (while (and (python-continuation-line-p)
! (if point
! (< (point) point)
! t))
! (beginning-of-line)
(if (python-backslash-continuation-line-p)
! (progn
! (forward-line -1)
! (while (python-backslash-continuation-line-p)
! (forward-line -1)))
! (python-beginning-of-string)
! (python-skip-out))
! (setq point (point))))
(back-to-indentation))
(defun python-skip-out (&optional forward syntax)
--- 948,959 ----
"Go to start of current statement.
Accounts for continuation lines, multi-line strings, and
multi-line bracketed expressions."
! (while
(if (python-backslash-continuation-line-p)
! (progn (forward-line -1) t)
! (beginning-of-line)
! (or (python-beginning-of-string)
! (python-skip-out))))
(back-to-indentation))
(defun python-skip-out (&optional forward syntax)
This bug report was last modified 13 years and 192 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.