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#58518: 29.0.50; [PATCH] Turning off compilation-minor-mode removes fontification of other modes Date: Sat, 15 Oct 2022 10:45:28 -0400 Message-ID: References: <87pmeue8s3.fsf@miha-pc> <87mt9x4c4j.fsf@gnus.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="36554"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: Eli Zaretskii , 58518@debbugs.gnu.org, miha@kamnitnik.top To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Oct 15 16:46:19 2022 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 1ojiQd-0009LD-5F for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 15 Oct 2022 16:46:19 +0200 Original-Received: from localhost ([::1]:35918 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ojiQb-00086u-Tj for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 15 Oct 2022 10:46:17 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45554) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ojiQN-00082z-5L for bug-gnu-emacs@gnu.org; Sat, 15 Oct 2022 10:46:08 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:43313) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ojiQM-0007MO-K6 for bug-gnu-emacs@gnu.org; Sat, 15 Oct 2022 10:46:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ojiQM-00010c-BJ for bug-gnu-emacs@gnu.org; Sat, 15 Oct 2022 10:46:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 15 Oct 2022 14:46:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58518 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 58518-submit@debbugs.gnu.org id=B58518.16658451403839 (code B ref 58518); Sat, 15 Oct 2022 14:46:02 +0000 Original-Received: (at 58518) by debbugs.gnu.org; 15 Oct 2022 14:45:40 +0000 Original-Received: from localhost ([127.0.0.1]:42391 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ojiQ0-0000zr-AD for submit@debbugs.gnu.org; Sat, 15 Oct 2022 10:45:40 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:31610) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ojiPx-0000zc-6N for 58518@debbugs.gnu.org; Sat, 15 Oct 2022 10:45:38 -0400 Original-Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id F014A100130; Sat, 15 Oct 2022 10:45:30 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 87C1E100084; Sat, 15 Oct 2022 10:45:29 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1665845129; bh=597AF3pk+pihsN3BYG6PiqbgVAQx0q4U/+fob2kanII=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=B0jQVq27DpGi/XWzj+q7gu6mHioP0/dGP3MptJSNoEYiO8u6VciSKnZBkyi7sRXpO blE7ZCUhFGHNxkcZSQMZ99SS7RKF6uOLzdBOB3IlxxIoHcgnHczXOz4X1KNEentVBU 6J5X+6se8zzreKYSEBkuMMFXizhigrUkDLwputxtFpkmITq6rFAB8BW0+NbWzQYMOG JgF6UEaWY3hqRIieez8M5LCZixIM8WOctOKfHJrlKd+9kRl0UemtxegLDX/XbG567F SHRzB4pLa1Qip+6wRPprggMepYTnuwVGo1JvzzDBwXoVqlLccp1g9Y4DR1deG3+k1A GiSThH2Qe3QfA== Original-Received: from pastel (65-110-220-202.cpe.pppoe.ca [65.110.220.202]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 53DB1120B9F; Sat, 15 Oct 2022 10:45:29 -0400 (EDT) In-Reply-To: <87mt9x4c4j.fsf@gnus.org> (Lars Ingebrigtsen's message of "Sat, 15 Oct 2022 12:25:32 +0200") 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:245563 Archived-At: > But since it's so unusual, I wonder whether there's any reason we don't > use this more in general. Are there performance impacts, for instance? > (I don't think so, since it's a buffer-local variable.) But I've added > Stefan and Eli to the CCs; perhaps they have comments. I can't remember anyone measuring the performance impact, but it does come at a cost since every time we call `lookup_char_property` it takes significantly more work. This is called at every text-property (or overlay) boundary in things like `next-single-property-change` and similar operations used by the redisplay. The "more work" is the `assq` itself whose time is proportional to the length of this alist, plus a `plist-get` per alias listed, whenever the `assq` finds a match (i.e. whenever we're looking for a property which has aliases). FWIW, in the past I suggested maybe we should introduce a notion of "property planes". So `compilation` could use one property plane, `font-lock` could use another and they could just blindly remove all the properties in their plane without affecting others. The idea is similar to using the approach suggested by "miha", except that the intention is to implement the hard work of merging the planes in the code that adds/removes properties rather than in the code which looks it up (and it would probably only apply to text properties, not to overlays). The idea of doing it when adding/removing properties is: - Should keep the important lookup path used during redisplay fast. - Should make it possible to run ELisp while merging, thus allowing "smart" merging (e.g. concatenating faces, or composing keymaps) rather than only choosing the value with highest priority and ignoring all the others. BTW, another option is to use overlays rather than text-properties :-) Stefan