From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Vinicius Jose Latorre Newsgroups: gmane.emacs.devel Subject: Re: fix infinite loop in python.el Date: Tue, 31 Jul 2007 21:49:27 -0300 Message-ID: <46AFD897.8040100@ig.com.br> References: <200707211549.54650.pogonyshev@gmx.net> <200707221945.38881.pogonyshev@gmx.net> <200707311656.54091.pogonyshev@gmx.net> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1185929333 15591 80.91.229.12 (1 Aug 2007 00:48:53 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 1 Aug 2007 00:48:53 +0000 (UTC) Cc: rms@gnu.org, emacs-devel@gnu.org To: Paul Pogonyshev Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Aug 01 02:48:37 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1IG2OC-00012F-Te for ged-emacs-devel@m.gmane.org; Wed, 01 Aug 2007 02:48:37 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IG2OC-0008UU-HD for ged-emacs-devel@m.gmane.org; Tue, 31 Jul 2007 20:48:36 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IG2O9-0008S5-CK for emacs-devel@gnu.org; Tue, 31 Jul 2007 20:48:33 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IG2O7-0008RB-Hy for emacs-devel@gnu.org; Tue, 31 Jul 2007 20:48:32 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IG2O7-0008R6-Bb for emacs-devel@gnu.org; Tue, 31 Jul 2007 20:48:31 -0400 Original-Received: from an-out-0708.google.com ([209.85.132.246]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1IG2O6-00014b-SB for emacs-devel@gnu.org; Tue, 31 Jul 2007 20:48:31 -0400 Original-Received: by an-out-0708.google.com with SMTP id c25so7131ana for ; Tue, 31 Jul 2007 17:48:29 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:user-agent:mime-version:to:cc:subject:references:in-reply-to:content-type:content-transfer-encoding:sender; b=kx428aagnAD7qybzFjqBd9n9+cilBKT8HNPxTrXiT9A6ajwy7+8lTgUtcMjavMSJeJqZ07CzHz1RsMkcuhQRs0+J2SJZDojybMX/L9ux4eHzQlq2ooToXuy3u0vZA3LCuZh3eT3OCmBzzZFIVrSwiIuLfhzmX26KBSvjuSJWMno= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:user-agent:mime-version:to:cc:subject:references:in-reply-to:content-type:content-transfer-encoding:sender; b=RwudpD5H2PTowCE8ccL9yK+op9S3c/hkxyRY378KtmGMXoIsLJtPjQhV+LtfdBcDmGgI5dG9uoAyK0YkxfK8IaN8rMIPK79uotuiODJ8y8cVHoi/A9uAipclx+dTiUPn2PVMlyXyibV1VIMzO0izorvYB0TW5Aha3bxmytSv+Cc= Original-Received: by 10.100.144.11 with SMTP id r11mr98612and.1185929309265; Tue, 31 Jul 2007 17:48:29 -0700 (PDT) Original-Received: from ?201.82.142.28? ( [201.82.142.28]) by mx.google.com with ESMTPS id c16sm199329anc.2007.07.31.17.48.26 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 31 Jul 2007 17:48:28 -0700 (PDT) User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.5) Gecko/20070716 SeaMonkey/1.1.3 In-Reply-To: <200707311656.54091.pogonyshev@gmx.net> X-Detected-Kernel: Linux 2.6 (newer, 2) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:75875 Archived-At: Paul Pogonyshev wrote: > Richard Stallman wrote: > >> I guess we may as well install the change in Emacs 22. >> >> If nobody installs it in a few days, would you please remind people >> until they do? >> > > Can someone install this? > Done. This patch applies only in trunk, not in Emacs 22 branch. > 2007-07-21 Paul Pogonyshev > > * progmodes/python.el (python-current-defun): Adjust to never fall > into infinite loop. > > > *** python.el 12 Jul 2007 22:55:32 +0300 1.63 > --- python.el 21 Jul 2007 15:46:18 +0300 > *************** > *** 1828,1848 **** > (save-excursion > ;; Move up the tree of nested `class' and `def' blocks until we > ;; get to zero indentation, accumulating the defined names. > ! (let ((start t) > ! (accum) > (length -1)) > ! (while (and (or start (> (current-indentation) 0)) > ! (or (null length-limit) > ! (null (cdr accum)) > ! (< length length-limit))) > ! (setq start nil) > ! (python-beginning-of-block) > ! (end-of-line) > ! (beginning-of-defun) > ! (when (looking-at (rx (0+ space) (or "def" "class") (1+ space) > ! (group (1+ (or word (syntax symbol)))))) > ! (push (match-string 1) accum) > ! (setq length (+ length 1 (length (car accum)))))) > (when accum > (when (and length-limit (> length length-limit)) > (setcar accum "..")) > --- 1828,1852 ---- > (save-excursion > ;; Move up the tree of nested `class' and `def' blocks until we > ;; get to zero indentation, accumulating the defined names. > ! (let ((accum) > (length -1)) > ! (catch 'done > ! (while (or (null length-limit) > ! (null (cdr accum)) > ! (< length length-limit)) > ! (setq start nil) > ! (let ((started-from (point))) > ! (python-beginning-of-block) > ! (end-of-line) > ! (beginning-of-defun) > ! (when (= (point) started-from) > ! (throw 'done nil))) > ! (when (looking-at (rx (0+ space) (or "def" "class") (1+ space) > ! (group (1+ (or word (syntax symbol)))))) > ! (push (match-string 1) accum) > ! (setq length (+ length 1 (length (car accum))))) > ! (when (= (current-indentation) 0) > ! (throw 'done nil)))) > (when accum > (when (and length-limit (> length length-limit)) > (setcar accum "..")) >