Subject: bug#61567: closed (Re: bug#61567: 30.0.50; Define display-time-time-and-date-indicator face)

From: [email-masked] (GNU bug Tracking System)
Date: Fri, 17 Feb 2023 10:18:02 +0000

Your bug report

#61567: 30.0.50; Define display-time-time-and-date-indicator face

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
61567: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=61567
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#61567: 30.0.50; Define display-time-time-and-date-indicator face
From: Protesilaos Stavrou <[email-masked]>
To: Eli Zaretskii <[email-masked]>
Cc: [email-masked]
Date: Fri, 17 Feb 2023 12:16:49 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

> From: Eli Zaretskii <[email-masked]>
> Date: Fri, 17 Feb 2023 08:37:32 +0200
>
>> From: Protesilaos Stavrou <[email-masked]>
>> Date: Fri, 17 Feb 2023 08:07:40 +0200
>> 
>> I have written a small patch for 'time.el'.  It adds a face to the
>> date+time of 'M-x display-time-mode'.
>> 
>> Should I install this on 'master'?
>
> Yes, please.
>
>> Any changes to make to it?
>
> See below.

> [... 30 lines elided]

Thank you for the feedback!  I made the changes and installed the patch.
Closing the bug now.

-- 
Protesilaos Stavrou
https://protesilaos.com

Subject: 30.0.50; Define display-time-time-and-date-indicator face
From: Protesilaos Stavrou <[email-masked]>
To: [email-masked]
Date: Fri, 17 Feb 2023 08:07:40 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

Dear maintainers,

I have written a small patch for 'time.el'.  It adds a face to the
date+time of 'M-x display-time-mode'.

Should I install this on 'master'?  Any changes to make to it?

All the best,
Protesilaos (or simply "Prot")

-- 
Protesilaos Stavrou
https://protesilaos.com
>From 6f9cad322b002e796dc38deaf3ad10e679c6ac57 Mon Sep 17 00:00:00 2001
Message-Id: <[email-masked]>
From: Protesilaos Stavrou <[email-masked]>
Date: Thu, 16 Feb 2023 11:05:53 +0200
Subject: [PATCH] Define 'display-time-time-and-date-indicator' face

* etc/NEWS: Announce the new face for the 'display-time-format'.
* lisp/time.el (display-time-time-and-date-indicator): Define new face.
(display-time-string-forms): Use the new face.
---
 etc/NEWS     | 7 +++++++
 lisp/time.el | 6 ++++++
 2 files changed, 13 insertions(+)

diff --git a/etc/NEWS b/etc/NEWS
index 4fbe09e0541..e05c288dd9f 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -56,6 +56,13 @@ This allows the user to customize the prompt that is appended by
 'yes-or-no-p' when asking questions.  The default value is
 "(yes or no) ".
 
+---
+** New face for 'display-time-format'
+The 'display-time-time-and-date-indicator' applies to the time and
+date component of the 'display-time-mode'.  By default, the face has
+all its attributes unspecified to preserve the indicator's familiar
+appearance.
+
 
 * Editing Changes in Emacs 30.1
 
diff --git a/lisp/time.el b/lisp/time.el
index f04a22dfd28..beffebbfa00 100644
--- a/lisp/time.el
+++ b/lisp/time.el
@@ -139,6 +139,11 @@ (defcustom display-time-mail-face nil
   :version "22.1"
   :type '(choice (const :tag "None" nil) face))
 
+(defface display-time-time-and-date-indicator nil
+  "Face of the `display-time-format'."
+  :group 'mode-line-faces
+  :version "30.1")
+
 (defvar display-time-mail-icon
   (find-image '((:type xpm :file "letter.xpm" :ascent center)
 		(:type pbm :file "letter.pbm" :ascent center)))
@@ -179,6 +184,7 @@ (defcustom display-time-string-forms
      (format-time-string (or display-time-format
 			     (if display-time-24hr-format "%H:%M" "%-I:%M%p"))
 			 now)
+     'face 'display-time-time-and-date-indicator
      'help-echo (format-time-string "%a %b %e, %Y" now))
     load
     (if mail
-- 
2.39.1