GNU bug report logs - #74738
31.0.50; Freezes in Python-mode on some Python file when searching or scrolling

Previous Next

Package: emacs;

Reported by: rehan malak <rehan.malak <at> gmail.com>

Date: Sun, 8 Dec 2024 15:01:02 UTC

Severity: normal

Found in version 31.0.50

Done: Stefan Monnier <monnier <at> iro.umontreal.ca>

Bug is archived. No further changes may be made.

Full log


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

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: kobarity <kobarity <at> gmail.com>
Cc: rehan malak <rehan.malak <at> gmail.com>, Eli Zaretskii <eliz <at> gnu.org>,
 74738 <at> debbugs.gnu.org
Subject: Re: bug#74738: 31.0.50; Freezes in Python-mode on some Python file
 when searching or scrolling
Date: Fri, 13 Dec 2024 18:35:20 -0500
> The mechanism of the hang is still unclear, but I found the cause of
> the font-lock malfunction: when using `up-list' to find the
> corresponding closing brace for an opening brace in an f-string, if
> the format specifier contains "#", the rest of the string is
> considered a comment and the search fails.  Therefore, it can be
> worked around by temporarily binding `parse-sexp-ignore-comments' to
> nil, as in the attached patch.

Maybe a cleaner solution would be to locally use a different
syntax-table (where # doesn't start a comment), but I'm not sure it's
worth the trouble.  So I installed your patch into `master`, thank you.

Maybe we should also temporarily setup a narrowing so `up-list` can't
look past `send`.

BTW, beside removing the `font-lock-string-face` from the `face`
property, `python--font-lock-f-strings` should probably also add
a special face for the ":<FMT>" thingies found (optionally) at the end.

> Hangs on gef.py can also be avoided with this patch, but it assumes
> that the braces are properly closed.  If you remove the closing braces
> of expressions containing "#", it will eventually hang.

Hmm...


        Stefan





This bug report was last modified 152 days ago.

Previous Next


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