unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: john muhl <jm@pub.pink>
To: JD Smith <jdtsmith@gmail.com>
Cc: Adam Porter <adam@alphapapa.net>,
	71572@debbugs.gnu.org, Eli Zaretskii <eliz@gnu.org>,
	Jonas Bernoulli <jonas@bernoul.li>,
	Paul Eggert <eggert@cs.ucla.edu>
Subject: bug#71572: [PATCH] seconds-to-string-approximate
Date: Sun, 08 Dec 2024 16:51:51 -0600	[thread overview]
Message-ID: <871pyhu6t4.fsf@pub.pink> (raw)
In-Reply-To: <CAACE323-4A0C-4170-962A-3E5284238F9F@gmail.com> (JD Smith's message of "Mon, 9 Dec 2024 04:52:56 +0900")

JD Smith <jdtsmith@gmail.com> writes:

>  On Dec 8, 2024, at 4:17 AM, john muhl <jm@pub.pink> wrote:
>
>  JD Smith <jdtsmith@gmail.com> writes:
>
>  On Dec 7, 2024, at 8:02 AM, Eli Zaretskii <eliz@gnu.org> wrote:
>
>  From: JD Smith <jdtsmith@gmail.com>
>  Date: Sat, 30 Nov 2024 13:58:52 -0500
>  Cc: Eli Zaretskii <eliz@gnu.org>,
>  Adam Porter <adam@alphapapa.net>,
>  jonas@bernoul.li,
>  Paul Eggert <eggert@cs.ucla.edu>
>
>  I was recently reminded of the need for a more capable seconds-to-string.  
>
>  Anyone have any additional comments on this proposed patch? If not,
>  I'd suggest someone with access
>  merges.
>
>  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’t pluralized how I expect; e.g.
>
>   (seconds-to-string 36541462 'expanded nil 1)
>   ;; "1 year 1.9 month"
>
> ...
>
>  According to the Chicago Manual of Style all fractional values are
>  plural, even 1.0, 2.0 &c.
>
> Thanks for this, a case I hadn't tested.  Corrected in the attached.

Looks good but the bigger interval is still always singular in the
expanded w/ precision case:

  (seconds-to-string 73082924 'expanded nil 2)
  ;; "2 year 3.79 months"
  ;;       ^ should be years

I got it working with:

  @@ -477,7 +477,7 @@ seconds-to-string
             (concat
          (when here-pre
            (concat (number-to-string cnt-pre) padding
  -             (unit (* cnt-pre round-to) here-pre) " "))
  +             (unit (* cnt-pre round-to) here-pre (> cnt-pre 1)) " "))
          (if isfloatp (format dformat cnt-val)
                     (number-to-string (floor cnt-val)))
                   padding

Thanks again.





  reply	other threads:[~2024-12-08 22:51 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-15 17:24 bug#71573: [PATCH] seconds-to-string-approximate JD Smith
2024-06-15 17:36 ` Eli Zaretskii
2024-06-17  6:20 ` bug#71573: Related functions from ts.el Adam Porter
2024-06-22 10:55   ` Stefan Kangas
2024-06-22 21:54     ` Adam Porter
2024-06-22  8:45 ` bug#71572: [PATCH] seconds-to-string-approximate Eli Zaretskii
2024-06-22 21:56   ` Adam Porter
2024-06-22 23:42   ` Paul Eggert
2024-06-23  2:16     ` JD Smith
2024-07-04  5:29       ` Eli Zaretskii
2024-07-04  6:04         ` Eli Zaretskii
2024-07-04  7:09         ` Paul Eggert
2024-07-06 19:29           ` JD Smith
2024-07-06 21:09             ` Paul Eggert
2024-07-11 21:01               ` JD Smith
2024-11-30 18:58                 ` JD Smith
2024-12-07 13:02                   ` Eli Zaretskii
2024-12-07 17:52                     ` JD Smith
2024-12-07 19:17                       ` john muhl
2024-12-08 19:52                         ` JD Smith
2024-12-08 22:51                           ` john muhl [this message]
2024-12-15 18:07                             ` JD Smith
2024-12-15 23:26                               ` john muhl
2024-07-04 15:27         ` JD Smith
2024-07-04 15:59           ` Eli Zaretskii
2024-07-04 17:16             ` JD Smith
2024-07-04 18:06               ` Eli Zaretskii
2024-07-04 16:36           ` Ihor Radchenko
2024-07-04 17:23             ` JD Smith
2024-07-04 17:57               ` Ihor Radchenko
2024-06-23  5:13     ` Eli Zaretskii
2024-07-03 20:32       ` JD Smith
2024-07-04  5:29         ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=871pyhu6t4.fsf@pub.pink \
    --to=jm@pub.pink \
    --cc=71572@debbugs.gnu.org \
    --cc=adam@alphapapa.net \
    --cc=eggert@cs.ucla.edu \
    --cc=eliz@gnu.org \
    --cc=jdtsmith@gmail.com \
    --cc=jonas@bernoul.li \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).