unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#39956: 26.2; improve display of information of M-x list-timers
@ 2020-03-06 16:50 ndame
       [not found] ` <handler.39956.B.15835136805690.ack@debbugs.gnu.org>
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: ndame @ 2020-03-06 16:50 UTC (permalink / raw)
  To: 39956

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


I've been developing a package lately which uses several timers, and
because of that I use M-x list-timers often. I don't see in the NEWS of 27
changes related to this, so I list some problems.

The first thing which wasn't obvious first that the Next column displays
the time in seconds, but the Repeat column uses minutes, though it's
not indicated anywhere in the header that they use different units.

Generally, the best solution could be to use days, hours, minutes,
seconds format, instead of displaying floating point values.

E.g this line

             195.08     5.00 savehist-autosave

could be more readable like this

             3m 15.08s     5m  savehist-autosave


Or this one

       26479.43  1440.00 run-hooks

like this

       7h 21m 19.43s  1d run-hooks



The latter also demonstrates an other problem: if you only see
run-hooks as the function then you have no idea what will actually
run. It's not trivial to find the source. So if the function has args
then they should also be displayed, at least in some shortened form
with the too long part cut off if the args are too long.
 

[-- Attachment #2: Type: text/html, Size: 1494 bytes --]

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

* bug#39956: 26.2; improve display of information of M-x list-timers
       [not found] ` <handler.39956.B.15835136805690.ack@debbugs.gnu.org>
@ 2020-03-07 22:03   ` ndame
  2020-10-27 10:05     ` Lars Ingebrigtsen
  0 siblings, 1 reply; 12+ messages in thread
From: ndame @ 2020-03-07 22:03 UTC (permalink / raw)
  To: 39956@debbugs.gnu.org

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

 
One more thing: it's strange that a buffer displaying timers is so static.

I can keep pressing g manually to see the timers working, but it could be much better
if emacs updated the timer display automatically every second or so when the buffer is 
visible.
 

