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 17:54:59 -0300 Message-ID: <51253823.1000601@anue.biz> References: <51245E0F.6080603@anue.biz> 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 1361393620 30082 80.91.229.3 (20 Feb 2013 20:53:40 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 20 Feb 2013 20:53:40 +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 21:54:01 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 1U8Gfu-0007N7-7B for ged-emacs-devel@m.gmane.org; Wed, 20 Feb 2013 21:53:58 +0100 Original-Received: from localhost ([::1]:53339 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U8Gfa-0007X0-0D for ged-emacs-devel@m.gmane.org; Wed, 20 Feb 2013 15:53:38 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:34533) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U8GfV-0007Wh-TL for emacs-devel@gnu.org; Wed, 20 Feb 2013 15:53:36 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U8GfM-0000AD-Gn for emacs-devel@gnu.org; Wed, 20 Feb 2013 15:53:33 -0500 Original-Received: from mail-qe0-f53.google.com ([209.85.128.53]:53234) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U8GfM-00009u-DI for emacs-devel@gnu.org; Wed, 20 Feb 2013 15:53:24 -0500 Original-Received: by mail-qe0-f53.google.com with SMTP id 1so3879485qee.40 for ; Wed, 20 Feb 2013 12:53:23 -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=q509VwFQpSodxZjthhsVUiHNK70lcKs9iIYpD5+GZCk=; b=YUpq/Aw5RtnFxq4HXM44Ep/CGerR8pv2lBigVDcl17YyKzQ1q3qWgnFVCGYwg5C1Wq TP3WPkuLdhxLSDKI0ZMbec9vGN3oYAtlNT4rtTHK8L6/aEdHaKXR+y8SgjR3je6lQTQS W1yLwe4jTS+tsmt0oqdIOGykBtRpsCjmdzoj8aMFfT3mS4UiRAwhmGn8FmN63oNT3irT 3I4j/sEJif3xrCx4+BRXwNsE7K+9ay3VrNeJt+vrsZasZHZc5wMnfDa3bUyWYv5wu1uq AL677xfILGU+jkMCWlcJCcYtXrc11XvlJZoCSzUuBad1fBYrntpT9nNsvDKjuxT7OKYV suvQ== X-Received: by 10.49.73.232 with SMTP id o8mr11090347qev.0.1361393602947; Wed, 20 Feb 2013 12:53:22 -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 gw9sm31391321qab.10.2013.02.20.12.53.20 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 20 Feb 2013 12:53:21 -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: ALoCoQks70LrYioiWZVzXXkVwFFJLXgwgyIHFwbnK8cLq8qNLmAZ8u/UPwuqlZNIU4mmt+xqW9DU X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 209.85.128.53 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:157215 Archived-At: On 02/20/2013 11:01 AM, Stefan Monnier wrote: >> 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. > I don't doubt it works, I'm just pointing out that it would be better to > place the save-match-data elsewhere. The general rule is: put the > save-match-data between the "match" and the corresponding "get > match-data" rather than around some code that might modify the match-data. Thanks for the clarification, I pushed a change for this in revno 111284. >> 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? > Yes, it's OK to add files to emacs-24/test/... Pushed in revno 111283. >> 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. > I generally recommend not to go down that route. Instead, just make sure > all the match-{beginning/end/string} calls come right after the > corresponding search, and if not, place a save-match-data around the > intermediate code. That's good, I will not get picky about match-data modification. In any case these replacements of looking-at and string-match are part of a set of good and fairly cheap refactors (partially based on https://github.com/fgallina/python.el/pull/121). Thanks, Fabián