all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Marcus Dreier <m-rei@gmx.net>
Cc: 2703@debbugs.gnu.org
Subject: bug#2703: 23.0.91; Error in Python indenter
Date: Wed, 09 Nov 2011 10:01:25 -0500	[thread overview]
Message-ID: <jwvpqh1l4zj.fsf-monnier+gnus-read-ephemeral-bug@gnu.org> (raw)
In-Reply-To: <20111001131910.GA862@staatsfeind.sperrbezirk.net> (Marcus Dreier's message of "Sat, 1 Oct 2011 15:19:10 +0200")

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





      reply	other threads:[~2011-11-09 15:01 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
2011-11-09 15:01   ` Stefan Monnier [this message]

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=jwvpqh1l4zj.fsf-monnier+gnus-read-ephemeral-bug@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=2703@debbugs.gnu.org \
    --cc=m-rei@gmx.net \
    /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.