When a description list item has a checkbox, face 'org-checkbox
needs to occur before 'org-list-dt in the face list to have visible
effect. The attached patch reorders these two font lock keywords,
which are already applied consecutively.
From badf5e9567e1a6c60b3c2e7df8b495b449e33189 Mon Sep 17 00:00:00 2001
From: Jeff Valk <[email protected]>
Date: Sun, 24 May 2026 15:49:08 -0400
Subject: [PATCH] Ensure checkboxes are fontified in description list items

* lisp/org.el (org-set-font-lock-defaults): Reorder font lock keywords
to ensure the checkbox face has visible effect inside a definition
list item. Face 'org-checkbox needs priority over 'org-list-dt in the
face list when both are applied.
---
 lisp/org.el | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lisp/org.el b/lisp/org.el
index cb36497f4..818d73de2 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -6169,14 +6169,14 @@ needs to be inserted at a specific position in the font-lock sequence.")
 	  ;; Emphasis
           ;; `org-do-emphasis-faces' prepends faces
 	  (when org-fontify-emphasized-text '(org-do-emphasis-faces))
+	  ;; Description list items
+          '("\\(?:^[ \t]*[-+]\\|^[ \t]+[*]\\)[ \t]+\\(.*?[ \t]+::\\)\\([ \t]+\\|$\\)"
+	    1 'org-list-dt prepend)
 	  ;; Checkboxes
 	  `(,org-list-full-item-re 3 'org-checkbox prepend lax)
 	  (when (cdr (assq 'checkbox org-list-automatic-rules))
 	    '("\\[\\([0-9]*%\\)\\]\\|\\[\\([0-9]*\\)/\\([0-9]*\\)\\]"
 	      (0 (org-get-checkbox-statistics-face) prepend)))
-	  ;; Description list items
-          '("\\(?:^[ \t]*[-+]\\|^[ \t]+[*]\\)[ \t]+\\(.*?[ \t]+::\\)\\([ \t]+\\|$\\)"
-	    1 'org-list-dt prepend)
           ;; Inline export snippets
           '("\\(@@\\)\\([a-z-]+:\\).*?\\(@@\\)"
             (1 'font-lock-comment-face prepend)

base-commit: 53cec9e8635970a4fd844800f9a5ba5f85146224
-- 
2.54.0

Reply via email to