From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Marcus Dreier Newsgroups: gmane.emacs.bugs Subject: bug#2703: 23.0.91; Error in Python indenter Date: Sat, 1 Oct 2011 15:19:10 +0200 Message-ID: <20111001131910.GA862@staatsfeind.sperrbezirk.net> References: <20090318012449.3D66D4858E@rgr.rgrjr.com> Reply-To: Marcus Dreier NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 X-Trace: dough.gmane.org 1317489780 3320 80.91.229.12 (1 Oct 2011 17:23:00 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 1 Oct 2011 17:23:00 +0000 (UTC) To: 2703@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Oct 01 19:22:56 2011 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RA3H5-0008PY-9D for geb-bug-gnu-emacs@m.gmane.org; Sat, 01 Oct 2011 19:22:55 +0200 Original-Received: from localhost ([::1]:48160 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RA3H4-00078X-Q5 for geb-bug-gnu-emacs@m.gmane.org; Sat, 01 Oct 2011 13:22:54 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:33806) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RA3H1-00078N-KT for bug-gnu-emacs@gnu.org; Sat, 01 Oct 2011 13:22:52 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RA3H0-0008EK-CD for bug-gnu-emacs@gnu.org; Sat, 01 Oct 2011 13:22:51 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:34346) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RA3H0-0008EE-AA for bug-gnu-emacs@gnu.org; Sat, 01 Oct 2011 13:22:50 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1RA3IA-0003FU-Qo for bug-gnu-emacs@gnu.org; Sat, 01 Oct 2011 13:24:02 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: <20090318012449.3D66D4858E@rgr.rgrjr.com> Resent-From: Marcus Dreier Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 01 Oct 2011 17:24:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 2703 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.131748979112412 (code B ref -1); Sat, 01 Oct 2011 17:24:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 1 Oct 2011 17:23:11 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RA3HK-0003E8-Hc for submit@debbugs.gnu.org; Sat, 01 Oct 2011 13:23:11 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1R9zUX-00068j-TD for submit@debbugs.gnu.org; Sat, 01 Oct 2011 09:20:34 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R9zTN-0008Ep-3C for submit@debbugs.gnu.org; Sat, 01 Oct 2011 09:19:21 -0400 Original-Received: from lists.gnu.org ([140.186.70.17]:48039) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R9zTN-0008El-1l for submit@debbugs.gnu.org; Sat, 01 Oct 2011 09:19:21 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:35566) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R9zTM-00039P-8n for bug-gnu-emacs@gnu.org; Sat, 01 Oct 2011 09:19:21 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R9zTL-0008EM-0P for bug-gnu-emacs@gnu.org; Sat, 01 Oct 2011 09:19:20 -0400 Original-Received: from mailout-de.gmx.net ([213.165.64.22]:47901) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1R9zTK-0008DR-Iq for bug-gnu-emacs@gnu.org; Sat, 01 Oct 2011 09:19:18 -0400 Original-Received: (qmail invoked by alias); 01 Oct 2011 13:19:15 -0000 Original-Received: from port-92-206-82-92.dynamic.qsc.de (EHLO localhost) [92.206.82.92] by mail.gmx.net (mp008) with SMTP; 01 Oct 2011 15:19:15 +0200 X-Authenticated: #8724316 X-Provags-ID: V01U2FsdGVkX188oo1JjsU8TogpSLOk/1pAXWGAsEyB+LXXISdNWG XUmUaTCQ0XdJQ6 Content-Disposition: inline X-message-flag: Please send plain text messages only. Thank you. X-Y-GMX-Trusted: 0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Mailman-Approved-At: Sat, 01 Oct 2011 13:23:09 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Sat, 01 Oct 2011 13:24:02 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 1) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:52048 Archived-At: 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)