From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: john muhl Newsgroups: gmane.emacs.bugs Subject: bug#71572: [PATCH] seconds-to-string-approximate Date: Sat, 07 Dec 2024 13:17:57 -0600 Message-ID: <874j3f2tga.fsf@pub.pink> References: <86r0cpicwt.fsf@gnu.org> <86msmxafog.fsf@gnu.org> <3530cd89-b5a2-4b25-95bf-1896c8ee4aef@cs.ucla.edu> <8CC4B1BB-B56A-4C3E-8B51-0E2D5B65C296@gmail.com> <86jzcbir3c.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="4736"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.12.1; emacs 31.0.50 Cc: Adam Porter , 71572@debbugs.gnu.org, Eli Zaretskii , Jonas Bernoulli , Paul Eggert To: JD Smith Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Dec 07 20:19:22 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 1tK0Kl-000162-Rw for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 07 Dec 2024 20:19:21 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tK0KY-0000Pi-Ut; Sat, 07 Dec 2024 14:19:07 -0500 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 1tK0KV-0000PS-0J for bug-gnu-emacs@gnu.org; Sat, 07 Dec 2024 14:19:03 -0500 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 1tK0KU-00078K-O3 for bug-gnu-emacs@gnu.org; Sat, 07 Dec 2024 14:19:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:References:In-Reply-To:From:To:Subject; bh=GZwYRol97grL0PQDPhskpIcdlGKP1Z4QTNfMm6IoB2o=; b=RpvkTMqLIEv2BHk2HkrFm9ZwUrN9xV6VgstIiCmS+w9yKEOFqyFdVGyNT+57yUl51dQIQ/kzbOT1oVSKTbBqUQirfbRm4Gi+yLf8UVhxitW+Euck4QaG6C3iUSLOIGFxlaWyV4/HfJ+eV564kkICwLbdc5IOC7/tXfHOptADFFHzCtEcWKGB9P38Tn2WFs14/mRI4Z8nB0y/40y2qpPVkpmEjCUb3B2+6K0GYEPZtB5VIluWx2K3ytkdmAbWQf9nkg55fZt7oJSu8XS4v2PFj3skFrME3QMHC37xmrngLXLa+LWlXwUeBJ2Go7UDQCQAIq7c9j0JWMy5VmOTjVl3Iw==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tK0KU-0006F7-Ik for bug-gnu-emacs@gnu.org; Sat, 07 Dec 2024 14:19:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: john muhl Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 07 Dec 2024 19:19:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71572 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 71572-submit@debbugs.gnu.org id=B71572.173359908923919 (code B ref 71572); Sat, 07 Dec 2024 19:19:02 +0000 Original-Received: (at 71572) by debbugs.gnu.org; 7 Dec 2024 19:18:09 +0000 Original-Received: from localhost ([127.0.0.1]:48551 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tK0Jd-0006Dj-1l for submit@debbugs.gnu.org; Sat, 07 Dec 2024 14:18:09 -0500 Original-Received: from fhigh-b4-smtp.messagingengine.com ([202.12.124.155]:44453) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tK0Ja-0006DD-1t for 71572@debbugs.gnu.org; Sat, 07 Dec 2024 14:18:07 -0500 Original-Received: from phl-compute-12.internal (phl-compute-12.phl.internal [10.202.2.52]) by mailfhigh.stl.internal (Postfix) with ESMTP id 19A5C2540171; Sat, 7 Dec 2024 14:18:00 -0500 (EST) Original-Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-12.internal (MEProxy); Sat, 07 Dec 2024 14:18:00 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pub.pink; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm1; t=1733599079; x=1733685479; bh=GZwYRol97grL0PQDPhskpIcdlGKP1Z4QTNfMm6IoB2o=; b= K6InDlUntjOQswlVnT4JObsSk+/glFohDjXixEVPfWoV8XfbEm2bZZ6aK463ZOpI xrLwHBqjMQaJdBnY5SpozM0xxS3oG2JJL90jPKtch0kGYds3i9PQbueeGGhriNVs vJAr0gibrbWlzNJKscPsweae+j8bEWQOrpmLZn267gSOceoi3DfD6kwpn95r2pi+ m1RENGgd4rG4hExhCMOIerRRIb0nKIn+IH4ZiP8t5+Q6VtHfKdo6HYGcHk/5HplA GLGQxDfFqZDYvdUNB4AJ5reNwJrZViqajOs2NC6Sc37ef2YWFszE9/bCVR/t1EZW ojlsbHKyV3uiSP64WbAKGA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1733599079; x= 1733685479; bh=GZwYRol97grL0PQDPhskpIcdlGKP1Z4QTNfMm6IoB2o=; b=U mT5E+ms1HpXyxZZ3tC1oR1p9vtsOxW2dG2b/t4qRLilIfbWgCZrB0rAl9Jcqgi+t TsmXgrRExIzvvEcC9v97g9dvv/z1E0LA+cV4fqXzgIIpP6iyEvKvKEX+C4BTDq5s I80Xn1xcQFfNAJtK0MJA6nDC4W/fAPqA8uRm0/EwHqeXqE9THIPE9ZUzUKrmWO2K LUHxXWB0IXe+TKXXQ7th3RgARmfEvpSa2HWB1rDIJyo649IyDDUktSFkzpJIdirV UfXkvXdLJoY/moqyx/CBtVx76CD0d2xq0xfi9f6gEaFC70OHhMBe0qULBZlHUGPl 31ksCpP3dq6JjgoNZuHpw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrjedugdduvdduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhephffvvefujghffgffkfggtgfgsehtqhertddtreej necuhfhrohhmpehjohhhnhcumhhuhhhluceojhhmsehpuhgsrdhpihhnkheqnecuggftrf grthhtvghrnhepgeevhedvtdetvdekuddvtddthefhvdfggfdvgfeitdejudehhfffjedt vdevveeknecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomh epjhhmsehpuhgsrdhpihhnkhdpnhgspghrtghpthhtohepiedpmhhouggvpehsmhhtphho uhhtpdhrtghpthhtohepvghgghgvrhhtsegtshdruhgtlhgrrdgvughupdhrtghpthhtoh epjhhonhgrshessggvrhhnohhulhdrlhhipdhrtghpthhtohepjeduheejvdesuggvsggs uhhgshdrghhnuhdrohhrghdprhgtphhtthhopegruggrmhesrghlphhhrghprghprgdrnh gvthdprhgtphhtthhopegvlhhiiiesghhnuhdrohhrghdprhgtphhtthhopehjughtshhm ihhthhesghhmrghilh X-ME-Proxy: Feedback-ID: i74194916:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 7 Dec 2024 14:17:58 -0500 (EST) In-Reply-To: (JD Smith's message of "Sat, 7 Dec 2024 12:52:01 -0500") 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:296596 Archived-At: JD Smith writes: >> On Dec 7, 2024, at 8:02=E2=80=AFAM, Eli Zaretskii wrote: >>=20 >>> From: JD Smith >>> Date: Sat, 30 Nov 2024 13:58:52 -0500 >>> Cc: Eli Zaretskii , >>> Adam Porter , >>> jonas@bernoul.li, >>> Paul Eggert >>>=20 >>> I was recently reminded of the need for a more capable seconds-to-strin= g.=20=20 >>>=20 >>> Anyone have any additional comments on this proposed patch? If not, >>> I'd suggest someone with access >>> merges. >>=20 >> A few minor nits below, and then we can install: > > Thanks. Updated patch below. Thanks for working on this. I gave a quick try and noticed some amounts aren=E2=80=99t pluralized how I expect; e.g. (seconds-to-string 36541462 'expanded nil 1) ;; "1 year 1.9 month" (seconds-to-string 73082924 'expanded nil 2) ;; "2 year 3.79 months" (seconds-to-string 2511822 'expanded nil 3) ;; "4 week 1.072 day" I would expect those to output: 1 year 1.9 months 2 years 3.79 months 4 weeks 1.072 days According to the Chicago Manual of Style all fractional values are plural, even 1.0, 2.0 &c. The incorrect =E2=80=9C2 year=E2=80=9D, =E2=80=9C4 week=E2=80=9D only happe= n when PRECISION is non-nil; e.g. (seconds-to-string 2511822 'expanded nil) "4 weeks 1 day" p.s. There is a missing =E2=80=9Cis=E2=80=9D in the last sentence of the do= cstring for seconds-to-string.