GNU bug report logs - #21671
[PATCH] fix python.el hanging up during fontification #21657

Previous Next

Package: emacs;

Reported by: immerrr again <immerrr <at> gmail.com>

Date: Mon, 12 Oct 2015 11:49:02 UTC

Severity: normal

Tags: confirmed, fixed, patch

Merged with 21628, 21629, 21646, 21657, 24839, 24856, 24905, 26041

Found in versions 25.0.50, 25.1, 25.1.50, 26.0.50

Fixed in version 25.2

Done: Daniel Colascione <dancol <at> dancol.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 21671 in the body.
You can then email your comments to 21671 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#21671; Package emacs. (Mon, 12 Oct 2015 11:49:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to immerrr again <immerrr <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 12 Oct 2015 11:49:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: immerrr again <immerrr <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: [PATCH] fix python.el hanging up during fontification #21657
Date: Mon, 12 Oct 2015 14:48:50 +0300
[Message part 1 (text/plain, inline)]
Two patches are included.

One fixes the fact that for some reason syntax-propertize--done has
ceased to be buffer-local after commit [1] and for some reason commit
[2] did not help. I did it the way other buffer-local variables are
initialized and it worked. The change fixes #21657 that was failing
because syntax-propertize--done was inherited from scratch buffer and
docstring boundaries were not propertized as a result.

The other infinite loop I found accidentally when adding a whitespace
before module docstring. I have fixed one corner-case of it, but in
other circumstances I'd argue that whatever smart extensions
python-mode adds to forward-sexp, those extensions should never move
point less than the normal forward-sexp should.

Cheers,
immerrr

1. https://github.com/emacs-mirror/emacs/commit/3928ef2dd5b8febf3b1d9c1bfb22af3698d16bea

2. https://github.com/emacs-mirror/emacs/commit/0360b7f2c4f0358106e229de4dfe91a67445a50c
[0002-Prevent-infinite-loop-in-python-info-docstring-p.patch (text/x-patch, attachment)]
[0001-Fix-syntax-propertize-done-to-be-buffer-local.patch (text/x-patch, attachment)]

Merged 21628 21629 21646 21657 21671. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Mon, 12 Oct 2015 20:39:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#21671; Package emacs. (Tue, 13 Oct 2015 07:38:01 GMT) Full text and rfc822 format available.

Message #10 received at 21671 <at> debbugs.gnu.org (full text, mbox):

From: immerrr again <immerrr <at> gmail.com>
To: 21671 <at> debbugs.gnu.org
Subject: Re: bug#21671: [PATCH] fix python.el hanging up during fontification
 #21657
Date: Tue, 13 Oct 2015 10:37:38 +0300
FTR, 0001-Fix-syntax-propertize-done.. patch seems unnecessary as commit [1]
does its job.

1. https://github.com/emacs-mirror/emacs/commit/0360b7f2c4f0358106e229de4dfe91a67445a50c

On Mon, Oct 12, 2015 at 2:48 PM, immerrr again <immerrr <at> gmail.com> wrote:
> Two patches are included.
>
> One fixes the fact that for some reason syntax-propertize--done has
> ceased to be buffer-local after commit [1] and for some reason commit
> [2] did not help. I did it the way other buffer-local variables are
> initialized and it worked. The change fixes #21657 that was failing
> because syntax-propertize--done was inherited from scratch buffer and
> docstring boundaries were not propertized as a result.
>
> The other infinite loop I found accidentally when adding a whitespace
> before module docstring. I have fixed one corner-case of it, but in
> other circumstances I'd argue that whatever smart extensions
> python-mode adds to forward-sexp, those extensions should never move
> point less than the normal forward-sexp should.
>
> Cheers,
> immerrr
>
> 1. https://github.com/emacs-mirror/emacs/commit/3928ef2dd5b8febf3b1d9c1bfb22af3698d16bea
>
> 2. https://github.com/emacs-mirror/emacs/commit/0360b7f2c4f0358106e229de4dfe91a67445a50c




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#21671; Package emacs. (Tue, 13 Oct 2015 08:44:02 GMT) Full text and rfc822 format available.

Message #13 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Torsten Bronger <bronger <at> physik.rwth-aachen.de>
To: bug-gnu-emacs <at> gnu.org
Subject: Re: bug#21671: [PATCH] fix python.el hanging up during fontification
 #21657
Date: Tue, 13 Oct 2015 10:43:20 +0200
Hallöchen!

immerrr again writes:

> FTR, 0001-Fix-syntax-propertize-done.. patch seems unnecessary as commit [1]
> does its job.

Does this mean that the infinite loop thingy is gone for Python
docstrings?

Tschö,
Torsten.

-- 
Torsten Bronger    Jabber ID: torsten.bronger <at> jabber.rwth-aachen.de





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#21671; Package emacs. (Tue, 13 Oct 2015 08:57:01 GMT) Full text and rfc822 format available.

Message #16 received at submit <at> debbugs.gnu.org (full text, mbox):

