unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#61567: 30.0.50; Define display-time-time-and-date-indicator face
@ 2023-02-17  6:07 Protesilaos Stavrou
  2023-02-17  6:37 ` Eli Zaretskii
  0 siblings, 1 reply; 13+ messages in thread
From: Protesilaos Stavrou @ 2023-02-17  6:07 UTC (permalink / raw)
  To: 61567

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

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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Define-display-time-time-and-date-indicator-face.patch --]
[-- Type: text/x-patch, Size: 2013 bytes --]

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


^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2023-02-18  7:36 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-17  6:07 bug#61567: 30.0.50; Define display-time-time-and-date-indicator face Protesilaos Stavrou
2023-02-17  6:37 ` Eli Zaretskii
2023-02-17 10:16   ` Protesilaos Stavrou
2023-02-17 10:31   ` Robert Pluim
2023-02-17 10:40     ` Protesilaos Stavrou
2023-02-17 10:58       ` Robert Pluim
2023-02-17 11:33         ` Protesilaos Stavrou
2023-02-17 12:30           ` Robert Pluim
2023-02-17 12:35           ` Eli Zaretskii
2023-02-17 12:43             ` Robert Pluim
2023-02-18  7:36               ` Protesilaos Stavrou
2023-02-17 12:02         ` Basil Contovounesios via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-02-17 15:47           ` Drew Adams

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.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).