From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Tom Tromey Newsgroups: gmane.emacs.bugs Subject: bug#41441: 26.3; mhtml misbehaving font-lock extend region can cause Emacs to hang Date: Mon, 25 May 2020 10:11:03 -0600 Message-ID: <87pnasro4o.fsf@tromey.com> References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="26578"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: 41441@debbugs.gnu.org To: Anders Lindgren Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon May 25 18:12:41 2020 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 1jdFiS-0006o3-JR for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 25 May 2020 18:12:41 +0200 Original-Received: from localhost ([::1]:46876 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jdFiR-0007zi-LI for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 25 May 2020 12:12:39 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33064) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jdFhq-0007z8-SN for bug-gnu-emacs@gnu.org; Mon, 25 May 2020 12:12:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:58967) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jdFhq-0003mB-Ip for bug-gnu-emacs@gnu.org; Mon, 25 May 2020 12:12:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jdFhq-0008UE-Dd for bug-gnu-emacs@gnu.org; Mon, 25 May 2020 12:12:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Tom Tromey Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 25 May 2020 16:12:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 41441 X-GNU-PR-Package: emacs Original-Received: via spool by 41441-submit@debbugs.gnu.org id=B41441.159042306932547 (code B ref 41441); Mon, 25 May 2020 16:12:02 +0000 Original-Received: (at 41441) by debbugs.gnu.org; 25 May 2020 16:11:09 +0000 Original-Received: from localhost ([127.0.0.1]:42276 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jdFgy-0008St-QS for submit@debbugs.gnu.org; Mon, 25 May 2020 12:11:09 -0400 Original-Received: from gateway36.websitewelcome.com ([192.185.197.22]:18935) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jdFgv-0008SJ-UB for 41441@debbugs.gnu.org; Mon, 25 May 2020 12:11:07 -0400 Original-Received: from cm10.websitewelcome.com (cm10.websitewelcome.com [100.42.49.4]) by gateway36.websitewelcome.com (Postfix) with ESMTP id 542E840CC6A21 for <41441@debbugs.gnu.org>; Mon, 25 May 2020 10:30:52 -0500 (CDT) Original-Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id dFgujJQfsEfyqdFguj04ev; Mon, 25 May 2020 11:11:05 -0500 X-Authority-Reason: nr=8 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=51qtUDT76OtztpEhC/eBKwe6PLJTDSV1qVpiyXq5gu8=; b=PBzABMPFWVlSq8Zbk/BxiGwfWC 3KatFgruYVt6mL+YMhX6bmUWLm0FLWWw5TIeGx5mnPqKOLAWxqrQ73Xon6YacPd0AAGIF413jzhgi F7ER7CcZVHgarxEKqA3OwcI37; Original-Received: from 174-16-104-48.hlrn.qwest.net ([174.16.104.48]:36022 helo=bapiya) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92) (envelope-from ) id 1jdFgu-003vWS-H2; Mon, 25 May 2020 10:11:04 -0600 X-Attribution: Tom In-Reply-To: (Anders Lindgren's message of "Thu, 21 May 2020 22:14:00 +0200") X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - box5379.bluehost.com X-AntiAbuse: Original Domain - debbugs.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tromey.com X-BWhitelist: no X-Source-IP: 174.16.104.48 X-Source-L: No X-Exim-ID: 1jdFgu-003vWS-H2 X-Source-Sender: 174-16-104-48.hlrn.qwest.net (bapiya) [174.16.104.48]:36022 X-Source-Auth: tom+tromey.com X-Email-Count: 2 X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes 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" Xref: news.gmane.io gmane.emacs.bugs:180988 Archived-At: Anders> * Fix the problem in `mhtml--extend-font-lock-region`. It's not entirely clear to me that (1) this is a bug, or (2) that it can be changed. My recollection is that mhtml mode has to shrink the region in some cases, because we don't want font-locking to extend beyond the end of a sub-mode. For example consider things like

more html here

Here, we want to font-lock the body of the script using one set of rules, and the rest with another set. Looking at mhtml--submode-fontify-region, though, I wonder if maybe region extension isn't needed at all, since that function seems to handle sub-mode region boundaries. So I guess that is one experiment that could be done. Anders> One minor mode that, when enabled, would cause Emacs to hang Anders> with the above buffer is Anders> https://github.com/Lindydancer/char-font-lock (this package Anders> highlights incorrect whitespace). Maybe this mode could be changed instead. Tom