From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ihor Radchenko 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: Wed, 20 Jul 2022 12:13:14 +0800 Message-ID: <874jzc4e1x.fsf@localhost> References: <874jzdhh5m.fsf@localhost> <837d49ntwg.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="13100"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 56637@debbugs.gnu.org, Stefan Monnier To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Jul 20 06:13: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 1oE15C-0003E7-Jf for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 20 Jul 2022 06:13:10 +0200 Original-Received: from localhost ([::1]:60276 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oE15B-0006sn-F1 for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 20 Jul 2022 00:13:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:36524) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oE154-0006s4-8v for bug-gnu-emacs@gnu.org; Wed, 20 Jul 2022 00:13:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:57778) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oE153-0006PK-Vq for bug-gnu-emacs@gnu.org; Wed, 20 Jul 2022 00:13:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oE153-0006eo-RD for bug-gnu-emacs@gnu.org; Wed, 20 Jul 2022 00:13:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Ihor Radchenko Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 20 Jul 2022 04:13: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.165829033825537 (code B ref 56637); Wed, 20 Jul 2022 04:13:01 +0000 Original-Received: (at 56637) by debbugs.gnu.org; 20 Jul 2022 04:12:18 +0000 Original-Received: from localhost ([127.0.0.1]:55537 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oE14M-0006dp-17 for submit@debbugs.gnu.org; Wed, 20 Jul 2022 00:12:18 -0400 Original-Received: from mail-pl1-f179.google.com ([209.85.214.179]:38494) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oE14I-0006dY-Vl for 56637@debbugs.gnu.org; Wed, 20 Jul 2022 00:12:15 -0400 Original-Received: by mail-pl1-f179.google.com with SMTP id w7so1397352plp.5 for <56637@debbugs.gnu.org>; Tue, 19 Jul 2022 21:12:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version; bh=s4UPdkevpMttPRxO/l0TGVMnttA4RU1xugbTN7ttxtI=; b=F5kjSsOMiIb7TdYzs2cdjV4wtIgsPgSuXw3OP7oVQY97PGOLXM19kqZPIlHoCrC2B8 N5rl2vv0X6A36e2r7ksAWEdDhprz1wr9z5O5H4xdxFfqImczXsUTUsOPLPxRAwRvGAw0 x5S+3iL6bwmx+6xfzwaNyg8n3Tceshfxs9tBwmLxIfJqSMYw2Vq+UjhnF5u25IptSrH+ 2rAOrLxt3XHQwcHzPTI/FJVn2iDP3k9ixoIKRbAs3xptQLoc5NtHbKR5eg0gp3yFdTA2 HaFoxjLzlpfGedztgTLSaGf5XVyOZPtg9zgKcrXUioIFsQ26UoZe6wDCu/ndPD/OiExR pGug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version; bh=s4UPdkevpMttPRxO/l0TGVMnttA4RU1xugbTN7ttxtI=; b=aaQkTDsj1bzmt6rHWAWUSPLKr8Hif7I1q+nNxkBoItPEaxF8Ih5LsEs49Xz79ouIFk DVY762IL1E9y/igs2r8kUMJ1FUbK6sxowQ6b/4wCvhSBTNHWprCEbiHV0NdLFCJ5EyxG 9CqbgDyW7XLXPuk6L7wmFb28sZaV+EMkLrChVZPr0wCdRIxhBCJDq+SmcSgwr3YpusLn y0/78ZsEAfD4TLiYF9vqQgVTEga9fRvWdALPGuFQiWGXNoOwTodD7KJqKm7hpGobEa8a j6i85HnqhUgP5hRqrPk42SoJ05RQGQRZT/U7yfJOYuZp/9p1SQoZ4grX5fq1NCf7tT3d io+Q== X-Gm-Message-State: AJIora8oUbMn1yF/dTGBHdgQ24sBeJwfxtvn6hHEHYl9LQKoigBCFlj6 KYVeQPwJRSqQ4QcjYKryzeLQ8hDfgCuWoQ== X-Google-Smtp-Source: AGRyM1sJ233PxHWBLQQ/Wp7JL6deRcvyWTfyA2H14pHgZcc2Bm3ddX7Z+4qfVkDV9UKg0m8hRnVM7w== X-Received: by 2002:a17:903:2d0:b0:16c:39bc:876 with SMTP id s16-20020a17090302d000b0016c39bc0876mr16505496plk.42.1658290328787; Tue, 19 Jul 2022 21:12:08 -0700 (PDT) Original-Received: from localhost ([115.154.175.57]) by smtp.gmail.com with ESMTPSA id 125-20020a620483000000b005286697ec68sm12299975pfe.133.2022.07.19.21.12.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Jul 2022 21:12:08 -0700 (PDT) In-Reply-To: <837d49ntwg.fsf@gnu.org> 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:237475 Archived-At: Eli Zaretskii writes: >> It would be nice if we could somehow enable font-lock inside " *hidden*" >> buffers. Would it be possible? > > Depends on the "somehow" part. I generally prefer that obscure corner > cases be solved in the software which creates those obscure cases. In > this case, it seems like web-mode is that place? I'm not sure why > you say Org should solve this, but perhaps I didn't understand the > description well enough. But if this indeed needs to be solved in > Org, how about not using buffers whose names begin with a space? While this particular case might be solved on web-mode side (I guess that directly setting 'font-lock-face property is not recommended?), I am more concerned about similar issues that might popup in future. Is it always guaranteed by Emacs that font-lock-fontify-buffer correctly fontifies that buffer even when font-lock-mode is disabled? If not, Org has to make sure that font-lock-mode can be enabled when we need to compute fontification programmatically. The need to compute fontification is not limited to the described Reddit report. Org also needs fontification for export purposes - we copy the Emacs code colours into exported documents. With current behaviour of font-lock-mode, programmatic fontification may be problematic not only when we use "hidden" buffers starting with space, but also in non-interactive mode as in recent related bug report https://orgmode.org/list/wxaUFiqi8BmIPv8pcYRVHAFa0hTzM35roQxpVVRkgddjRkesPGX1kVBL3G0fr42FonlRq5FNjapV8RiovXV-RGEDehXn-cmIebf4HWBhzIQ=@protonmail.com As for not using buffers with names starting with a space, we do need such buffers as means to fontify foreign major mode blocks inside Org. How else do you suggest computing fontification of an arbitrary text in arbitrary major-mode (not org-mode) without polluting the buffer list? Best, Ihor