GNU bug report logs - #61567
30.0.50; Define display-time-time-and-date-indicator face

Previous Next

Package: emacs;

Reported by: Protesilaos Stavrou <info <at> protesilaos.com>

Date: Fri, 17 Feb 2023 06:08:01 UTC

Severity: normal

Found in version 30.0.50

Done: Protesilaos Stavrou <info <at> protesilaos.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 61567 in the body.
You can then email your comments to 61567 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#61567; Package emacs. (Fri, 17 Feb 2023 06:08:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Protesilaos Stavrou <info <at> protesilaos.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Fri, 17 Feb 2023 06:08:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Protesilaos Stavrou <info <at> protesilaos.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 30.0.50; Define display-time-time-and-date-indicator face
Date: Fri, 17 Feb 2023 08:07:40 +0200
[Message part 1 (text/plain, inline)]
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
[0001-Define-display-time-time-and-date-indicator-face.patch (text/x-patch, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#61567; Package emacs. (Fri, 17 Feb 2023 06:38:01 GMT) Full text and rfc822 format available.

Message #8 received at 61567 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Protesilaos Stavrou <info <at> protesilaos.com>
Cc: 61567 <at> debbugs.gnu.org
Subject: Re: bug#61567: 30.0.50;
 Define display-time-time-and-date-indicator face
Date: Fri, 17 Feb 2023 08:37:32 +0200
> From: Protesilaos Stavrou <info <at> protesilaos.com>
> 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.

> * 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.

Please remember to mention the bug number in the log message when you
install this.

> +---
> +** 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.

This entry is IMO too long for such a simple and minor change.  Just
saying something like

  ** New face 'display-time-time-and-date-indicator'.
  This is used for displaying the time and date components of
  'display-time-mode'.

should be enough.

> +(defface display-time-time-and-date-indicator nil
> +  "Face of the `display-time-format'."
      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
"Face for `display-time-format'."

Thanks.




Reply sent to Protesilaos Stavrou <info <at> protesilaos.com>:
You have taken responsibility. (Fri, 17 Feb 2023 10:18:02 GMT) Full text and rfc822 format available.

Notification sent to Protesilaos Stavrou <info <at> protesilaos.com>:
bug acknowledged by developer. (Fri, 17 Feb 2023 10:18:02 GMT) Full text and rfc822 format available.

Message #13 received at 61567-done <at> debbugs.gnu.org (full text, mbox):

From: Protesilaos Stavrou <info <at> protesilaos.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 61567-done <at> debbugs.gnu.org
Subject: Re: bug#61567: 30.0.50; Define display-time-time-and-date-indicator
 face
Date: Fri, 17 Feb 2023 12:16:49 +0200
> From: Eli Zaretskii <eliz <at> gnu.org>
> Date: Fri, 17 Feb 2023 08:37:32 +0200
>
>> From: Protesilaos Stavrou <info <at> protesilaos.com>
>> 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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#61567; Package emacs. (Fri, 17 Feb 2023 10:32:01 GMT) Full text and rfc822 format available.

Message #16 received at 61567 <at> debbugs.gnu.org (full text, mbox):

From: Robert Pluim <rpluim <at> gmail.com>
To: Protesilaos Stavrou <info <at> protesilaos.com>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 61567 <at> debbugs.gnu.org
Subject: Re: bug#61567: 30.0.50; Define display-time-time-and-date-indicator
 face
Date: Fri, 17 Feb 2023 11:31:08 +0100
>>>>> On Fri, 17 Feb 2023 08:37:32 +0200, Eli Zaretskii <eliz <at> gnu.org> said:
    Eli>   ** New face 'display-time-time-and-date-indicator'.
    Eli>   This is used for displaying the time and date components of
    Eli>   'display-time-mode'.

    Eli> should be enough.

    >> +(defface display-time-time-and-date-indicator nil
    >> +  "Face of the `display-time-format'."
    Eli>       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    Eli> "Face for `display-time-format'."

Thatʼs a very repetitive name. How about just
`display-time-indicator-face' (although I have a vague memory of there
being a guideline to not end faces in -face)

Robert
-- 




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#61567; Package emacs. (Fri, 17 Feb 2023 10:41:01 GMT) Full text and rfc822 format available.

Message #19 received at 61567 <at> debbugs.gnu.org (full text, mbox):

From: Protesilaos Stavrou <info <at> protesilaos.com>
To: Robert Pluim <rpluim <at> gmail.com>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 61567 <at> debbugs.gnu.org
Subject: Re: bug#61567: 30.0.50; Define display-time-time-and-date-indicator
 face
Date: Fri, 17 Feb 2023 12:40:22 +0200
> From: Robert Pluim <rpluim <at> gmail.com>
> Date: Fri, 17 Feb 2023 11:31:08 +0100
>
>>>>>> On Fri, 17 Feb 2023 08:37:32 +0200, Eli Zaretskii <eliz <at> gnu.org> said:
>     Eli>   ** New face 'display-time-time-and-date-indicator'.
>     Eli>   This is used for displaying the time and date components of
>     Eli>   'display-time-mode'.
>
>     Eli> should be enough.
>
>     >> +(defface display-time-time-and-date-indicator nil
>     >> +  "Face of the `display-time-format'."
>     Eli>       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>     Eli> "Face for `display-time-format'."
>
> Thatʼs a very repetitive name. How about just
> `display-time-indicator-face' (although I have a vague memory of there
> being a guideline to not end faces in -face)

Indeed, the name is awkard.  I also remember that use of "-face" is
discouraged, but could not find the resource for it.

My initial idea was to use "display-time-face", which would also be
symmetric with "display-time-mail-face".  Note though that the latter is
defined as a 'defcustom', so I wasn't sure what the right approach is.

-- 
Protesilaos Stavrou
https://protesilaos.com

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#61567; Package emacs. (Fri, 17 Feb 2023 10:59:02 GMT) Full text and rfc822 format available.

Message #22 received at 61567 <at> debbugs.gnu.org (full text, mbox):

From: Robert Pluim <rpluim <at> gmail.com>
To: Protesilaos Stavrou <info <at> protesilaos.com>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 61567 <at> debbugs.gnu.org
Subject: Re: bug#61567: 30.0.50; Define display-time-time-and-date-indicator
 face
Date: Fri, 17 Feb 2023 11:58:25 +0100
>>>>> On Fri, 17 Feb 2023 12:40:22 +0200, Protesilaos Stavrou <info <at> protesilaos.com> said:

    >> From: Robert Pluim <rpluim <at> gmail.com>
    >> Date: Fri, 17 Feb 2023 11:31:08 +0100
    >> 
    >>>>>>> On Fri, 17 Feb 2023 08:37:32 +0200, Eli Zaretskii <eliz <at> gnu.org> said:
    Eli> ** New face 'display-time-time-and-date-indicator'.
    Eli> This is used for displaying the time and date components of
    Eli> 'display-time-mode'.
    >> 
    Eli> should be enough.
    >> 
    >> >> +(defface display-time-time-and-date-indicator nil
    >> >> +  "Face of the `display-time-format'."
    Eli> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    Eli> "Face for `display-time-format'."
    >> 
    >> Thatʼs a very repetitive name. How about just
    >> `display-time-indicator-face' (although I have a vague memory of there
    >> being a guideline to not end faces in -face)

    Protesilaos> Indeed, the name is awkard.  I also remember that use of "-face" is
    Protesilaos> discouraged, but could not find the resource for it.

I canʼt find anything in the elisp manual. But I do note that all the
font-lock faces end in '-face'

    Protesilaos> My initial idea was to use "display-time-face", which would also be
    Protesilaos> symmetric with "display-time-mail-face".  Note though that the latter is
    Protesilaos> defined as a 'defcustom', so I wasn't sure what the right approach is.

`defface' defined faces are customizable, so I donʼt think it matters.

Robert
-- 




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#61567; Package emacs. (Fri, 17 Feb 2023 11:34:02 GMT) Full text and rfc822 format available.

Message #25 received at 61567 <at> debbugs.gnu.org (full text, mbox):

From: Protesilaos Stavrou <info <at> protesilaos.com>
To: Robert Pluim <rpluim <at> gmail.com>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 61567 <at> debbugs.gnu.org
Subject: Re: bug#61567: 30.0.50; Define display-time-time-and-date-indicator
 face
Date: Fri, 17 Feb 2023 13:33:12 +0200
> From: Robert Pluim <rpluim <at> gmail.com>
> Date: Fri, 17 Feb 2023 11:58:25 +0100

> [... 21 lines elided]
>
>     Protesilaos> Indeed, the name is awkard.  I also remember that use of "-face" is
>     Protesilaos> discouraged, but could not find the resource for it.
>
> I canʼt find anything in the elisp manual. But I do note that all the
> font-lock faces end in '-face'
>
>     Protesilaos> My initial idea was to use "display-time-face", which would also be
>     Protesilaos> symmetric with "display-time-mail-face".  Note though that the latter is
>     Protesilaos> defined as a 'defcustom', so I wasn't sure what the right approach is.
>
> `defface' defined faces are customizable, so I donʼt think it matters.

Okay.  Any thoughts on renaming the face to 'display-time-face'?  Maybe
some other name is better?

-- 
Protesilaos Stavrou
https://protesilaos.com

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#61567; Package emacs. (Fri, 17 Feb 2023 12:03:01 GMT) Full text and rfc822 format available.

Message #28 received at 61567 <at> debbugs.gnu.org (full text, mbox):

From: Basil Contovounesios <contovob <at> tcd.ie>
To: Robert Pluim <rpluim <at> gmail.com>
Cc: Protesilaos Stavrou <info <at> protesilaos.com>, Eli Zaretskii <eliz <at> gnu.org>,
 61567 <at> debbugs.gnu.org
Subject: Re: bug#61567: 30.0.50; Define display-time-time-and-date-indicator
 face
Date: Fri, 17 Feb 2023 12:02:48 +0000
Robert Pluim [2023-02-17 11:58 +0100] wrote:

>>>>>> On Fri, 17 Feb 2023 12:40:22 +0200, Protesilaos Stavrou <info <at> protesilaos.com> said:
>
>     Protesilaos> Indeed, the name is awkard.  I also remember that use of "-face" is
>     Protesilaos> discouraged, but could not find the resource for it.

> I canʼt find anything in the elisp manual.

It's mentioned in the description of defface (C-h S defface).

-- 
Basil




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#61567; Package emacs. (Fri, 17 Feb 2023 12:32:02 GMT) Full text and rfc822 format available.

Message #31 received at 61567 <at> debbugs.gnu.org (full text, mbox):

From: Robert Pluim <rpluim <at> gmail.com>
To: Protesilaos Stavrou <info <at> protesilaos.com>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 61567 <at> debbugs.gnu.org
Subject: Re: bug#61567: 30.0.50; Define display-time-time-and-date-indicator
 face
Date: Fri, 17 Feb 2023 13:30:52 +0100
>>>>> On Fri, 17 Feb 2023 13:33:12 +0200, Protesilaos Stavrou <info <at> protesilaos.com> said:
    Protesilaos> Okay.  Any thoughts on renaming the face to 'display-time-face'?  Maybe
    Protesilaos> some other name is better?

Iʼm bad at naming at the best of times. 'display-time-face' sounds
fine to me (or even 'display-time' if we obey the edict in the elisp
manual).

Robert
-- 




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#61567; Package emacs. (Fri, 17 Feb 2023 12:36:02 GMT) Full text and rfc822 format available.

Message #34 received at 61567 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Protesilaos Stavrou <info <at> protesilaos.com>
Cc: rpluim <at> gmail.com, 61567 <at> debbugs.gnu.org
Subject: Re: bug#61567: 30.0.50; Define display-time-time-and-date-indicator
 face
Date: Fri, 17 Feb 2023 14:35:45 +0200
> From: Protesilaos Stavrou <info <at> protesilaos.com>
> Cc: Eli Zaretskii <eliz <at> gnu.org>, 61567 <at> debbugs.gnu.org
> Date: Fri, 17 Feb 2023 13:33:12 +0200
> 
> Okay.  Any thoughts on renaming the face to 'display-time-face'?  Maybe
> some other name is better?

Please don't end the face's name with "-face".  I suggest
display-time-date-and-time instead.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#61567; Package emacs. (Fri, 17 Feb 2023 12:44:01 GMT) Full text and rfc822 format available.

Message #37 received at 61567 <at> debbugs.gnu.org (full text, mbox):

From: Robert Pluim <rpluim <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Protesilaos Stavrou <info <at> protesilaos.com>, 61567 <at> debbugs.gnu.org
Subject: Re: bug#61567: 30.0.50; Define display-time-time-and-date-indicator
 face
Date: Fri, 17 Feb 2023 13:43:14 +0100
>>>>> On Fri, 17 Feb 2023 14:35:45 +0200, Eli Zaretskii <eliz <at> gnu.org> said:

    >> From: Protesilaos Stavrou <info <at> protesilaos.com>
    >> Cc: Eli Zaretskii <eliz <at> gnu.org>, 61567 <at> debbugs.gnu.org
    >> Date: Fri, 17 Feb 2023 13:33:12 +0200
    >> 
    >> Okay.  Any thoughts on renaming the face to 'display-time-face'?  Maybe
    >> some other name is better?

    Eli> Please don't end the face's name with "-face".  I suggest
    Eli> display-time-date-and-time instead.

I think we have a winner

Robert
-- 




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#61567; Package emacs. (Fri, 17 Feb 2023 15:48:01 GMT) Full text and rfc822 format available.

Message #40 received at 61567 <at> debbugs.gnu.org (full text, mbox):

From: Drew Adams <drew.adams <at> oracle.com>
To: Basil Contovounesios <contovob <at> tcd.ie>, Robert Pluim <rpluim <at> gmail.com>
Cc: Protesilaos Stavrou <info <at> protesilaos.com>, Eli Zaretskii <eliz <at> gnu.org>,
 "61567 <at> debbugs.gnu.org" <61567 <at> debbugs.gnu.org>
Subject: RE: [External] : bug#61567: 30.0.50; Define
 display-time-time-and-date-indicator face
Date: Fri, 17 Feb 2023 15:47:40 +0000
> > I canʼt find anything in the elisp manual.
> 
> It's mentioned in the description of defface (C-h S defface).

I was going to say the same thing.  Perhaps
it should _also_ be said in the doc string
(but that's already a bit long, and it has
a link to the Elisp manual doc).  IMO that
would help.
___

As for the face name: This face is intended
(only) for the mode-line, no?  That's more
important (besides respecting the guideline)
than including "-face" in the name.

Maybe something like `mode-line-datetime'?

Standard faces used generally in the mode-line
have that prefix `mode-line-'.  Other faces
used in the mode-line (e.g. for different
modes) typically have "mode-line" as suffix
or infix.

mode-line 
mode-line-buffer-id 
mode-line-emphasis 
mode-line-highlight 
mode-line-inactive

compilation-mode-line-exit
compilation-mode-line-fail 
compilation-mode-line-run 

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#61567; Package emacs. (Sat, 18 Feb 2023 07:37:02 GMT) Full text and rfc822 format available.

Message #43 received at 61567 <at> debbugs.gnu.org (full text, mbox):

From: Protesilaos Stavrou <info <at> protesilaos.com>
To: Robert Pluim <rpluim <at> gmail.com>, Eli Zaretskii <eliz <at> gnu.org>
Cc: 61567 <at> debbugs.gnu.org
Subject: Re: bug#61567: 30.0.50; Define display-time-time-and-date-indicator
 face
Date: Sat, 18 Feb 2023 09:36:31 +0200
> From: Robert Pluim <rpluim <at> gmail.com>
> Date: Fri, 17 Feb 2023 13:43:14 +0100
>
>>>>>> On Fri, 17 Feb 2023 14:35:45 +0200, Eli Zaretskii <eliz <at> gnu.org> said:
>
>     >> From: Protesilaos Stavrou <info <at> protesilaos.com>
>     >> Cc: Eli Zaretskii <eliz <at> gnu.org>, 61567 <at> debbugs.gnu.org
>     >> Date: Fri, 17 Feb 2023 13:33:12 +0200
>     >> 
>     >> Okay.  Any thoughts on renaming the face to 'display-time-face'?  Maybe
>     >> some other name is better?
>
>     Eli> Please don't end the face's name with "-face".  I suggest
>     Eli> display-time-date-and-time instead.
>
> I think we have a winner

I made the change.  Thank you!

-- 
Protesilaos Stavrou
https://protesilaos.com




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 18 Mar 2023 11:24:10 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 93 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.