From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Bob Rogers Newsgroups: gmane.emacs.bugs,gmane.emacs.pretest.bugs Subject: bug#2703: 23.0.91; Error in Python indenter Date: Tue, 17 Mar 2009 21:24:49 -0400 (EDT) Message-ID: <20090318012449.3D66D4858E@rgr.rgrjr.com> Reply-To: Bob Rogers , 2703@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org X-Trace: ger.gmane.org 1237341738 29882 80.91.229.12 (18 Mar 2009 02:02:18 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 18 Mar 2009 02:02:18 +0000 (UTC) To: emacs-pretest-bug@gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Mar 18 03:03:33 2009 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Ljl7z-0000w7-01 for geb-bug-gnu-emacs@m.gmane.org; Wed, 18 Mar 2009 03:03:32 +0100 Original-Received: from localhost ([127.0.0.1]:38827 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ljl6c-0006pv-Ps for geb-bug-gnu-emacs@m.gmane.org; Tue, 17 Mar 2009 22:02:06 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Ljkow-0002VG-Uc for bug-gnu-emacs@gnu.org; Tue, 17 Mar 2009 21:43:50 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Ljkos-0002SF-23 for bug-gnu-emacs@gnu.org; Tue, 17 Mar 2009 21:43:50 -0400 Original-Received: from [199.232.76.173] (port=34395 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ljkor-0002S9-UB for bug-gnu-emacs@gnu.org; Tue, 17 Mar 2009 21:43:45 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:37704) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Ljkor-0001TG-9W for bug-gnu-emacs@gnu.org; Tue, 17 Mar 2009 21:43:45 -0400 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n2I1hhgY028360; Tue, 17 Mar 2009 18:43:43 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.13.8/8.13.8/Submit) id n2I1U33G024202; Tue, 17 Mar 2009 18:30:03 -0700 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: Bob Rogers Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Wed, 18 Mar 2009 01:30:03 +0000 Resent-Message-ID: Resent-Sender: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: report 2703 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by submit@emacsbugs.donarmstrong.com id=B.123733950923583 (code B ref -1); Wed, 18 Mar 2009 01:30:03 +0000 Original-Received: (at submit) by emacsbugs.donarmstrong.com; 18 Mar 2009 01:25:09 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-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 Original-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 Original-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 Original-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 Original-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) Original-Received: (qmail 22854 invoked by uid 89); 18 Mar 2009 01:24:50 -0000 Original-Received: from unknown (HELO rgr.rgrjr.com) (192.168.57.1) by home with SMTP; 18 Mar 2009 01:24:50 -0000 Original-Received: by rgr.rgrjr.com (Postfix, from userid 500) id 3D66D4858E; Tue, 17 Mar 2009 21:24:49 -0400 (EDT) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Resent-Date: Tue, 17 Mar 2009 21:43:50 -0400 X-Mailman-Approved-At: Tue, 17 Mar 2009 22:01:31 -0400 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:26448 gmane.emacs.pretest.bugs:24147 Archived-At: 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.