From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.bugs Subject: bug#30277: 26.0.91; Infinite recursion in python-nav-beginning-of-statement Date: Thu, 1 Feb 2018 15:28:36 +0300 Message-ID: <5a08be28-3a08-40b9-aa56-dd64e3a0650d@yandex.ru> References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1517488040 28469 195.159.176.226 (1 Feb 2018 12:27:20 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 1 Feb 2018 12:27:20 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:58.0) Gecko/20100101 Thunderbird/58.0 To: Ola Nilsson , 30277@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Feb 01 13:27:16 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ehDxL-0006dI-EK for geb-bug-gnu-emacs@m.gmane.org; Thu, 01 Feb 2018 13:27:07 +0100 Original-Received: from localhost ([::1]:32971 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ehDzM-0006m6-JY for geb-bug-gnu-emacs@m.gmane.org; Thu, 01 Feb 2018 07:29:12 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57646) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ehDzG-0006lk-IM for bug-gnu-emacs@gnu.org; Thu, 01 Feb 2018 07:29:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ehDzC-00040G-If for bug-gnu-emacs@gnu.org; Thu, 01 Feb 2018 07:29:06 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:43959) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ehDzC-0003zv-E4 for bug-gnu-emacs@gnu.org; Thu, 01 Feb 2018 07:29:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ehDzC-0000Tj-5G for bug-gnu-emacs@gnu.org; Thu, 01 Feb 2018 07:29:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 01 Feb 2018 12:29:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 30277 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: confirmed Original-Received: via spool by 30277-submit@debbugs.gnu.org id=B30277.15174881251814 (code B ref 30277); Thu, 01 Feb 2018 12:29:02 +0000 Original-Received: (at 30277) by debbugs.gnu.org; 1 Feb 2018 12:28:45 +0000 Original-Received: from localhost ([127.0.0.1]:51856 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ehDyv-0000TC-8E for submit@debbugs.gnu.org; Thu, 01 Feb 2018 07:28:45 -0500 Original-Received: from mail-lf0-f54.google.com ([209.85.215.54]:43458) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ehDyu-0000Ss-9V for 30277@debbugs.gnu.org; Thu, 01 Feb 2018 07:28:44 -0500 Original-Received: by mail-lf0-f54.google.com with SMTP id o89so25919034lfg.10 for <30277@debbugs.gnu.org>; Thu, 01 Feb 2018 04:28:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=emndptc7ivzLI240IBJ3cFBVakw7aRuckc4Xfmk/Eys=; b=LI3lcNY5DOZFxa9vOWNaJPs/OKIWU28hGfnbNHIMXUxwn/Fkm/flzj+g8HbhOKPZZ7 x4mcH9StQ6IuAHzzcJhEuq2fw1tPFAYQXSt37okwqmcXTchluQGJ5JKEU6Crm6Da6y4G KnyiswEnw1YwJfv7GuBjy6zUgEv/8gDxXyCqjxxxiIaczHXSnVUYC1m1voaZfDQqnbII WrxSK7r4HRG+zR7a6GwshVmmgFFAOe06iD9ZM5Ju1lT5jzTyQyDYfbqCgIru68+Cf8R2 hiSn1iFC7/k2jorat424cQq2iE0uPpUmTvB6lT4e6bAXVYKwb9naj17c+RIa26MVrtg0 gmrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=emndptc7ivzLI240IBJ3cFBVakw7aRuckc4Xfmk/Eys=; b=C/L5WxIM+gGeneMTM6xHzHFLBNYBUbI8obCSJuYKOHW+T2yRZOR4qZ0fTTSAk3M7jv ZCyesIq04IIh5yamG3BYOSuhFrrVuA2y2cCZIuwB9yUQ7LPcl0Bvr1C6A6vcrEnOUc5f V1yoIk7A7BOO8E02E7Jpv+EAQIgdWYuWLfyRg8gpuInvcjx5xgrQXQTwonTjj+cAeJQ5 vLvstJ0iESeoqwUPbCoMmIYQORz4ThnbWI3gDg18NfNMZtcLG/T3/9Ok/B8G5Hpkfmam u5rK57HzGTvSE+pTBdSg316uRi9q8D/EQ738uoUdhGSwMqZUtsiJcOwdzfB6VYjqu00w QBjw== X-Gm-Message-State: AKwxytfpUSzwuCMaHi9Nu8CWiQ6SPnGZGZ26+lL+gd1hrT0W6/c33rVJ Ojd7IcgdpfwHsDVWKJuDoIdZLhU+ X-Google-Smtp-Source: AH8x224Qikfr2U5my2iILGfwjTUNeficLBDLraQf1/zTGbiqe6/McnXV5FH/3H3TBF2IslzhF5QzhQ== X-Received: by 10.25.79.65 with SMTP id a1mr14733150lfk.97.1517488118112; Thu, 01 Feb 2018 04:28:38 -0800 (PST) Original-Received: from [192.168.1.174] ([178.252.127.239]) by smtp.googlemail.com with ESMTPSA id k86sm3768477ljb.23.2018.02.01.04.28.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 01 Feb 2018 04:28:37 -0800 (PST) In-Reply-To: Content-Language: en-US X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:142764 Archived-At: Hi! On 1/29/18 1:42 AM, Ola Nilsson wrote: > The infinite recursion is triggered when the first line of a > python-mode buffer starts with space and ends with a backslash. > > With emacs -Q > > * create a new buffer > * M-x python-mode > * Insert SPACE \ ENTER > > => Lisp nesting exceeds ‘max-lisp-eval-depth’ > > The infinite recursion is also triggered if the first line of a narrowed > region starts with space and ends on a backslash. This seems to fix it for me. Please test thoroughly, I rarely ever use python-mode myself. diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 5baf6e0f80..ff8269d970 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -1474,7 +1474,7 @@ python-nav-forward-defun (defun python-nav-beginning-of-statement () "Move to start of current statement." (interactive "^") - (back-to-indentation) + (forward-line 0) (let* ((ppss (syntax-ppss)) (context-point (or @@ -1489,6 +1489,7 @@ python-nav-beginning-of-statement (python-info-line-ends-backslash-p)) (forward-line -1) (python-nav-beginning-of-statement)))) + (back-to-indentation) (point-marker)) (defun python-nav-end-of-statement (&optional noend)