GNU bug report logs - #79217
[PATCH] display-time-mode: Include world-clock time in mode line.

Previous Next

Package: emacs;

Reported by: Wilko Meyer <w <at> wmeyer.eu>

Date: Mon, 11 Aug 2025 14:01:01 UTC

Severity: normal

Tags: patch

Full log


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

From: Eli Zaretskii <eliz <at> gnu.org>
To: "Jacob S. Gordon" <jacob.as.gordon <at> gmail.com>
Cc: w <at> wmeyer.eu, 79217 <at> debbugs.gnu.org
Subject: Re: bug#79217: [PATCH] display-time-mode: Include world-clock time in
 mode line.
Date: Sat, 30 Aug 2025 10:41:18 +0300
> Cc: 79217 <at> debbugs.gnu.org
> Date: Thu, 14 Aug 2025 12:42:01 -0400
> From: "Jacob S. Gordon" <jacob.as.gordon <at> gmail.com>
> 
> On 2025-08-12 16:21, Wilko Meyer wrote:
> > haven't seen usage of :set in time.el
> 
> Oh and in case it wasn’t clear: I don’t think this is essential, just
> a potential nicety when customizing. As you pointed out, things like
> display-time-format don’t do this, and the mode line will update
> either way when the clock updates. So it’s more about my curiosity,
> and you should feel free to ignore :)

So do we have an agreed-upon patch for this feature?  Is the last v2
posted here the one in which all the review comments were accounted
for and adjudicated?

If so, I have a few minor comments to that patch:

> * lisp/time.el (display-time-include-world-clock): Add user option.
> (display-time-include-world-clock-labels): Add user option.
> (display-time-string-forms): Conditionally include world clock time as
> well as a local suffix for the users time.
> (time--create-world-time-mode-line-string): Helper function to fetch the
> entries to be included the right way.

Please mention the bug number in the commit log message.

> +(defcustom display-time-include-world-clock t

This default of t changes past behavior.  I think the default should
be nil, to preserve past behavior.

> +  "Include world times in the mode line. The value can be one of:

The first line of a doc string should be a single complete sentence
(because some commands, like "M-x apropos", show only that first
line).

> +t   => to include all entries from `time--display-world-list`.
> +nil => to disable showing the world clock in mode line.
> +NUM => to include at most NUM entries."
> +  :type '(choice
> +          (const :tag "Off" nil)
> +          (const :tag "All" t)
> +          (integer :tag "Max entries" 1)))

All new defcustom's should have a :version tag.

> +(defcustom display-time-include-world-clock-labels nil
> +  "Only include world-clock entries whose label is in this list."
> +  :type '(repeat (string :tag "Label")))

So if the user customizes display-time-include-world-clock to a
non-nil value, no world clock will be shown unless this option is
_also_ customized to include some labels?  This might be confusing UI,
but in any case, the doc strings of both options should
cross-reference to the other option and explain the dependencies.

Also, how can a user know which label to add for a particular entry?
IOW, the format of these labels should be described in enough detail
for the users to know how to set up this option for a particular clock
to be shown.

Thanks.




This bug report was last modified 12 days ago.

Previous Next


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