From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#56637: 28.1.90; [FR] Allow a way around font-lock-mode being unconditionally disabled in " *hidden*" buffers Date: Tue, 19 Jul 2022 22:02:04 +0300 Message-ID: <83ilntlydv.fsf@gnu.org> References: <874jzdhh5m.fsf@localhost> <83mtd5m54h.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="17244"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 56637@debbugs.gnu.org, yantar92@gmail.com To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Jul 19 21:03:11 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 1oDsUx-0004FV-86 for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 19 Jul 2022 21:03:11 +0200 Original-Received: from localhost ([::1]:47066 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oDsUv-0000u1-GM for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 19 Jul 2022 15:03:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56180) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oDsUo-0000tt-D9 for bug-gnu-emacs@gnu.org; Tue, 19 Jul 2022 15:03:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:57393) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oDsUo-0002n8-4L for bug-gnu-emacs@gnu.org; Tue, 19 Jul 2022 15:03:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oDsUn-0007QL-Th for bug-gnu-emacs@gnu.org; Tue, 19 Jul 2022 15:03:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 19 Jul 2022 19:03:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 56637 X-GNU-PR-Package: emacs Original-Received: via spool by 56637-submit@debbugs.gnu.org id=B56637.165825735228497 (code B ref 56637); Tue, 19 Jul 2022 19:03:01 +0000 Original-Received: (at 56637) by debbugs.gnu.org; 19 Jul 2022 19:02:32 +0000 Original-Received: from localhost ([127.0.0.1]:55152 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oDsUJ-0007PZ-Kk for submit@debbugs.gnu.org; Tue, 19 Jul 2022 15:02:31 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:43084) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oDsUF-0007PH-6M for 56637@debbugs.gnu.org; Tue, 19 Jul 2022 15:02:30 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:41936) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oDsU9-0002ck-UW; Tue, 19 Jul 2022 15:02:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=5RVZp3e7fPX4YG81TXa8x0+io3a1NmLjurTwfVlKUKU=; b=GHUFx7YwFyNC /tHRe460GfS0V0nZSccKXLl3lzZ2QCpIHAr0ISo+qb4jBwZG8eYNVJDN8XD6pwWS+nZU/FKNmc1b1 hQ3CWbOYa+TIpaJGPlmDWXeGC47a/loCbyvllvqALuS1WQSagRO8sHt+K3INCid745Wa4yFarezpV N/3AvDaAVOXmAyGUVAEgNL88FduVr/qtNzANhdib21Galz/TJr4wyPUzJhLKudgwKKI80nUr5mk59 2m/eCk4ErKt2qC2OnJ/rsQjxpYgY6b1iK24xBl8KWz6zWvYNLAJ48hkeqUfWEOAW4DodKBBFY3M6h dOS9DO+41qVSOQEzMSWE5g==; Original-Received: from [87.69.77.57] (port=4003 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oDsU6-0006pw-Th; Tue, 19 Jul 2022 15:02:20 -0400 In-Reply-To: (message from Stefan Monnier on Tue, 19 Jul 2022 13:01:38 -0400) 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:237461 Archived-At: > From: Stefan Monnier > Cc: yantar92@gmail.com, 56637@debbugs.gnu.org > Date: Tue, 19 Jul 2022 13:01:38 -0400 > > >> FWIW, I do think it would be good to remove the rule that font-lock is > >> never enabled in temp buffers. > > I don't. > > I think we agree :-) > > More seriously, I didn't mean to remove it willy-nilly, but that it's > a desirable goal and the question is how to get there. Why is that a desirable goal? It slows down stuff that is never displayed. And if that buffer has very long lines, it slows Emacs down considerably. I see no reason whatsoever to pay this price, let alone the garbage font-lock generates. >From my POV, this has "non-starter" written all over it. > We could start by adding a new variable > `font-lock-allow-in-temporary-buffer`, which packages could set > buffer-locally in those rare temp buffers where they do want to enable > font-lock, as in the untested patch below. This is a slippery slope. Next some other corner case will want to run buffer-modification hooks in a temporary buffer, so we invent another variable, and so on and so forth. I'd rather introduce a macro like with-temp-buffer, but one that can accept a buffer name, and ask such applications to please name their temporary buffers something that doesn't begin with a space.