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: Tue, 19 Jul 2022 12:15:33 +0800 Message-ID: <874jzdhh5m.fsf@localhost> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="6454"; mail-complaints-to="usenet@ciao.gmane.io" To: 56637@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Jul 19 06:15:17 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 1oDedh-0001UX-E2 for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 19 Jul 2022 06:15:17 +0200 Original-Received: from localhost ([::1]:36488 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oDedg-0004Pk-4I for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 19 Jul 2022 00:15:16 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43848) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oDedS-0004PO-TX for bug-gnu-emacs@gnu.org; Tue, 19 Jul 2022 00:15:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:54776) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oDedS-00031p-Ke for bug-gnu-emacs@gnu.org; Tue, 19 Jul 2022 00:15:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oDedS-0007s3-F8 for bug-gnu-emacs@gnu.org; Tue, 19 Jul 2022 00:15:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Ihor Radchenko Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 19 Jul 2022 04:15:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 56637 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.165820407530197 (code B ref -1); Tue, 19 Jul 2022 04:15:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 19 Jul 2022 04:14:35 +0000 Original-Received: from localhost ([127.0.0.1]:52535 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oDed0-0007qz-Lw for submit@debbugs.gnu.org; Tue, 19 Jul 2022 00:14:34 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:52006) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oDecy-0007qr-FD for submit@debbugs.gnu.org; Tue, 19 Jul 2022 00:14:33 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43806) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oDecy-0004Mf-B2 for bug-gnu-emacs@gnu.org; Tue, 19 Jul 2022 00:14:32 -0400 Original-Received: from mail-pj1-x1035.google.com ([2607:f8b0:4864:20::1035]:43889) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oDecw-0002yS-Ko for bug-gnu-emacs@gnu.org; Tue, 19 Jul 2022 00:14:32 -0400 Original-Received: by mail-pj1-x1035.google.com with SMTP id o5-20020a17090a3d4500b001ef76490983so14575075pjf.2 for ; Mon, 18 Jul 2022 21:14:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:mime-version; bh=QFyQq1zPejhM5SFcdOMK5JZaAWH/BRxHMNrxuyDCnIs=; b=EF1ET3gT9djjLLwzL8v+4iePDVRRD5716jjRkKGtb7ldaiMXjM3Rdx2WbSKuMrMH1/ J1VhyXUz9VgRyVQnHiZOrm8R1JCU7hriSFOc1ZKWb14/RRw3iPn/zcl4N1MqAgI9zj8Y Xes3fqh7EtGHBOLadJPJzEZHIKFXNZHn6/M7a4+I59Of63zap0OaEjERZUrVic8PEq/L tM7pqt6OqyEtlw8xvsdPe6wNFAfCb1/xg3BrSEHCmYf1/CvMCfFd5pP/NGBvUNe623MT fMC0zmhLi8qvaM8dcGNyuDFc/X4oKHSA+grQYSTfmfYRNL12Mh2juNq1U/Z1XtPj8TCC HGrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:mime-version; bh=QFyQq1zPejhM5SFcdOMK5JZaAWH/BRxHMNrxuyDCnIs=; b=Uv7506TNnuHsVA7hnMY6PN2Tg23EDuH7B6nA4SPerZpvbpd7GuWA7OYVNcI5GtrSyn vVzyouem8/OHhPvXd37oaHcZYHu953GmMqx6OrYrCM7xg1JYfmcRyZ3LhVY/Z921QUTj FVhnLpCBPeZgnWL32xfAAVBwJfk288XhfYaK4oNIMK9bGsjf3ttkTP4L+8CTZSv1B/t7 6ZZJXW2G1bxp5APYJfHLetimuVLTIA80er9rH0F9+dzwkFK0k7u7m97WQredMJmKaaIr c9/Yi6WmZZuXSKslCPDYY6XIpdkGJUk/W7oSvz1rzcuJGzS94keZi6hGqADVYd9GSNev WHmg== X-Gm-Message-State: AJIora+ndFVN3QVcH1p7XhN/J/PONbzCqYOQNq0jq0Vorabu1igqD7zQ qi6UDdSopZIFsZrCJgyki5ncg9OEfEMSNg== X-Google-Smtp-Source: AGRyM1vXbqdtojiNWbxrhApgAAzT3z3VZ1D5+W9+4B2wsw50agBheAH0FUI+MWwjY9upagCfxnfkyA== X-Received: by 2002:a17:903:2442:b0:16c:52f1:d29 with SMTP id l2-20020a170903244200b0016c52f10d29mr30848548pls.46.1658204068755; Mon, 18 Jul 2022 21:14:28 -0700 (PDT) Original-Received: from localhost ([115.154.175.57]) by smtp.gmail.com with ESMTPSA id c4-20020a170902d48400b0016ca0fe6df5sm10459293plg.273.2022.07.18.21.14.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Jul 2022 21:14:28 -0700 (PDT) Received-SPF: pass client-ip=2607:f8b0:4864:20::1035; envelope-from=yantar92@gmail.com; helo=mail-pj1-x1035.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action 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:237402 Archived-At: Hi, font-lock-mode contains the follow clause: ;; Don't turn on Font Lock mode if we don't have a display (we're running a ;; batch job) or if the buffer is invisible (the name starts with a space). (when (or noninteractive (eq (aref (buffer-name) 0) ?\s)) (setq font-lock-mode nil)) which interferes with Org mode's fontification code in some edge cases. Org mode fontifies code blocks using "hidden" temporary buffers with their name starting from " ": " *org-src-fontification:major-mode*". The buffers are kept around to avoid extra major-mode loading overheads and the fontification is not using (font-lock-ensure). (font-lock-ensure) usually fontifies the buffer correctly even though font-lock-mode is disabled. However, not always. We just got some edge case https://teddit.net/r/orgmode/comments/w2b0tw/syntax_highlighting_in_orgsource_blocks/igqdx18/ with web-mode, which directly sets 'font-lock-face text properties. Without font-lock-mode being enabled, 'font-lock-face is not automatically remapped to 'face text property and hence some part of the fontification may not be reflected by simply looking into 'face property. While Org can work around this particular case by looking into 'font-lock-face, I am not sure if disabled font-lock may not trigger similar issues in other cases. It would be nice if we could somehow enable font-lock inside " *hidden*" buffers. Would it be possible? Best, Ihor