From: immerrr again <immerrr <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: Re: bug#21671: [PATCH] fix python.el hanging up during fontification
 #21657
Date: Tue, 13 Oct 2015 11:56:45 +0300
Works for me. I'd still change a thing or two in python.el code, but
triplequoted strings are propertized, so it does not inf-loop anymore.

On Tue, Oct 13, 2015 at 11:43 AM, Torsten Bronger
<bronger <at> physik.rwth-aachen.de> wrote:
> Hallöchen!
>
> immerrr again writes:
>
>> FTR, 0001-Fix-syntax-propertize-done.. patch seems unnecessary as commit [1]
>> does its job.
>
> Does this mean that the infinite loop thingy is gone for Python
> docstrings?
>
> Tschö,
> Torsten.
>
> --
> Torsten Bronger    Jabber ID: torsten.bronger <at> jabber.rwth-aachen.de
>
>
>
>




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#21671; Package emacs. (Sat, 24 Oct 2015 16:06:01 GMT) Full text and rfc822 format available.

Message #19 received at 21671 <at> debbugs.gnu.org (full text, mbox):

From: immerrr again <immerrr <at> gmail.com>
To: 21671 <at> debbugs.gnu.org
Subject: Re: bug#21671: [PATCH] fix python.el hanging up during fontification
 #21657
Date: Sat, 24 Oct 2015 19:04:44 +0300
On Mon, Oct 12, 2015 at 2:48 PM, immerrr again <immerrr <at> gmail.com> wrote:
> Two patches are included.
>

Is there anything that prevents merging the second patch
(0002-Prevent-infinite-...) that fixes the situation described below?

>
> The other infinite loop I found accidentally when adding a whitespace
> before module docstring. I have fixed one corner-case of it, but in
> other circumstances I'd argue that whatever smart extensions
> python-mode adds to forward-sexp, those extensions should never move
> point less than the normal forward-sexp should.

Cheers,
immerrr




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#21671; Package emacs. (Sun, 07 Feb 2016 11:45:02 GMT) Full text and rfc822 format available.

Message #22 received at 21671 <at> debbugs.gnu.org (full text, mbox):

From: immerrr again <immerrr <at> gmail.com>
To: 21671 <at> debbugs.gnu.org,
 Fabián Ezequiel Gallina <fgallina <at> gnu.org>
Subject: Re: bug#21671: [PATCH] fix python.el hanging up during fontification
 #21657
Date: Sun, 7 Feb 2016 13:44:37 +0200
On Sat, Oct 24, 2015 at 7:04 PM, immerrr again <immerrr <at> gmail.com> wrote:
> On Mon, Oct 12, 2015 at 2:48 PM, immerrr again <immerrr <at> gmail.com> wrote:
>> Two patches are included.
>>
>> snip
>>
>> The other infinite loop I found accidentally when adding a whitespace
>> before module docstring. I have fixed one corner-case of it, but in
>> other circumstances I'd argue that whatever smart extensions
>> python-mode adds to forward-sexp, those extensions should never move
>> point less than the normal forward-sexp should.

Any comments about the five-line patch that fixes the situation described above?

Cheers,
immerrr




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#21671; Package emacs. (Tue, 23 Feb 2016 09:07:02 GMT) Full text and rfc822 format available.

Message #25 received at 21671 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: immerrr again <immerrr <at> gmail.com>
Cc: 21671 <at> debbugs.gnu.org, 21628 <at> debbugs.gnu.org
Subject: Re: bug#21671: [PATCH] fix python.el hanging up during fontification
 #21657
Date: Tue, 23 Feb 2016 20:06:01 +1100
immerrr again <immerrr <at> gmail.com> writes:

> Works for me. I'd still change a thing or two in python.el code, but
> triplequoted strings are propertized, so it does not inf-loop anymore.

Ok; closing this bug report.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Added tag(s) fixed. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Tue, 23 Feb 2016 09:07:03 GMT) Full text and rfc822 format available.

bug marked as fixed in version 25.1, send any further explanations to 21628 <at> debbugs.gnu.org and Torsten Bronger <bronger <at> physik.rwth-aachen.de> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Tue, 23 Feb 2016 09:07:03 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#21671; Package emacs. (Tue, 23 Feb 2016 09:19:02 GMT) Full text and rfc822 format available.

Message #32 received at 21671 <at> debbugs.gnu.org (full text, mbox):

From: immerrr again <immerrr <at> gmail.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 21671 <at> debbugs.gnu.org
Subject: Re: bug#21671: [PATCH] fix python.el hanging up during fontification
 #21657
Date: Tue, 23 Feb 2016 11:17:55 +0200
On Tue, Feb 23, 2016 at 11:06 AM, Lars Ingebrigtsen <larsi <at> gnus.org> wrote:
>
> Ok; closing this bug report.
>

There were two patches in the original message, one contained a fix
for an issue fixed otherwise, the other can still infloop (as of
25.0.50.1), albeit in a rather unusual situation: when a python-mode
buffer starts with a whitespace followed by a quote.

