all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Marcus Dreier <m-rei@gmx.net>
To: 2703@debbugs.gnu.org
Subject: bug#2703: 23.0.91; Error in Python indenter
Date: Sat, 1 Oct 2011 15:19:10 +0200	[thread overview]
Message-ID: <20111001131910.GA862@staatsfeind.sperrbezirk.net> (raw)
In-Reply-To: <20090318012449.3D66D4858E@rgr.rgrjr.com>

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)





  reply	other threads:[~2011-10-01 13:19 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-18  1:24 bug#2703: 23.0.91; Error in Python indenter Bob Rogers
2011-10-01 13:19 ` Marcus Dreier [this message]
2011-11-09 15:01   ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20111001131910.GA862@staatsfeind.sperrbezirk.net \
    --to=m-rei@gmx.net \
    --cc=2703@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.