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 4csRLIIeLV9VLgAA0tVLHw (envelope-from ) for ; Fri, 07 Aug 2020 09:27:30 +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 mHduJ4IeLV9ecQAAbx9fmQ (envelope-from ) for ; Fri, 07 Aug 2020 09:27:30 +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 34F32940215 for ; Fri, 7 Aug 2020 09:27:30 +0000 (UTC) Received: from localhost ([::1]:38522 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k3yev-0000dw-7D for larch@yhetil.org; Fri, 07 Aug 2020 05:27:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60550) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k3yeY-0000dm-MY for emacs-orgmode@gnu.org; Fri, 07 Aug 2020 05:27:06 -0400 Received: from mail-wm1-x342.google.com ([2a00:1450:4864:20::342]:40669) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1k3yeW-0002TQ-LG for emacs-orgmode@gnu.org; Fri, 07 Aug 2020 05:27:06 -0400 Received: by mail-wm1-x342.google.com with SMTP id k20so1182754wmi.5 for ; Fri, 07 Aug 2020 02:27:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=hVL5RQr3xyrPBPeGYmzaGGePY7WscZvKgm1UvS3VofU=; b=Ie2UzFG/n/uoQTiReJ4R9fXb/rAjBXnPysaTnM9tRokv3Vc04oLOFcGQy+RcaS8HwO O/h4hOlhvy+NLzQ4uGRdL4GLdhPfrw7rryTj+8UaW9ElNu4Y8btC2FzhpigWzRA0Fl1y R/KAGaXDWGx8/Hf9ve5NHIo7o0I3Bgkqh2zWTTq+kC9veBxtf5L2g5SaIYdwLL+UUTwQ zAwQZQfyCp9v3vbAKAedKNHwdFXaQjYPc9FrKTYIvVJuMJ+BvPorsZUcbLV/uZoEHkrL NSMa20+56kX5Upe0XnZRY43vCqcuAY3i1DoqFUrFHzGKwZNDUS5pAjY+xP+jbOn5JdZE tvhQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=hVL5RQr3xyrPBPeGYmzaGGePY7WscZvKgm1UvS3VofU=; b=PZ9lKCG6OT6FGkkvI0/bXqnCld+Csauxp4XjuzEX16wD4mOFDUCkDPsA8EBgjsg+Xp 89hYtdu0UUtSDOVZB1+mWb3GPOWalkrCSfF3+owEBDJCysbCSH4BCKN9SmYOEfH/FbFl cv4gLs9mi3Iqq0VUkFuNopsH5VaGW4rd4fBBGTtxho2JvWK4S1Rf8VcUJ6kx/mEhDmIH vZJLwtYIXjDOmecEkOHPCr1lZl27Zzsz3as3oCMUXn/55fx7RKReGrKWhwWNkaIAHu0I inAIp/SCm5AyjmZcHdh/4N9GQP2PEvF7pfrvbrlqGHke3aHOjXnYqF5PbGVKDLdhsGjp XhRQ== X-Gm-Message-State: AOAM5334Y5/4bV4OfOybiRJ3j4DTcXuF3q7eV8xbrK3XunTDWuxmAY9Z lolQs7V0kdWzOUKUp+VYLL3lnsNK X-Google-Smtp-Source: ABdhPJymjBzFsviO7Qz4XVrQO0Pd9Rt1dhh50uoKDgcSGrBAy5NXEDyNTjgaDdSDu8ukbStX8W6TRg== X-Received: by 2002:a1c:7915:: with SMTP id l21mr12543254wme.50.1596792421659; Fri, 07 Aug 2020 02:27:01 -0700 (PDT) Received: from my-little-tumbleweed (200.143.13.109.rev.sfr.net. [109.13.143.200]) by smtp.gmail.com with ESMTPSA id a10sm9667272wrx.15.2020.08.07.02.26.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Aug 2020 02:27:00 -0700 (PDT) From: =?utf-8?Q?K=C3=A9vin_Le_Gouguec?= To: Kyle Meyer Subject: Re: Bug#42184: org-fontify-whole-*-line in emacs 27 References: <9fb38135-dc45-2d46-be0b-de9c297ac686@posteo.eu> <87365za8yk.fsf@gmail.com> <87r1tez9dx.fsf_-_@gmail.com> <87wo2gzqrv.fsf@gmail.com> <87d043thcr.fsf@kyleam.com> Date: Fri, 07 Aug 2020 11:26:59 +0200 In-Reply-To: <87d043thcr.fsf@kyleam.com> (Kyle Meyer's message of "Thu, 06 Aug 2020 20:44:20 -0400") Message-ID: <87o8nmq00s.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=2a00:1450:4864:20::342; envelope-from=kevin.legouguec@gmail.com; helo=mail-wm1-x342.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham 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: , Cc: emacs-orgmode@gnu.org Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=fail (body hash did not verify) header.d=gmail.com header.s=20161025 header.b=Ie2UzFG/; dmarc=fail reason="SPF not aligned (relaxed)" 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.09 X-TUID: Ja8zlEfAhkRt --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Kyle Meyer writes: > K=C3=A9vin Le Gouguec writes: > >> 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). > > In the associated emacs-bug thread, Eli said that ship has sailed. With > the possibility of making it into 27.1 out of the picture, I think this > patch should be made against the Org repo, as usual. > > As I said in the emacs-bug thread, the patch (which you also included > upstream in this thread) looks fine to me. If you'd prefer to bundle > your org-block change in the same patch, could you send an updated patch > here against the Org repo? I've just noticed that my patch for org-block (bug#42184#44) was missing a compatibility shim for Emacs<27; here are updated patches against maint and master: --=-=-= Content-Type: text/x-patch; charset=utf-8 Content-Disposition: attachment; filename=maint.patch Content-Transfer-Encoding: quoted-printable >From 6ca21259589e212452411acd4ac2de3258ede508 Mon Sep 17 00:00:00 2001 From: =3D?UTF-8?q?K=3DC3=3DA9vin=3D20Le=3D20Gouguec?=3D Date: Fri, 7 Aug 2020 11:04:53 +0200 Subject: [PATCH] Fix org-fontify-whole-*-line by setting face extension (bug#42184) MIME-Version: 1.0 Content-Type: text/plain; charset=3DUTF-8 Content-Transfer-Encoding: 8bit * lisp/org-faces.el (org-block): Set background extension beyond end-of-line. * lisp/org-compat.el (org--extended-face): New function to add :extend attribute to face definition for Emacs=E2=89=A527. (org--set-faces-extend): New function to temporarily (re)set :extend for Emacs=E2=89=A527. * lisp/org.el (org-mode): Call it to set the extend attribute of relevant faces to the correct value. --- lisp/org-compat.el | 15 +++++++++++++++ lisp/org-faces.el | 2 +- lisp/org.el | 6 +++++- 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/lisp/org-compat.el b/lisp/org-compat.el index c757355ba..c0f4833a3 100644 --- a/lisp/org-compat.el +++ b/lisp/org-compat.el @@ -101,6 +101,21 @@ is nil)." (defun org-time-convert-to-list (time) (seconds-to-time (float-time time)))) =20 +(defmacro org--extended-face (attributes) + "Make face that extends beyond end of line. + +Up to Emacs 26, all faces extended beyond end of line; getting +the same behaviour starting with Emacs 27 requires :extend t." + `(nconc ,attributes (when (>=3D emacs-major-version 27) '(:extend t)))) + +(defun org--set-faces-extend (faces extend-p) + "Set the :extend attribute of FACES to EXTEND-P. + +This is a no-op for Emacs versions lower than 27, since face +extension beyond end of line was not controllable." + (when (fboundp 'set-face-extend) + (mapc (lambda (f) (set-face-extend f extend-p)) faces))) + ;;; Emacs < 26.1 compatibility =20 diff --git a/lisp/org-faces.el b/lisp/org-faces.el index 30eab9bc6..4c5a51624 100644 --- a/lisp/org-faces.el +++ b/lisp/org-faces.el @@ -393,7 +393,7 @@ follows a #+DATE:, #+AUTHOR: or #+EMAIL: keyword." "Face for #+TITLE:, #+AUTHOR:, #+EMAIL: and #+DATE: keywords." :group 'org-faces) =20 -(defface org-block '((t :inherit shadow)) +(defface org-block `((t ,(org--extended-face '(:inherit shadow)))) "Face text in #+begin ... #+end blocks. For source-blocks `org-src-block-faces' takes precedence." :group 'org-faces diff --git a/lisp/org.el b/lisp/org.el index 007dd6e2a..34c0235c1 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -4940,7 +4940,11 @@ The following commands are available: ;; 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)) =20 ;; Update `customize-package-emacs-version-alist' (add-to-list 'customize-package-emacs-version-alist --=20 2.28.0 --=-=-= Content-Type: text/x-patch; charset=utf-8 Content-Disposition: attachment; filename=master.patch Content-Transfer-Encoding: quoted-printable >From 715927aa2f1baae32040e52d2cfca4aef2edc14b Mon Sep 17 00:00:00 2001 From: =3D?UTF-8?q?K=3DC3=3DA9vin=3D20Le=3D20Gouguec?=3D Date: Fri, 7 Aug 2020 11:04:53 +0200 Subject: [PATCH] Fix org-fontify-whole-*-line by setting face extension (bug#42184) MIME-Version: 1.0 Content-Type: text/plain; charset=3DUTF-8 Content-Transfer-Encoding: 8bit * lisp/org-faces.el (org-block): Set background extension beyond end-of-line. * lisp/org-compat.el (org--extended-face): New function to add :extend attribute to face definition for Emacs=E2=89=A527. (org--set-faces-extend): New function to temporarily (re)set :extend for Emacs=E2=89=A527. * lisp/org.el (org-mode): Call it to set the extend attribute of relevant faces to the correct value. --- lisp/org-compat.el | 15 +++++++++++++++ lisp/org-faces.el | 2 +- lisp/org.el | 6 +++++- 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/lisp/org-compat.el b/lisp/org-compat.el index 5953f89d2..a9cf400a7 100644 --- a/lisp/org-compat.el +++ b/lisp/org-compat.el @@ -109,6 +109,21 @@ is nil)." (newline-and-indent)) (defalias 'org-newline-and-indent #'newline-and-indent)) =20 +(defmacro org--extended-face (attributes) + "Make face that extends beyond end of line. + +Up to Emacs 26, all faces extended beyond end of line; getting +the same behaviour starting with Emacs 27 requires :extend t." + `(nconc ,attributes (when (>=3D emacs-major-version 27) '(:extend t)))) + +(defun org--set-faces-extend (faces extend-p) + "Set the :extend attribute of FACES to EXTEND-P. + +This is a no-op for Emacs versions lower than 27, since face +extension beyond end of line was not controllable." + (when (fboundp 'set-face-extend) + (mapc (lambda (f) (set-face-extend f extend-p)) faces))) + ;;; Emacs < 26.1 compatibility =20 diff --git a/lisp/org-faces.el b/lisp/org-faces.el index d78b606ec..0c7de38ff 100644 --- a/lisp/org-faces.el +++ b/lisp/org-faces.el @@ -408,7 +408,7 @@ follows a #+DATE:, #+AUTHOR: or #+EMAIL: keyword." "Face for #+TITLE:, #+AUTHOR:, #+EMAIL: and #+DATE: keywords." :group 'org-faces) =20 -(defface org-block '((t :inherit shadow)) +(defface org-block `((t ,(org--extended-face '(:inherit shadow)))) "Face text in #+begin ... #+end blocks. For source-blocks `org-src-block-faces' takes precedence." :group 'org-faces diff --git a/lisp/org.el b/lisp/org.el index ee8be256d..d66977dd4 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -4904,7 +4904,11 @@ The following commands are available: ;; 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)) =20 ;; Update `customize-package-emacs-version-alist' (add-to-list 'customize-package-emacs-version-alist --=20 2.28.0 --=-=-= Content-Type: text/plain I don't think anyone has reviewed org--extended-face yet (I first drafted it in bug#42184#17), so don't hesitate to call me out on it if something looks off. FWIW I saw no warnings when running "make" with Emacs 26.3 nor with 28. I made patches for both maint and master because - the patch for maint has a small conflict in org-compat when applied against master, - I'm not sure which branch will eventually be synchronized with emacs-27 (assuming we'll include this fix in 27.2). Thank you for following up on this. --=-=-=--