Hello everyone,

I would like to propose the introduction of a new face:
org-agenda-calendar-timerange.
It is used to show entries with a timerange in the agenda, that is,
entries with a timestamp of the form:
<2022-12-22 Thu>--<2023-01-01 Sun>
At the moment, these entries with a timerange use the default face.
Please find attached a patch.

This is my first contribution (I just finished the copyright assignment
process with the FSF), so any feedback would be greatly appreciated.

In particular, could someone confirm that the function
org-agenda-get-blocks is the right place to apply the face? I place it
there mimicking how the faces org-agenda-calendar-event and
org-agenda-calendar-sexp are applied but I am not sure of this.

All the best,
Gautier.
>From 31f2c3fc0ed93a100ccf18472cb44e2434d3060f Mon Sep 17 00:00:00 2001
From: Gautier Ponsinet <gaut...@gautierponsinet.xyz>
Date: Fri, 16 Sep 2022 22:14:11 +0200
Subject: [PATCH] Define the face org-agenda-calendar-timerange

The face org-agenda-calendar-timerange is used to show entries with a
timerange in the agenda.
---
 etc/ORG-NEWS       | 5 +++++
 lisp/org-agenda.el | 2 +-
 lisp/org-faces.el  | 4 ++++
 3 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS
index a4e54dc41..d7f6ba846 100644
--- a/etc/ORG-NEWS
+++ b/etc/ORG-NEWS
@@ -27,6 +27,11 @@ backend delegates listing generation to another package like
 ,#+LATEX_HEADER: \DefineVerbatimEnvironment{lstlisting}{Verbatim}{...whatever...}
 #+END_src
 
+*** New face: ~org-agenda-calendar-timerange~
+The face ~org-agenda-calendar-timerange~ is used to show entries with
+a timerange in the agenda.  It inherits from the default face in order
+to remain backward-compatible.
+
 * Version 9.6
 
 ** Important announcements and breaking changes
diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index 05f2e3669..6f7a2c19c 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -7059,7 +7059,7 @@ scheduled items with an hour specification like [h]h:mm."
 (defun org-agenda-get-blocks ()
   "Return the date-range information for agenda display."
   (with-no-warnings (defvar date))
-  (let* ((props (list 'face nil
+  (let* ((props (list 'face 'org-agenda-calendar-timerange
 		      'org-not-done-regexp org-not-done-regexp
 		      'org-todo-regexp org-todo-regexp
 		      'org-complex-heading-regexp org-complex-heading-regexp
diff --git a/lisp/org-faces.el b/lisp/org-faces.el
index 0effa13a1..a6143cd21 100644
--- a/lisp/org-faces.el
+++ b/lisp/org-faces.el
@@ -668,6 +668,10 @@ month and 365.24 days for a year)."
   "Face used to show events computed from a S-expression."
   :group 'org-faces)
 
+(defface org-agenda-calendar-timerange '((t :inherit default))
+  "Face used to show entries with a timerange in the agenda."
+  :group 'org-faces)
+
 (defconst org-level-faces
   '(org-level-1 org-level-2 org-level-3 org-level-4
 		org-level-5 org-level-6 org-level-7 org-level-8))
-- 
2.39.0

Reply via email to