GNU bug report logs -
#2703
23.0.91; Error in Python indenter
Previous Next
Full log
View this message in rfc822 format
This patch fixes the indentation problem like described in the
report. It also fixes the problem that the
python-beginning-of-statement function doesn't work correctly in the
same context.
Description:
The position check in the outer loop makes no sense to me. With this
check the outer loop goes only once through the body then the
condition is always false. That's wrong if the python code has more
than one continuation line that isn't a backslash continuation line.
Best regards,
Marcus
=== modified file 'lisp/progmodes/python.el'
*** lisp/progmodes/python.el 2011-09-10 21:15:28 +0000
--- lisp/progmodes/python.el 2011-10-01 13:01:13 +0000
***************
*** 950,969 ****
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)
--- 950,964 ----
multi-line bracketed expressions."
(beginning-of-line)
(python-beginning-of-string)
! (while (python-continuation-line-p)
! (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)))
(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.