Subject: bug#71572: [PATCH] seconds-to-string-approximate

From: Paul Eggert <[email-masked]>
Date: Sat, 22 Jun 2024 19:42:25 -0400

On 6/22/24 04:45, Eli Zaretskii wrote:
>> Cc: Adam Porter <[email-masked]>, [email-masked]
>> From: JD Smith <[email-masked]>
>> Date: Sat, 15 Jun 2024 13:24:00 -0400
>>
>> A very useful and widely used time operation is to approximate a given delay or age (in seconds) using a human-readable unit — think "2 hours", "5 days",  "3 weeks", or "7 months".  We have `seconds-to-string', but it provides more precision than is often required, skips some meaningful "human readable" duration units like weeks and months, and uses abbreviated units exclusively.
>>
>> For those familiar with magit, the `magit--age' function has provided this capability for quite some time (e.g. for short commit age), and other packages have adapted it.  It would be useful to have a version in core.
>>
>> This patch provides a `seconds-to-string-approximate' function based loosely on `magit--age' and `seconds-to-string'.  It allows using abbreviated or full units, and can optionally round to the nearest half-unit.
> 
> Paul, any comments to the patch?

For starters:

Why define a new function, instead of adding optional arguments to the 
existing one?

Why not look at what mastodon.el does, as the comment in 
seconds-to-string suggests? For example, mastodon-tl--human-duration 
lets you specify whatever resolution you want, instead of limiting you 
to either 0.5 or 1  as in the proposed patch.

Isn't the master branch was in an long-term sort-of-frozen state, until 
a branch is created for Emacs 30? If so I imagine changes in this area 
should wait.