From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?ISO-8859-1?Q?Fabi=E1n_Ezequiel_Gallina?= Newsgroups: gmane.emacs.devel Subject: Re: [Emacs-diffs] /srv/bzr/emacs/emacs-24 r111281: * progmodes/python.el (python-info-current-defun): Fix failed Date: Wed, 20 Feb 2013 02:24:31 -0300 Message-ID: <51245E0F.6080603@anue.biz> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1361344675 4317 80.91.229.3 (20 Feb 2013 07:17:55 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 20 Feb 2013 07:17:55 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Feb 20 08:18:18 2013 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1U83wX-0005xM-7d for ged-emacs-devel@m.gmane.org; Wed, 20 Feb 2013 08:18:17 +0100 Original-Received: from localhost ([::1]:53676 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U83wD-0004L9-1X for ged-emacs-devel@m.gmane.org; Wed, 20 Feb 2013 02:17:57 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:35020) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U82Dy-0003sq-Nx for emacs-devel@gnu.org; Wed, 20 Feb 2013 00:28:13 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U82Dw-0003Sr-0E for emacs-devel@gnu.org; Wed, 20 Feb 2013 00:28:10 -0500 Original-Received: from mail-gh0-f173.google.com ([209.85.160.173]:59818) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U82Dv-0003Sa-SA for emacs-devel@gnu.org; Wed, 20 Feb 2013 00:28:07 -0500 Original-Received: by mail-gh0-f173.google.com with SMTP id g2so970256ghb.32 for ; Tue, 19 Feb 2013 21:28:06 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:message-id:date:from:user-agent:mime-version:to:cc :subject:references:in-reply-to:content-type :content-transfer-encoding:x-gm-message-state; bh=AO4XrEdPjhlF+2IwBcQKadzTlb4Qsz0BDc41jOl1uSQ=; b=C0Phowju6P+NOXwET1rjwx1CjN/I59AC6tU+oeTz7sda+1bbC9gN4Co74LHJRkbKsV q0JvENZBVZ9q61PGiBaASgjsYk6p0c8qM57ssQ2oURW2WIPhrCNHvxJIjj3vNAL7k8I+ 3/YIBhQ1KB0SB4qc80D4xDdbcOMgYB+buIcJsho/nk2Qc/oLj/70rVZD0nUboRjrLBE1 pUJqoOwgutiMxDR+NWBP6cDBRYAiQPgpy7BeWth1ZeCG7aCi0nGg4n3KsgR8TQ49bWaR JYvpxrpIKhh2TtNnTjfOWxbe/JV29t2q64Gy1Qfy3XfgJ3Esi0YbWrinlVubCc51oGoW jzUA== X-Received: by 10.236.133.147 with SMTP id q19mr34479889yhi.41.1361337773227; Tue, 19 Feb 2013 21:22:53 -0800 (PST) Original-Received: from [192.168.1.136] (OL144-145.fibertel.com.ar. [24.232.145.144]) by mx.google.com with ESMTPS id j1sm130128884yhn.3.2013.02.19.21.22.50 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 19 Feb 2013 21:22:52 -0800 (PST) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130109 Thunderbird/17.0.2 In-Reply-To: X-Gm-Message-State: ALoCoQmf+chvPxAOdWhmmH3prWpjLuG3R5Jo7r2g7YZ0ryTVYv21O1UkqAqWGZ9fJP/85Nd6VclN X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 209.85.160.173 X-Mailman-Approved-At: Wed, 20 Feb 2013 02:17:55 -0500 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:157190 Archived-At: On 02/19/2013 06:37 PM, Stefan Monnier wrote: >> - (python-nav-end-of-defun) >> + (save-match-data >> + ;; FIXME: avoid cluttering match-data >> + ;; where's not wanted. >> + (python-nav-end-of-defun)) >> (+ (point) >> (if (>= (current-indentation) min-indent) >> (1+ (current-indentation)) > I suspect this is not The Right Place for the save-match-data, since we > should not assume that current-indentation won't also mess up the > match-data. > > > Stefan FWIW this very small change corrected the python-info-current-defun behavior and was able to pass the test suite I've been working on. So far my local test/automated/python-tests.el is covering indentation, movement and python-info-* functions completely. Would it be OK to introduce these tests into the emacs-24 branch? Now, I certainly wasn't expecting current-indentation could change match-data (could it?). If so, I feel that functions not expected[0] to mess with match-data should at least document it. In this regard, I have a change in the works that will cause python.el to stop messing with match-data so much (use of looking-at-p instead of looking-at and such), and document those functions that are intended to. If everyone agrees I could get this to the emacs-24 branch. [0] By "functions not expected[0] to mess with match-data" I mean functions that are not receiving a regexp as argument. Regards, Fabián