From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?Q?K=C3=A9vin?= Le Gouguec Newsgroups: gmane.emacs.bugs Subject: bug#42184: 27.0.91; org-fontify-whole-heading-line does not work in emacs 27 Date: Sat, 04 Jul 2020 21:52:08 +0200 Message-ID: <87y2nzvz13.fsf@gmail.com> References: <5effe96e.1c69fb81.3a20a.f99f@mx.google.com> <87mu4f2ofd.fsf@gmail.com> <83wo3jtd0t.fsf@gnu.org> <87h7un2mq9.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="2465"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: egh@e6h.org, 42184@debbugs.gnu.org, Nicolas Goaziou , Bastien To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jul 04 21:53:11 2020 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 1jroDn-0000VD-Fz for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 04 Jul 2020 21:53:11 +0200 Original-Received: from localhost ([::1]:33426 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jroDm-0002Cm-7z for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 04 Jul 2020 15:53:10 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:54378) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jroDe-0002BV-Rq for bug-gnu-emacs@gnu.org; Sat, 04 Jul 2020 15:53:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:48173) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jroDe-0002BQ-In for bug-gnu-emacs@gnu.org; Sat, 04 Jul 2020 15:53:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jroDe-0006ln-Hz for bug-gnu-emacs@gnu.org; Sat, 04 Jul 2020 15:53:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: =?UTF-8?Q?K=C3=A9vin?= Le Gouguec Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 04 Jul 2020 19:53:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 42184 X-GNU-PR-Package: emacs Original-Received: via spool by 42184-submit@debbugs.gnu.org id=B42184.159389234425960 (code B ref 42184); Sat, 04 Jul 2020 19:53:02 +0000 Original-Received: (at 42184) by debbugs.gnu.org; 4 Jul 2020 19:52:24 +0000 Original-Received: from localhost ([127.0.0.1]:59713 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jroCy-0006kY-Pl for submit@debbugs.gnu.org; Sat, 04 Jul 2020 15:52:24 -0400 Original-Received: from mail-wr1-f43.google.com ([209.85.221.43]:40163) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jroCu-0006kB-0y for 42184@debbugs.gnu.org; Sat, 04 Jul 2020 15:52:19 -0400 Original-Received: by mail-wr1-f43.google.com with SMTP id f2so8277246wrp.7 for <42184@debbugs.gnu.org>; Sat, 04 Jul 2020 12:52:15 -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=CjnCeKaG0NR1cyUH9tS69BouqEvxo4ZZYooBugNHCYc=; b=KiwIo9pKOoXc3QNkdTi1GYR9+XdH137NfAArF0u29sX2slc89RT7DaVrzRr7EwCDN5 KqoKskZjEr4WJwuK10E6n/Bl0LQmhci9Oc07MCo3rTpEpxDnLm73P6Y6tiqezffKvvHn g7y08+64I8ZHk/JFwmxpcncKUgjFZfupnfZM9aaBePUcDT2N/NKEQ2Uk1iMCmI5w7oG2 QovgUVF45quHrGuq/wod4PoA1Uqdsa4LiJpF4D+lW+KVvBZqz+0O1J94QDZgORIE7qV6 EUEuDIJDNkIS/xQO+r76+elOLkvoPIpXMABMvXQm9dwtwCui5Nrwnmwfm8xis2UGwctS RVpQ== 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=CjnCeKaG0NR1cyUH9tS69BouqEvxo4ZZYooBugNHCYc=; b=EsUDvstAMMue2spXnJot/DqkpXneTVrHP/u4rflb1gRUIWAm0XEHhWG+SY0wVIkRTj RKIS1UWofC08WwCQvnitxGH5LmSCeOQfSUT6QW2cHjgivvEHowtD01iont7fTGmfWBC6 uRKxjYm/iIb39GJ5LQQJgKI7U9GPeEuQs8pK3mhmihmWe2NrxUMNvUZXkf2kEhIUaoXI u7RCBpZ/xoGZwXZ78tUvo/J6TEemGfmh8610h2zi9Uzqipd8OoVQHLi+eOD34pptqWGl M/3CbhiqZv03/7J3LIWNk6Kwu5iPdexNhV7wxeWzTNElK4qfjuf/eE8lRx+EFFKxuhmP Gb7g== X-Gm-Message-State: AOAM53026r+0MArJMrMBzIFp0zi/x9PFleMbeRUkFX3DX42mp6PM4ic6 /WAiHrMDAgUqmwyRTq/hR5I= X-Google-Smtp-Source: ABdhPJynnD3QjjBVeP8iV2poly+2CorVuI1Yhcrl/4v/eJ7nCxWaGDA4Rs4pA3XAMaGmWcQa/38NDQ== X-Received: by 2002:a5d:554d:: with SMTP id g13mr39318156wrw.98.1593892330116; Sat, 04 Jul 2020 12:52:10 -0700 (PDT) Original-Received: from my-little-tumbleweed (200.143.13.109.rev.sfr.net. [109.13.143.200]) by smtp.gmail.com with ESMTPSA id v12sm5399911wrt.31.2020.07.04.12.52.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 Jul 2020 12:52:09 -0700 (PDT) In-Reply-To: <87h7un2mq9.fsf@gmail.com> ("=?UTF-8?Q?K=C3=A9vin?= Le Gouguec"'s message of "Sat, 04 Jul 2020 19:50:38 +0200") 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:182716 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable K=C3=A9vin Le Gouguec writes: > If these options still make sense (i.e. users should be able to choose > between extended or non-extended backgrounds/under/overlines, > independently of how themes customize the faces), org-level-* and > org-block-{begin,end}-line should probably be defined with :extend t? To make the discussion more concrete: here's a suggested patch for Org against the emacs-27 branch; what say you? --=-=-= Content-Type: text/x-patch Content-Disposition: inline diff --git a/lisp/org/org-compat.el b/lisp/org/org-compat.el index c1aaf17ca2..7c905ef07e 100644 --- a/lisp/org/org-compat.el +++ b/lisp/org/org-compat.el @@ -334,6 +334,13 @@ org-compatible-face specs)) (make-obsolete 'org-compatible-face "you can remove it." "Org 9.0") +(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 (>= emacs-major-version 27) '(:extend t)))) + (defun org-add-link-type (type &optional follow export) "Add a new TYPE link. FOLLOW and EXPORT are two functions. diff --git a/lisp/org/org-faces.el b/lisp/org/org-faces.el index 30eab9bc6b..37a47e7c50 100644 --- a/lisp/org/org-faces.el +++ b/lisp/org/org-faces.el @@ -28,6 +28,8 @@ ;;; Code: +(require 'org-compat) + (defgroup org-faces nil "Faces in Org mode." :tag "Org Faces" @@ -45,35 +47,35 @@ org-hide color of the frame." :group 'org-faces) -(defface org-level-1 '((t :inherit outline-1)) +(defface org-level-1 `((t ,(org-extended-face '(:inherit outline-1)))) "Face used for level 1 headlines." :group 'org-faces) -(defface org-level-2 '((t :inherit outline-2)) +(defface org-level-2 `((t ,(org-extended-face '(:inherit outline-2)))) "Face used for level 2 headlines." :group 'org-faces) -(defface org-level-3 '((t :inherit outline-3)) +(defface org-level-3 `((t ,(org-extended-face '(:inherit outline-3)))) "Face used for level 3 headlines." :group 'org-faces) -(defface org-level-4 '((t :inherit outline-4)) +(defface org-level-4 `((t ,(org-extended-face '(:inherit outline-4)))) "Face used for level 4 headlines." :group 'org-faces) -(defface org-level-5 '((t :inherit outline-5)) +(defface org-level-5 `((t ,(org-extended-face '(:inherit outline-5)))) "Face used for level 5 headlines." :group 'org-faces) -(defface org-level-6 '((t :inherit outline-6)) +(defface org-level-6 `((t ,(org-extended-face '(:inherit outline-6)))) "Face used for level 6 headlines." :group 'org-faces) -(defface org-level-7 '((t :inherit outline-7)) +(defface org-level-7 `((t ,(org-extended-face '(:inherit outline-7)))) "Face used for level 7 headlines." :group 'org-faces) -(defface org-level-8 '((t :inherit outline-8)) +(defface org-level-8 `((t ,(org-extended-face '(:inherit outline-8)))) "Face used for level 8 headlines." :group 'org-faces) @@ -399,11 +401,16 @@ org-block :group 'org-faces :version "26.1") -(defface org-block-begin-line '((t (:inherit org-meta-line))) +(defface org-block-begin-line `((t ,(org-extended-face + '(:inherit org-meta-line)))) "Face used for the line delimiting the begin of source blocks." :group 'org-faces) -(defface org-block-end-line '((t (:inherit org-block-begin-line))) +;; Explicitly extend this face; if a theme does not make it inherit +;; from org-block-begin-line, the :extend attribute will remain +;; unspecified. +(defface org-block-end-line `((t ,(org-extended-face + '(:inherit org-block-begin-line)))) "Face used for the line delimiting the end of source blocks." :group 'org-faces) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable See the screenshots posted by Erik at the beginning of this thread[1] and mine[2] for comparison. [1] https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D42184#5 [2] https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D42184#8 My aim was to allow you (Org maintainers) to commit this verbatim to the org-mode repository, where you probably want to keep supporting Emacs =E2=89=A426.3. NB: I'm far from an Elisp wizard, there may more elegant ways to solve this than my backquotefest; suggestions welcome. > Relatedly (but not crucial to solving this bug), should org-block and > org-block-background also have :extend t? It would make sense to me > since they delimit visual "blocks". I still think the answer to the above is "yes". Will add to my patch if you agree. > Last question (that one might be answered somewhere in Org's > documentation): how should we patch org-mode? First on emacs-27, then > on org-mode's maint branch? --=-=-=--