From 6f9cad322b002e796dc38deaf3ad10e679c6ac57 Mon Sep 17 00:00:00 2001 Message-Id: <6f9cad322b002e796dc38deaf3ad10e679c6ac57.1676538384.git.info@protesilaos.com> From: Protesilaos Stavrou 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