[-- Attachment #2: Type: text/html, Size: 317 bytes --]

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

* bug#39956: 26.2; improve display of information of M-x list-timers
  2020-03-06 16:50 bug#39956: 26.2; improve display of information of M-x list-timers ndame
       [not found] ` <handler.39956.B.15835136805690.ack@debbugs.gnu.org>
@ 2020-10-27 10:05 ` Lars Ingebrigtsen
  2020-10-27 10:23   ` Basil L. Contovounesios
  2020-10-28 13:39 ` Mattias Engdegård
  2 siblings, 1 reply; 12+ messages in thread
From: Lars Ingebrigtsen @ 2020-10-27 10:05 UTC (permalink / raw)
  To: ndame; +Cc: 39956

ndame <emacsuser@freemail.hu> writes:

> The first thing which wasn't obvious first that the Next column displays
> the time in seconds, but the Repeat column uses minutes, though it's
> not indicated anywhere in the header that they use different units.

This has been changed in Emacs 28 to be consistent (in seconds).

> Generally, the best solution could be to use days, hours, minutes,
> seconds format, instead of displaying floating point values.
>
> E.g this line
>
>              195.08     5.00 savehist-autosave
>
> could be more readable like this
>
>              3m 15.08s     5m  savehist-autosave
>
> Or this one
>
>        26479.43  1440.00 run-hooks
>
> like this
>
>        7h 21m 19.43s  1d run-hooks

Yes, that would be nicer.  Anybody else got an opinion here?  And does
Emacs have a nice format-seconds-human-readable function somewhere?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





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

* bug#39956: 26.2; improve display of information of M-x list-timers
  2020-03-07 22:03   ` ndame
@ 2020-10-27 10:05     ` Lars Ingebrigtsen
  0 siblings, 0 replies; 12+ messages in thread
From: Lars Ingebrigtsen @ 2020-10-27 10:05 UTC (permalink / raw)
  To: ndame; +Cc: 39956@debbugs.gnu.org

ndame <emacsuser@freemail.hu> writes:

> One more thing: it's strange that a buffer displaying timers is so static.
>
> I can keep pressing g manually to see the timers working, but it could
> be much better if emacs updated the timer display automatically every
> second or so when the buffer is visible.

It would lead to a lot of jumping around, which would make the buffer
hard to work with (when trying to cancel a timer, for instance).

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





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

* bug#39956: 26.2; improve display of information of M-x list-timers
  2020-10-27 10:05 ` Lars Ingebrigtsen
@ 2020-10-27 10:23   ` Basil L. Contovounesios
  2020-10-28  9:07     ` Lars Ingebrigtsen
  0 siblings, 1 reply; 12+ messages in thread
From: Basil L. Contovounesios @ 2020-10-27 10:23 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: ndame, 39956

Lars Ingebrigtsen <larsi@gnus.org> writes:

> ndame <emacsuser@freemail.hu> writes:
>
>> Generally, the best solution could be to use days, hours, minutes,
>> seconds format, instead of displaying floating point values.
>>
>> E.g this line
>>
>>              195.08     5.00 savehist-autosave
>>
>> could be more readable like this
>>
>>              3m 15.08s     5m  savehist-autosave
>>
>> Or this one
>>
>>        26479.43  1440.00 run-hooks
>>
>> like this
>>
>>        7h 21m 19.43s  1d run-hooks
>
> Yes, that would be nicer.  Anybody else got an opinion here?  And does
> Emacs have a nice format-seconds-human-readable function somewhere?

What about format-seconds?

  (format-seconds "%hh %mm %z%ss" 1000) ; => "16m 40s"

-- 
Basil





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

* bug#39956: 26.2; improve display of information of M-x list-timers
  2020-10-27 10:23   ` Basil L. Contovounesios
@ 2020-10-28  9:07     ` Lars Ingebrigtsen
  2020-10-28 15:17       ` Eli Zaretskii
  0 siblings, 1 reply; 12+ messages in thread
From: Lars Ingebrigtsen @ 2020-10-28  9:07 UTC (permalink / raw)
  To: Basil L. Contovounesios; +Cc: ndame, 39956

"Basil L. Contovounesios" <contovob@tcd.ie> writes:

> What about format-seconds?
>
>   (format-seconds "%hh %mm %z%ss" 1000) ; => "16m 40s"

Nice!  I've now redone the list-timers display using this format.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





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

* bug#39956: 26.2; improve display of information of M-x list-timers
  2020-03-06 16:50 bug#39956: 26.2; improve display of information of M-x list-timers ndame
       [not found] ` <handler.39956.B.15835136805690.ack@debbugs.gnu.org>
  2020-10-27 10:05 ` Lars Ingebrigtsen
@ 2020-10-28 13:39 ` Mattias Engdegård
  2020-10-30 10:03   ` Lars Ingebrigtsen
  2020-10-30 11:11   ` bug#39956: 26.2; improve display of information of M-x list-timers Lars Ingebrigtsen
  2 siblings, 2 replies; 12+ messages in thread
From: Mattias Engdegård @ 2020-10-28 13:39 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: Basil L. Contovounesios, ndame, 39956

The fractions of a second are gone. Was that intended?
I thought it was rather nice to have those, especially when comparing timers that would otherwise seem to expire simultaneously. Besides, 0.75 and 0 s are qualitatively rather different.






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

* bug#39956: 26.2; improve display of information of M-x list-timers
  2020-10-28  9:07     ` Lars Ingebrigtsen
@ 2020-10-28 15:17       ` Eli Zaretskii
  0 siblings, 0 replies; 12+ messages in thread
From: Eli Zaretskii @ 2020-10-28 15:17 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: contovob, emacsuser, 39956

> From: Lars Ingebrigtsen <larsi@gnus.org>
> Date: Wed, 28 Oct 2020 10:07:45 +0100
> Cc: ndame <emacsuser@freemail.hu>, 39956@debbugs.gnu.org
> 
> "Basil L. Contovounesios" <contovob@tcd.ie> writes:
> 
> > What about format-seconds?
> >
> >   (format-seconds "%hh %mm %z%ss" 1000) ; => "16m 40s"
> 
> Nice!  I've now redone the list-timers display using this format.

This loses information, because we only display integral seconds, the
fractional seconds are lost.  E.g., try the command in "emacs -Q".

Can we have the accuracy back, without losing human-readable format?

Thanks.





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

* bug#39956: 26.2; improve display of information of M-x list-timers
  2020-10-28 13:39 ` Mattias Engdegård
@ 2020-10-30 10:03   ` Lars Ingebrigtsen
  2020-10-30 10:06     ` bug#39956: (no subject) Lars Ingebrigtsen
  2020-10-30 11:11   ` bug#39956: 26.2; improve display of information of M-x list-timers Lars Ingebrigtsen
  1 sibling, 1 reply; 12+ messages in thread
From: Lars Ingebrigtsen @ 2020-10-30 10:03 UTC (permalink / raw)
  To: Mattias Engdegård; +Cc: Basil L. Contovounesios, ndame, 39956

Mattias Engdegård <mattiase@acm.org> writes:

> The fractions of a second are gone. Was that intended?
> I thought it was rather nice to have those, especially when comparing
> timers that would otherwise seem to expire simultaneously. Besides,
> 0.75 and 0 s are qualitatively rather different.

No, that was unintended.

Hm...  perhaps `format-second' should get support for fractional
seconds?  Introducing a new format spec should be easy enough, but what
should the format be?

%5s means front-padding with spaces so that it's 5 characters wide.
What about...  %5.2s to front-pad, and have two decimals?  Oh, yeah,
that's just the normal floating point spec; duh.

Should be trivial to implement.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





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

* bug#39956: (no subject)
  2020-10-30 10:03   ` Lars Ingebrigtsen
@ 2020-10-30 10:06     ` Lars Ingebrigtsen
  0 siblings, 0 replies; 12+ messages in thread
From: Lars Ingebrigtsen @ 2020-10-30 10:06 UTC (permalink / raw)
  To: Mattias Engdegård; +Cc: Basil L. Contovounesios, ndame, 39956

Lars Ingebrigtsen <larsi@gnus.org> writes:

> %5s means front-padding with spaces so that it's 5 characters wide.
> What about...  %5.2s to front-pad, and have two decimals?  Oh, yeah,
> that's just the normal floating point spec; duh.
>
> Should be trivial to implement.

Oops.  Ambiguous, since format-seconds unfortunately uses "." to mean
"zero-pad".  (Instead of having a leading space mean zero-pad, like in
`format'.)  

    (while (string-match "%\\.?[0-9]*\\(.\\)" string start)

OK, I'll introduce a "," thing to specify decimals.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





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

* bug#39956: 26.2; improve display of information of M-x list-timers
  2020-10-28 13:39 ` Mattias Engdegård
  2020-10-30 10:03   ` Lars Ingebrigtsen
@ 2020-10-30 11:11   ` Lars Ingebrigtsen
  2020-10-30 14:50     ` Mattias Engdegård
  1 sibling, 1 reply; 12+ messages in thread
From: Lars Ingebrigtsen @ 2020-10-30 11:11 UTC (permalink / raw)
  To: Mattias Engdegård; +Cc: Basil L. Contovounesios, ndame, 39956

Mattias Engdegård <mattiase@acm.org> writes:

> The fractions of a second are gone. Was that intended?
> I thought it was rather nice to have those, especially when comparing
> timers that would otherwise seem to expire simultaneously. Besides,
> 0.75 and 0 s are qualitatively rather different.

Now implemented.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





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

* bug#39956: 26.2; improve display of information of M-x list-timers
  2020-10-30 11:11   ` bug#39956: 26.2; improve display of information of M-x list-timers Lars Ingebrigtsen
@ 2020-10-30 14:50     ` Mattias Engdegård
  0 siblings, 0 replies; 12+ messages in thread
From: Mattias Engdegård @ 2020-10-30 14:50 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: Basil L. Contovounesios, ndame, 39956

30 okt. 2020 kl. 12.11 skrev Lars Ingebrigtsen <larsi@gnus.org>:

> Now implemented.

Nice, thank you!






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

end of thread, other threads:[~2020-10-30 14:50 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-06 16:50 bug#39956: 26.2; improve display of information of M-x list-timers ndame
     [not found] ` <handler.39956.B.15835136805690.ack@debbugs.gnu.org>
2020-03-07 22:03   ` ndame
2020-10-27 10:05     ` Lars Ingebrigtsen
2020-10-27 10:05 ` Lars Ingebrigtsen
2020-10-27 10:23   ` Basil L. Contovounesios
2020-10-28  9:07     ` Lars Ingebrigtsen
2020-10-28 15:17       ` Eli Zaretskii
2020-10-28 13:39 ` Mattias Engdegård
2020-10-30 10:03   ` Lars Ingebrigtsen
2020-10-30 10:06     ` bug#39956: (no subject) Lars Ingebrigtsen
2020-10-30 11:11   ` bug#39956: 26.2; improve display of information of M-x list-timers Lars Ingebrigtsen
2020-10-30 14:50     ` Mattias Engdegård

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