GNU bug report logs -
#42184
27.0.91; org-fontify-whole-heading-line does not work in emacs 27
Previous Next
Reported by: Erik Hetzner <egh <at> e6h.org>
Date: Sat, 4 Jul 2020 02:30:02 UTC
Severity: normal
Found in version 27.0.91
Done: Bastien <bzg <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
Message #38 received at 42184 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
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.
[0001-Fix-org-fontify-whole-line-by-setting-face-extension.patch (text/x-patch, inline)]
From 07d123c548051eb7f6bbac5c7f5a4e4b8411f976 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?K=C3=A9vin=20Le=20Gouguec?= <kevin.legouguec <at> 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)))
+
;;; 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
[Message part 3 (text/plain, inline)]
Should I post this patch to the org-mode mailing list?
This bug report was last modified 4 years and 343 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.