From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id WDsWM9kuJ1+9LQAA0tVLHw (envelope-from ) for ; Sun, 02 Aug 2020 21:23:37 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id 8CXoLtkuJ1/ZAgAAbx9fmQ (envelope-from ) for ; Sun, 02 Aug 2020 21:23:37 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 4C3F19400BB for ; Sun, 2 Aug 2020 21:23:37 +0000 (UTC) Received: from localhost ([::1]:46788 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k2LSC-00069Q-18 for larch@yhetil.org; Sun, 02 Aug 2020 17:23:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51460) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k2LRo-00064Y-Q1 for emacs-orgmode@gnu.org; Sun, 02 Aug 2020 17:23:12 -0400 Received: from static.214.254.202.116.clients.your-server.de ([116.202.254.214]:55144 helo=ciao.gmane.io) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k2LRn-00074a-8X for emacs-orgmode@gnu.org; Sun, 02 Aug 2020 17:23:12 -0400 Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1k2LRi-0003fm-OA for emacs-orgmode@gnu.org; Sun, 02 Aug 2020 23:23:06 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: emacs-orgmode@gnu.org From: =?utf-8?Q?K=C3=A9vin_Le_Gouguec?= Subject: Re: Bug#42184: org-fontify-whole-*-line in emacs 27 Date: Sun, 02 Aug 2020 23:23:00 +0200 Message-ID: <87wo2gzqrv.fsf@gmail.com> References: <9fb38135-dc45-2d46-be0b-de9c297ac686@posteo.eu> <87365za8yk.fsf@gmail.com> <87r1tez9dx.fsf_-_@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cancel-Lock: sha1:gH7IuFaxwSFHKVbaz+kH81acKIY= Received-SPF: pass client-ip=116.202.254.214; envelope-from=geo-emacs-orgmode@m.gmane-mx.org; helo=ciao.gmane.io X-detected-operating-system: by eggs.gnu.org: First seen = 2020/08/02 17:23:07 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: 20 X-Spam_score: 2.0 X-Spam_bar: ++ X-Spam_report: (2.0 / 5.0 requ) BAYES_00=-1.9, DKIM_ADSP_CUSTOM_MED=0.001, FORGED_GMAIL_RCVD=1, FREEMAIL_FORGED_FROMDOMAIN=1, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=1, NML_ADSP_CUSTOM_MED=0.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Spam-Score: -0.41 X-TUID: rIkV9daxx+DT Since 27.1-rc1 is out, I'd like to bump this; it'd be a shame if 27.1 shipped with this bug, which seems to be getting some attention (I just spotted a Reddit thread[1] about it, in addition to the original report on Debbugs). [1]: https://old.reddit.com/r/emacs/comments/i26n46/why_does_my_orgmode_look_different_to_leuven/ Kévin Le Gouguec writes: > Could Org maintainers weigh in on bug#42184? > > To recap my understanding of the issue: > > - org-fontify-whole-heading-line controls whether > org-set-font-lock-defaults includes the final newline in the headline > regexp (resp. org-fontify-whole-block-delimiter-line with begin/end > block regexps). > > - This assumes that fontifying the final newline is enough to fontify > everything beyond this newline. > > - This assumption is no longer valid with Emacs 27, where this extension > is opt-in, using the :extend face attribute. > > With Eli's help, I proposed a patch for org-mode against the emacs-27 > branch that does something similar to what is done for the org-hide > face: when setting up the major mode, depending on those user options, > the :extend attribute is (re)set for the relevant faces (using a > compatibility function defined in org-compat). > > I've reattached the patch for convenience. Does it look sound? > > From 07d123c548051eb7f6bbac5c7f5a4e4b8411f976 Mon Sep 17 00:00:00 2001 > From: =?UTF-8?q?K=C3=A9vin=20Le=20Gouguec?= > Date: Thu, 9 Jul 2020 16:02:49 +0200 > Subject: [PATCH] Fix org-fontify-whole-*-line by setting face extension > (bug#42184) > > * lisp/org/org-compat.el (org--set-faces-extend): New function to set > face extension, for Emacs versions where this attribute exists. > * lisp/org/org.el (org-mode): Call it to set the extend attribute of > relevant faces to the correct value. > --- > lisp/org/org-compat.el | 4 ++++ > lisp/org/org.el | 6 +++++- > 2 files changed, 9 insertions(+), 1 deletion(-) > > diff --git a/lisp/org/org-compat.el b/lisp/org/org-compat.el > index c1aaf17ca2..fcc325e475 100644 > --- a/lisp/org/org-compat.el > +++ b/lisp/org/org-compat.el > @@ -101,6 +101,10 @@ org-table1-hline-regexp > (defun org-time-convert-to-list (time) > (seconds-to-time (float-time time)))) > > +(defun org--set-faces-extend (faces extend-p) > + (when (fboundp 'set-face-extend) > + (mapc (lambda (f) (set-face-extend f extend-p)) faces))) > + > > ;;; Emacs < 26.1 compatibility > > diff --git a/lisp/org/org.el b/lisp/org/org.el > index 568f5b9b87..fb31336ea4 100644 > --- a/lisp/org/org.el > +++ b/lisp/org/org.el > @@ -4944,7 +4944,11 @@ org-mode > ;; Try to set `org-hide' face correctly. > (let ((foreground (org-find-invisible-foreground))) > (when foreground > - (set-face-foreground 'org-hide foreground)))) > + (set-face-foreground 'org-hide foreground))) > + ;; Set face extension as requested. > + (org--set-faces-extend '(org-block-begin-line org-block-end-line) > + org-fontify-whole-block-delimiter-line) > + (org--set-faces-extend org-level-faces org-fontify-whole-heading-line)) > > ;; Update `customize-package-emacs-version-alist' > (add-to-list 'customize-package-emacs-version-alist