From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: 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 Message-ID: References: <868qsqf54x.fsf@gnu.org> Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="6282"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: rehan malak , Eli Zaretskii , 74738@debbugs.gnu.org To: kobarity Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Dec 14 00:36:22 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1tMFCn-0001T3-AK for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 14 Dec 2024 00:36:21 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tMFCY-0006hs-51; Fri, 13 Dec 2024 18:36:06 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tMFCW-0006YV-5E for bug-gnu-emacs@gnu.org; Fri, 13 Dec 2024 18:36:04 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tMFCU-0004bK-Fr for bug-gnu-emacs@gnu.org; Fri, 13 Dec 2024 18:36:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:References:In-Reply-To:From:To:Subject; bh=0iPTL89kfpIinII/1hrNTW8vYm0RUyXxMzUbDggIV+c=; b=OHJ8jYdtF0zb2XM4c2UrkF/CtsaGOTy0a55XxA6Lkdo08zlsgOmJUukSbvygHYll7FUQ4pG7ON9USF1oA3z+iOO/Z0x2Tk5pM6yQFn1lHxKI5Bi/D1R2BD58M2VzPKV0F+/VGuHB3/2R/qbTbFOw5fDx+AXgQsjgUaDGL/XHWjtaniaeZEAEv6fZeIABSrUhRWA8A4YTsnaWbiNKFXyKZqzebjvnxjKv0qwB9Z6mFY6xbPN4VpikNhh+zAbMMEy+Kv+komiBNJrAoXrxexLtaCe5oc1z0Fa7flfVJYvQCz6KIC0H/H7aXzVHlKma5+e6cou0pjnp4EFvZZWTuQzKiQ==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tMFCU-0003Ms-1H for bug-gnu-emacs@gnu.org; Fri, 13 Dec 2024 18:36:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 13 Dec 2024 23:36:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74738 X-GNU-PR-Package: emacs Original-Received: via spool by 74738-submit@debbugs.gnu.org id=B74738.173413293912913 (code B ref 74738); Fri, 13 Dec 2024 23:36:01 +0000 Original-Received: (at 74738) by debbugs.gnu.org; 13 Dec 2024 23:35:39 +0000 Original-Received: from localhost ([127.0.0.1]:44709 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tMFC6-0003MD-E1 for submit@debbugs.gnu.org; Fri, 13 Dec 2024 18:35:38 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:6015) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tMFC2-0003Lw-Rf for 74738@debbugs.gnu.org; Fri, 13 Dec 2024 18:35:36 -0500 Original-Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 81D0D10004A; Fri, 13 Dec 2024 18:35:22 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1734132921; bh=vku2GD+v0sRoMGV6acYc80kZQJjIGqQpwEjTR+CL5+0=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=m/4TcvK9JkNyB1bIWmcWJVoSEBmub6Od59oQPjPc/l5OtsHw+SIG8U+9FWz7jbtj6 sActjChGlJTzWJt3wrLAKVUyUxhOPGCdGxnufa6svMgj4bHlMt6WuN3ZrY9eqk3SI+ jgHWG51V2N3B4VJNkg3Zm3MFTAAQL8mFtIlyivh66oOJQVSu9st02wY5H6rgaeVl7E VPi0x10VeeqO9IaZwGstNbleNFKhsNeuEjdzC94Ujgkmr4/gqQe03i6jE978LipFGR yM4iyPxmGbsxJoi+dyqXJO4Rv5dyLVxD1PbdVoED+UTahm4n3A/w9NTBKXyjpgRmhe QLOZmie4xoRQA== Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id CF83F100042; Fri, 13 Dec 2024 18:35:21 -0500 (EST) Original-Received: from alfajor (104-195-225-43.cpe.teksavvy.com [104.195.225.43]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 981CC12005A; Fri, 13 Dec 2024 18:35:21 -0500 (EST) In-Reply-To: (kobarity@gmail.com's message of "Wed, 11 Dec 2024 23:24:34 +0900") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:297000 Archived-At: > 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 ":" 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