unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "Kévin Le Gouguec" <kevin.legouguec@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: egh@e6h.org, 42184@debbugs.gnu.org, mail@nicolasgoaziou.fr, bzg@gnu.org
Subject: bug#42184: 27.0.91; org-fontify-whole-heading-line does not work in emacs 27
Date: Thu, 09 Jul 2020 16:16:33 +0200	[thread overview]
Message-ID: <87zh88g4e6.fsf@gmail.com> (raw)
In-Reply-To: <871rlm1azl.fsf@gmail.com> ("Kévin Le Gouguec"'s message of "Wed, 08 Jul 2020 13:50:54 +0200")

[-- Attachment #1: Type: text/plain, Size: 384 bytes --]

Here is a variant of the previous patch, which correctly resets :extend
to nil if the user disables the relevant options (after reverting the
current buffer, or for newly opened ones).

This ends up looking similar to what Org does for org-hide; IMO this
seems like the most straightforward short-term fix.  In the long run,
these user options would probably deserve :set functions.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Fix-org-fontify-whole-line-by-setting-face-extension.patch --]
[-- Type: text/x-patch, Size: 1851 bytes --]

From 07d123c548051eb7f6bbac5c7f5a4e4b8411f976 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?K=C3=A9vin=20Le=20Gouguec?= <kevin.legouguec@gmail.com>
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)))
+
 \f
 ;;; 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
-- 
2.27.0


[-- Attachment #3: Type: text/plain, Size: 56 bytes --]


Should I post this patch to the org-mode mailing list?

  reply	other threads:[~2020-07-09 14:16 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-04  2:29 bug#42184: 27.0.91; org-fontify-whole-heading-line does not work in emacs 27 Erik Hetzner
2020-07-04 17:13 ` Kévin Le Gouguec
2020-07-04 17:18   ` Eli Zaretskii
2020-07-04 17:50     ` Kévin Le Gouguec
2020-07-04 19:52       ` Kévin Le Gouguec
2020-07-05  2:30         ` Eli Zaretskii
2020-07-05  8:57           ` Kévin Le Gouguec
2020-07-05 14:58             ` Eli Zaretskii
2020-07-05 16:02               ` Kévin Le Gouguec
2020-07-05 16:21                 ` Eli Zaretskii
2020-07-08 11:50                 ` Kévin Le Gouguec
2020-07-09 14:16                   ` Kévin Le Gouguec [this message]
2020-08-06  4:10                     ` Kyle Meyer
2020-08-06  9:32                       ` Kévin Le Gouguec
2020-08-06 13:35                       ` Eli Zaretskii
2020-09-06  8:12                         ` Bastien
2020-09-06 14:10                           ` Kévin Le Gouguec
2020-09-06 15:06                             ` Stefan Kangas
2020-09-06 14:19                           ` Kyle Meyer
2020-09-06 15:06                           ` Stefan Kangas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87zh88g4e6.fsf@gmail.com \
    --to=kevin.legouguec@gmail.com \
    --cc=42184@debbugs.gnu.org \
    --cc=bzg@gnu.org \
    --cc=egh@e6h.org \
    --cc=eliz@gnu.org \
    --cc=mail@nicolasgoaziou.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).