What about the second patch?

Cheers,
immerrr




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#21671; Package emacs. (Tue, 23 Feb 2016 09:51:02 GMT) Full text and rfc822 format available.

Message #35 received at 21671 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: immerrr again <immerrr <at> gmail.com>
Cc: 21671 <at> debbugs.gnu.org
Subject: Re: bug#21671: [PATCH] fix python.el hanging up during fontification
 #21657
Date: Tue, 23 Feb 2016 20:49:27 +1100
immerrr again <immerrr <at> gmail.com> writes:

> There were two patches in the original message, one contained a fix
> for an issue fixed otherwise, the other can still infloop (as of
> 25.0.50.1), albeit in a rather unusual situation: when a python-mode
> buffer starts with a whitespace followed by a quote.
>
> What about the second patch?

Could you repost the second patch?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#21671; Package emacs. (Tue, 23 Feb 2016 10:02:02 GMT) Full text and rfc822 format available.

Message #38 received at 21671 <at> debbugs.gnu.org (full text, mbox):

From: immerrr again <immerrr <at> gmail.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 21671 <at> debbugs.gnu.org
Subject: Re: bug#21671: [PATCH] fix python.el hanging up during fontification
 #21657
Date: Tue, 23 Feb 2016 12:00:54 +0200
[Message part 1 (text/plain, inline)]
On Tue, Feb 23, 2016 at 11:49 AM, Lars Ingebrigtsen <larsi <at> gnus.org> wrote:
> immerrr again <immerrr <at> gmail.com> writes:
>
> Could you repost the second patch?
>

Sure, attaching it.

Cheers,
immerrr
[0002-Prevent-infinite-loop-in-python-info-docstring-p.patch (text/x-patch, attachment)]

bug No longer marked as fixed in versions 25.1 and reopened. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 23 Feb 2016 10:05:01 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#21671; Package emacs. (Tue, 23 Feb 2016 10:06:02 GMT) Full text and rfc822 format available.

Message #43 received at 21671 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: immerrr again <immerrr <at> gmail.com>
Cc: 21671 <at> debbugs.gnu.org
Subject: Re: bug#21671: [PATCH] fix python.el hanging up during fontification
 #21657
Date: Tue, 23 Feb 2016 21:04:34 +1100
immerrr again <immerrr <at> gmail.com> writes:

> @@ -1712,7 +1712,11 @@ expressions when looking at them in either direction."
>                     (python-nav-beginning-of-block))
>                    ((memq context '(statement-start block-start))
>                     (goto-char next-sexp-pos)
> -                   (python-nav-beginning-of-statement))
> +                   (unless (bobp)
> +                     ;; If backward-sexp brought the point to
> +                     ;; beginning-of-buffer, beginning-of-statement
> +                     ;; will only bring it back.
> +                     (python-nav-beginning-of-statement)))
>                    (t (goto-char next-sexp-pos))))))))))

I'm not a Python mode user, so I can't really review this patch.  I've
reopened the bug -- could somebody else have a peek at this?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#21671; Package emacs. (Wed, 01 Mar 2017 01:06:01 GMT) Full text and rfc822 format available.

Message #46 received at 21671 <at> debbugs.gnu.org (full text, mbox):

From: npostavs <at> users.sourceforge.net
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 21671 <at> debbugs.gnu.org, immerrr again <immerrr <at> gmail.com>
Subject: Re: bug#21671: [PATCH] fix python.el hanging up during fontification
 #21657
Date: Tue, 28 Feb 2017 20:06:15 -0500
unarchive 24905
forcemerge 24905 21671
quit

Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> immerrr again <immerrr <at> gmail.com> writes:
>
>> @@ -1712,7 +1712,11 @@ expressions when looking at them in either direction."
>>                     (python-nav-beginning-of-block))
>>                    ((memq context '(statement-start block-start))
>>                     (goto-char next-sexp-pos)
>> -                   (python-nav-beginning-of-statement))
>> +                   (unless (bobp)
>> +                     ;; If backward-sexp brought the point to
>> +                     ;; beginning-of-buffer, beginning-of-statement
>> +                     ;; will only bring it back.
>> +                     (python-nav-beginning-of-statement)))
>>                    (t (goto-char next-sexp-pos))))))))))
>
> I'm not a Python mode user, so I can't really review this patch.  I've
> reopened the bug -- could somebody else have a peek at this?

AFAICT, the problem is solved in #24905, so there is no need for this
patch.




Forcibly Merged 21628 21629 21646 21657 21671 24839 24856 24905. Request was from npostavs <at> users.sourceforge.net to control <at> debbugs.gnu.org. (Wed, 01 Mar 2017 01:06:02 GMT) Full text and rfc822 format available.

Merged 21628 21629 21646 21657 21671 24839 24856 24905 26041. Request was from npostavs <at> users.sourceforge.net to control <at> debbugs.gnu.org. (Thu, 09 Mar 2017 23:14:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 07 Apr 2017 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 8 years and 71 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.