From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#71573: [PATCH] seconds-to-string-approximate Date: Sat, 15 Jun 2024 20:36:01 +0300 Message-ID: <8634pet8fy.fsf@gnu.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="1169"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 71573@debbugs.gnu.org, adam@alphapapa.net, jonas@bernoul.li To: JD Smith Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jun 15 20:06:27 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1sIXnH-00009L-0U for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 15 Jun 2024 20:06:27 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sIXmx-0002VG-Qe; Sat, 15 Jun 2024 14:06:07 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sIXmr-0002GV-J2 for bug-gnu-emacs@gnu.org; Sat, 15 Jun 2024 14:06:02 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sIXmr-0007Gw-AE for bug-gnu-emacs@gnu.org; Sat, 15 Jun 2024 14:06:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sIXms-00061l-0B for bug-gnu-emacs@gnu.org; Sat, 15 Jun 2024 14:06:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 15 Jun 2024 18:06:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71573 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 71573-submit@debbugs.gnu.org id=B71573.171847470723041 (code B ref 71573); Sat, 15 Jun 2024 18:06:01 +0000 Original-Received: (at 71573) by debbugs.gnu.org; 15 Jun 2024 18:05:07 +0000 Original-Received: from localhost ([127.0.0.1]:37531 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sIXlz-0005zY-4b for submit@debbugs.gnu.org; Sat, 15 Jun 2024 14:05:07 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:41848) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sIXlx-0005yl-Dj; Sat, 15 Jun 2024 14:05:06 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sIXJu-0002CH-MI; Sat, 15 Jun 2024 13:36:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=DiXeSMmNTyG6TCNdz0dvi5dKl4hhbuH3uEHKrna1FKY=; b=lIx1FGSQVAGckmH3UQ90 UefpTybSDyF0/N+I3dMvbL9CKhul+ewKbGr7fkL/OaNKS19Ybdha6rXSeePWh5b61sTqOtSt+5cAB KqbJUoDCfqBPIyTyF3iO3jFeWVHMnu04tq2ot9cX18ONjnqza9p4b7YwKlyQv0eBwGR3y0LRKLdju DUOY0mVPWGhq+HQYn93ow21nMJgaLxW9PFSj4OeW2rj+wIAoO02InL1oC0lobM5gExV3Y/TsgXkLT vKaACWh+gbFQhvmFI/G6yn4CqwfjTGD2Df2qZk1cpqAQkw6cWXWYz6sEZawAt47LzaCR367WLpaqq TG67wxQReuvPDw==; In-Reply-To: (message from JD Smith on Sat, 15 Jun 2024 13:24:00 -0400) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:287304 Archived-At: merge 71573 71572 thanks > Cc: Adam Porter , jonas@bernoul.li > From: JD Smith > 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. This is a duplicate of bug#71572, merging.