From rogers-perl6@rgrjr.dyndns.org Tue Mar 17 18:25:09 2009 Received: (at submit) by emacsbugs.donarmstrong.com; 18 Mar 2009 01:25:09 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=0.1 required=4.0 tests=FOURLA,MURPHY_DRUGS_REL8 autolearn=no version=3.2.5-bugs.debian.org_2005_01_02 Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n2I1P4tP023018 for ; Tue, 17 Mar 2009 18:25:05 -0700 Received: from mx10.gnu.org ([199.232.76.166]:42977) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1LjkWl-0001ZJ-SD for emacs-pretest-bug@gnu.org; Tue, 17 Mar 2009 21:25:04 -0400 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1LjkWh-0007sU-DM for emacs-pretest-bug@gnu.org; Tue, 17 Mar 2009 21:25:03 -0400 Received: from rgrjr.com ([216.146.47.5]:59780) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LjkWg-0007qc-TU for emacs-pretest-bug@gnu.org; Tue, 17 Mar 2009 21:24:59 -0400 Received: from rgrjr.dyndns.org (c-66-30-196-77.hsd1.ma.comcast.net [66.30.196.77]) by rgrjr.com (Postfix on CentOS) with ESMTP id 059AA1600DC for ; Wed, 18 Mar 2009 01:24:50 +0000 (UTC) Received: (qmail 22854 invoked by uid 89); 18 Mar 2009 01:24:50 -0000 Received: from unknown (HELO rgr.rgrjr.com) (192.168.57.1) by home with SMTP; 18 Mar 2009 01:24:50 -0000 Received: by rgr.rgrjr.com (Postfix, from userid 500) id 3D66D4858E; Tue, 17 Mar 2009 21:24:49 -0400 (EDT) From: Bob Rogers To: emacs-pretest-bug@gnu.org Subject: 23.0.91; Error in Python indenter Message-Id: <20090318012449.3D66D4858E@rgr.rgrjr.com> Date: Tue, 17 Mar 2009 21:24:49 -0400 (EDT) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) 1. Put the following code into the indent-test.py file: ================ def parse_cvs(self, stream): new_entry \ = Entry(encoded_date = mod.encoded_date, files = mods) # The indenter can't handle this line. combined_entries.append(new_entry) ================ 2. "emacs -Q indent-test.py" 3. Move the cursor anywhere on the comment line, and type TAB. You should see this error message: python-indent-line: Wrong type argument: number-or-marker-p, nil The patch at the bottom to lisp/python.el (rev 1.95, which is current in trunk) addresses the immediate problem, by refusing to add nil to the end of python-indent-list. The resulting behavior is still not right: The indenter then oscillates between indenting by 0 and 8, without considering 4 at all. I suspect that python-beginning-of-statement is getting confused by the mixed continuation style of the previous three lines, and this confusion is the cause of both problems, but I haven't been able to track it further. TIA, -- Bob Rogers http://www.rgrjr.com/ ------------------------------------------------------------------------ In GNU Emacs 23.0.91.1 (i686-pc-linux-gnu, GTK+ Version 2.12.9) of 2009-03-06 on rgr Windowing system distributor `The X.Org Foundation', version 11.0.10400090 Important settings: value of $LC_ALL: nil value of $LC_COLLATE: nil value of $LC_CTYPE: nil value of $LC_MESSAGES: nil value of $LC_MONETARY: nil value of $LC_NUMERIC: nil value of $LC_TIME: nil value of $LANG: en_US.UTF-8 value of $XMODIFIERS: nil locale-coding-system: utf-8-unix default-enable-multibyte-characters: t Major mode: Shell Minor modes in effect: diff-auto-refine-mode: t shell-dirtrack-mode: t mouse-wheel-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t Recent input: C-u C-SPC C-u C-SPC C-u C-n C-n C-n C-SPC C-u C-p C-p C-p C-w C-_ C-e C-f C-e C-f C-k C-k C-k C-k C-k C-k C-n M-f C-p M-^ C-e C-f M-f C-_ C-n C-n C-n C-u - 4 C-g C-x C-x M-{ C-u - 4 C-x TAB C-SPC C-p C-p C-w C-u C-SPC C-u C-SPC C-p M-b C-n C-a C-k C-k M-b C-_ C-_ C-_ M-b C-n C-n M-> C-w C-u C-SPC C-p M-b C-u C-p C-p C-p C-a C-SPC C-n C-n C-w C-u C-SPC C-u C-SPC C-u C-j C-SPC C-_ M-> C-p M-b C-a M-f M-b C-k T h i s SPC d o e s n ' t SPC i n d e n t SPC c o r r e c t l y . M-b M-b M-b M-b M-b T h e SPC i n d e n t e r SPC c a n ' t SPC h a n d l e SPC M-l C-k SPC l i n e . q C-f C-e C-f C-f C-x 4 b * M e s M-> C-p C-p C-p C-p C-SPC C-p M-w C-u C-SPC C-x b f o o M-> C-y C-u C-SPC C-M-f C-M-f C-f C-o C-f C-f C-M-f C-o C-M-f C-o C-f C-f C-e C-M-b C-M-f C-f C-f C-x o C-u C-p C-p M-f M-f C-d C-d C-n M-b = SPC SPC C-n C-p C-n SPC SPC C-n C-p C-p M-^ C-n C-n C-_ C-_ C-_ C-x C-s C-x o e m a c s SPC - Q SPC i n d e SPC & M-x r e p o r Recent messages: python-indent-list is ((0 . #("def parse_cvs(self, stream):" 0 3 (fontified t face font-lock-keyword-face) 3 4 (fontified t) 4 13 (fontified t face font-lock-function-name-face) 13 14 (fontified t) 14 18 (fontified t face py-pseudo-keyword-face) 18 28 (fontified t))) (8 . #("= Entry(encoded_date = mod.encoded_date," 0 2 (fontified t) 2 26 (fontified t) 26 38 (fontified t) 38 39 (rear-nonsticky t fontified t) 39 40 (fontified t))) nil) [target nil] python-indent-line: Wrong type argument: number-or-marker-p, nil python-indent-list is ((0 . #("def parse_cvs(self, stream):" 0 3 (fontified t face font-lock-keyword-face) 3 4 (fontified t) 4 13 (fontified t face font-lock-function-name-face) 13 14 (fontified t) 14 18 (fontified t face py-pseudo-keyword-face) 18 28 (fontified t))) (4 . #("new_entry = Entry(encoded_date = mod.encoded_date," 0 9 (fontified t) 9 10 (fontified t) 10 12 (fontified t) 12 36 (fontified t) 36 48 (fontified t) 48 49 (rear-nonsticky t fontified t) 49 50 (fontified t)))) [target 4] Undo! [3 times] Auto-saving... Saving file /home/rogers/projects/system/scripts/indent-test.py... Wrote /home/rogers/projects/system/scripts/indent-test.py Partially completed ---------------- Index: lisp/progmodes/python.el =================================================================== RCS file: /sources/emacs/emacs/lisp/progmodes/python.el,v retrieving revision 1.95 diff -c -r1.95 python.el *** lisp/progmodes/python.el 20 Feb 2009 16:30:56 -0000 1.95 --- lisp/progmodes/python.el 18 Mar 2009 00:11:18 -0000 *************** *** 723,731 **** (forward-line) (unless (python-comment-line-p) (let ((elt (assq (current-indentation) python-indent-list))) ! (setq python-indent-list ! (nconc (delete elt python-indent-list) ! (list elt)))))) (caar (last python-indent-list))))))) ;;;; Cycling through the possible indentations with successive TABs. --- 723,732 ---- (forward-line) (unless (python-comment-line-p) (let ((elt (assq (current-indentation) python-indent-list))) ! (when elt ! (setq python-indent-list ! (nconc (delete elt python-indent-list) ! (list elt))))))) (caar (last python-indent-list))))))) ;;;; Cycling through the possible indentations with successive TABs. From lekktu@gmail.com Wed Mar 18 01:54:46 2009 Received: (at control) by emacsbugs.donarmstrong.com; 18 Mar 2009 08:54:46 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: ** X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=2.3 required=4.0 tests=MISSING_SUBJECT,NOSUBJECT, VALID_BTS_CONTROL autolearn=no version=3.2.5-bugs.debian.org_2005_01_02 Received: from mail-ew0-f178.google.com (mail-ew0-f178.google.com [209.85.219.178]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n2I8shQ7009185 for ; Wed, 18 Mar 2009 01:54:44 -0700 Received: by ewy26 with SMTP id 26so355830ewy.1 for ; Wed, 18 Mar 2009 01:54:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type:content-transfer-encoding; bh=WVOawQKVqVDjTdXgTO6qK4v4bd0MV7/Ol4FggzLxUwo=; b=a2gidS1456dCAyxhVmBxInpMrJIB+vFspWPSf2T8wfvsETJVAmuHftpBkW3anN7vpU sIS1oXkMdZRYt9DhlLMJZzngSx1exT4wU7cJc45vk2ZS+kiuLUCu4aBqwtvG+YXt/Yia dQS3sHGJD3B83jDwxl0/JrlWSjWcGf3Hu1EEA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type :content-transfer-encoding; b=C3VOPrwCMMfkLcmEoZKk1snEI69kWxbxwPkKm5nVJKvzzmmdUdLfWdNs1tApUp1zfF aJhuThd9z2liWKkxmCAx2jKb/Cv43yi3LxCYN1jNiKHqjCCDWhc1zq6LHuCKsxSuzXJn 7MSxTkWs39RnElOSo2AL2U+8irceAH58i5vm0= MIME-Version: 1.0 Received: by 10.210.60.3 with SMTP id i3mr5260953eba.58.1237366477590; Wed, 18 Mar 2009 01:54:37 -0700 (PDT) Date: Wed, 18 Mar 2009 09:54:37 +0100 Message-ID: Subject: From: Juanma Barranquero To: control@debbugs.gnu.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit reassign 2692 spam reassign 2697 spam reassign 2698 spam reassign 2699 spam reassign 2700 spam reassign 2702 emacs,w32 reassign 2703 emacs,python reassign 2704 spam merge 2705 2706 reassign 2707 emacs,rmail quit From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 01 13:23:11 2011 Received: (at submit) by debbugs.gnu.org; 1 Oct 2011 17:23:11 +0000 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 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 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 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,RP_MATCHES_RCVD,T_TO_NO_BRKTS_FREEMAIL autolearn=unavailable version=3.3.1 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 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 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 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 Received: (qmail invoked by alias); 01 Oct 2011 13:19:15 -0000 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 Date: Sat, 1 Oct 2011 15:19:10 +0200 From: Marcus Dreier To: bug-gnu-emacs@gnu.org Subject: bug#2703: 23.0.91; Error in Python indenter Message-ID: <20111001131910.GA862@staatsfeind.sperrbezirk.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 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-Received-From: 140.186.70.17 X-Spam-Score: -5.9 (-----) X-Debbugs-Envelope-To: submit 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 Reply-To: Marcus Dreier List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.9 (-----) 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) From debbugs-submit-bounces@debbugs.gnu.org Wed Nov 09 10:01:43 2011 Received: (at 2703) by debbugs.gnu.org; 9 Nov 2011 15:01:43 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RO9el-0008Mz-7k for submit@debbugs.gnu.org; Wed, 09 Nov 2011 10:01:42 -0500 Received: from ironport2-out.teksavvy.com ([206.248.154.181] helo=ironport2-out.pppoe.ca) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RO9ej-0008Mk-0H for 2703@debbugs.gnu.org; Wed, 09 Nov 2011 10:01:37 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av4EAEKVuk5MCoYy/2dsb2JhbABCp36CH4EGgXIBAQQBViMFCwsOJhIUGA0kiBW4O4l/BIgMmWGESA X-IronPort-AV: E=Sophos;i="4.69,484,1315195200"; d="scan'208";a="147147161" Received: from 76-10-134-50.dsl.teksavvy.com (HELO pastel.home) ([76.10.134.50]) by ironport2-out.pppoe.ca with ESMTP/TLS/ADH-AES256-SHA; 09 Nov 2011 10:01:25 -0500 Received: by pastel.home (Postfix, from userid 20848) id 77B945936A; Wed, 9 Nov 2011 10:01:25 -0500 (EST) From: Stefan Monnier To: Marcus Dreier Subject: Re: bug#2703: 23.0.91; Error in Python indenter Message-ID: References: <20090318012449.3D66D4858E@rgr.rgrjr.com> <20111001131910.GA862@staatsfeind.sperrbezirk.net> Date: Wed, 09 Nov 2011 10:01:25 -0500 In-Reply-To: <20111001131910.GA862@staatsfeind.sperrbezirk.net> (Marcus Dreier's message of "Sat, 1 Oct 2011 15:19:10 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.91 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.7 (--) X-Debbugs-Envelope-To: 2703 Cc: 2703@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.7 (--) > 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) From debbugs-submit-bounces@debbugs.gnu.org Wed Nov 09 10:34:43 2011 Received: (at control) by debbugs.gnu.org; 9 Nov 2011 15:34:43 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1ROAAl-0000h6-Dg for submit@debbugs.gnu.org; Wed, 09 Nov 2011 10:34:43 -0500 Received: from ironport2-out.teksavvy.com ([206.248.154.181] helo=ironport2-out.pppoe.ca) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1ROAAj-0000gs-UL for control@debbugs.gnu.org; Wed, 09 Nov 2011 10:34:42 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AkUIAD2cuk5MCoYy/2dsb2JhbABCmmuPMoEGghI9ciYYDaAdoD+JfwSIDJlhhEg X-IronPort-AV: E=Sophos;i="4.69,484,1315195200"; d="scan'208";a="147154689" Received: from 76-10-134-50.dsl.teksavvy.com (HELO pastel.home) ([76.10.134.50]) by ironport2-out.pppoe.ca with ESMTP/TLS/ADH-AES256-SHA; 09 Nov 2011 10:34:30 -0500 Received: by pastel.home (Postfix, from userid 20848) id 1BEED5936A; Wed, 9 Nov 2011 10:34:30 -0500 (EST) From: Stefan Monnier To: control@debbugs.gnu.org Subject: bug#2703 Message-ID: Date: Wed, 09 Nov 2011 10:34:30 -0500 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.91 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.7 (--) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.7 (--) close 2703 thanks From unknown Sun Jun 15 08:37:50 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Thu, 08 Dec 2011 12:24:03 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator