emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Gautier Ponsinet <gautier@gautierponsinet.xyz>
To: emacs-orgmode@gnu.org
Subject: New face: org-agenda-calendar-timerange
Date: Thu, 22 Dec 2022 17:56:12 +0100	[thread overview]
Message-ID: <873597xtqr.fsf@gautierponsinet.xyz> (raw)

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

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.

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Define-the-face-org-agenda-calendar-timerange.patch --]
[-- Type: text/x-patch, Size: 2205 bytes --]

From 31f2c3fc0ed93a100ccf18472cb44e2434d3060f Mon Sep 17 00:00:00 2001
From: Gautier Ponsinet <gautier@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	other threads:[~2022-12-22 16:57 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-22 16:56 Gautier Ponsinet [this message]
2023-01-17 11:20 ` New face: org-agenda-calendar-timerange Ihor Radchenko
2023-01-17 22:25   ` gautier
2023-01-18 10:08     ` Ihor Radchenko
2023-01-18 15:41       ` gautier
2023-01-18 16:01         ` gautier
2023-01-19 11:00         ` Ihor Radchenko
2023-01-19 21:58           ` gautier
2023-01-20  3:32             ` Ruijie Yu via General discussions about Org-mode.
2023-01-20  4:24               ` Ruijie Yu via General discussions about Org-mode.
2023-01-20 11:24             ` Ihor Radchenko
2023-01-20 11:36               ` Bastien Guerry
2023-01-21  8:27                 ` Ihor Radchenko
2023-01-21  8:29                   ` Ihor Radchenko
2023-01-21 22:44                     ` Gautier Ponsinet

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.orgmode.org/

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

  git send-email \
    --in-reply-to=873597xtqr.fsf@gautierponsinet.xyz \
    --to=gautier@gautierponsinet.xyz \
    --cc=emacs-orgmode@gnu.org \
    /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/org-mode.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).