GNU bug report logs - #35331
[PATCH] Neater html table of old versions in ELPA

Previous Next

Package: emacs;

Reported by: Mattias Engdegård <mattiase <at> acm.org>

Date: Fri, 19 Apr 2019 21:37:02 UTC

Severity: minor

Tags: patch

Done: Mattias Engdegård <mattiase <at> acm.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 35331 in the body.
You can then email your comments to 35331 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#35331; Package emacs. (Fri, 19 Apr 2019 21:37:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Mattias Engdegård <mattiase <at> acm.org>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Fri, 19 Apr 2019 21:37:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Mattias Engdegård <mattiase <at> acm.org>
To: bug-gnu-emacs <at> gnu.org
Subject: [PATCH] Neater html table of old versions in ELPA
Date: Fri, 19 Apr 2019 23:36:29 +0200
[Message part 1 (text/plain, inline)]
This patch sorts the "old versions" table for each ELPA package in reverse chronological order, and uses correct unit prefixes.
[0001-Neater-html-table-of-old-versions.patch (application/octet-stream, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#35331; Package emacs. (Sun, 21 Apr 2019 16:10:01 GMT) Full text and rfc822 format available.

Message #8 received at 35331 <at> debbugs.gnu.org (full text, mbox):

From: "Basil L. Contovounesios" <contovob <at> tcd.ie>
To: Mattias Engdegård <mattiase <at> acm.org>
Cc: 35331 <at> debbugs.gnu.org
Subject: Re: bug#35331: [PATCH] Neater html table of old versions in ELPA
Date: Sun, 21 Apr 2019 17:09:07 +0100
Mattias Engdegård <mattiase <at> acm.org> writes:

> @@ -536,7 +536,10 @@ Rename DIR/ to PKG-VERS/, and return the descriptor."
>                    "\n</pre>\n")))
>        (unless (< (length files) (if (zerop (length latest)) 1 2))
>          (insert (format "<h2>Old versions</h2><table>\n"))
> -        (dolist (file files)
> +        (dolist (file 
> +                 (sort files (lambda (f1 f2)
> +                               (version-list-< (version-to-list (car f2))
> +                                               (version-to-list (car f1))))))

AKA

  (dolist (file (sort files (lambda (f1 f2)
                              (version< (car f2) (car f1)))))
    ...)

Thanks,

-- 
Basil




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#35331; Package emacs. (Mon, 22 Apr 2019 13:18:02 GMT) Full text and rfc822 format available.

Message #11 received at 35331 <at> debbugs.gnu.org (full text, mbox):

From: Mattias Engdegård <mattiase <at> acm.org>
To: "Basil L. Contovounesios" <contovob <at> tcd.ie>
Cc: 35331 <at> debbugs.gnu.org
Subject: Re: bug#35331: [PATCH] Neater html table of old versions in ELPA
Date: Mon, 22 Apr 2019 15:17:01 +0200
21 apr. 2019 kl. 18.09 skrev Basil L. Contovounesios <contovob <at> tcd.ie>:
> 
>  (dolist (file (sort files (lambda (f1 f2)
>                              (version< (car f2) (car f1)))))
>    ...)

Thank you, I obviously didn't do my homework properly.
Please consider the patch as if it had that improvement.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#35331; Package emacs. (Mon, 13 May 2019 13:43:02 GMT) Full text and rfc822 format available.

Message #14 received at 35331 <at> debbugs.gnu.org (full text, mbox):

From: Mattias Engdegård <mattiase <at> acm.org>
To: "Basil L. Contovounesios" <contovob <at> tcd.ie>
Cc: 35331 <at> debbugs.gnu.org
Subject: Re: bug#35331: [PATCH] Neater html table of old versions in ELPA
Date: Mon, 13 May 2019 15:42:35 +0200
[Message part 1 (text/plain, inline)]
> 21 apr. 2019 kl. 18.09 skrev Basil L. Contovounesios <contovob <at> tcd.ie>:
>> 
>> (dolist (file (sort files (lambda (f1 f2)
>>                             (version< (car f2) (car f1)))))
>>   ...)

Revised patch.

[0001-Neater-HTML-table-of-old-package-versions-bug-35331.patch (application/octet-stream, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#35331; Package emacs. (Mon, 13 May 2019 14:26:01 GMT) Full text and rfc822 format available.

Message #17 received at 35331 <at> debbugs.gnu.org (full text, mbox):

From: "Basil L. Contovounesios" <contovob <at> tcd.ie>
To: Mattias Engdegård <mattiase <at> acm.org>
Cc: 35331 <at> debbugs.gnu.org
Subject: Re: bug#35331: [PATCH] Neater html table of old versions in ELPA
Date: Mon, 13 May 2019 15:25:07 +0100
Mattias Engdegård <mattiase <at> acm.org> writes:

> diff --git a/admin/archive-contents.el b/admin/archive-contents.el
> index de444e381..c4c2e5af1 100644
> --- a/admin/archive-contents.el
> +++ b/admin/archive-contents.el
> @@ -387,16 +387,14 @@ Rename DIR/ to PKG-VERS/, and return the descriptor."
>  
>  (defun archive--html-bytes-format (bytes) ;Aka memory-usage-format.
>    (setq bytes (/ bytes 1024.0))
> -  (let ((units '(;; "B"
> -                 "kB" "MB" "GB" "TB")))
> +  (let ((units '("KiB" "MiB" "GiB" "TiB")))
>      (while (>= bytes 1024)
>        (setq bytes (/ bytes 1024.0))
>        (setq units (cdr units)))
>      (cond
> -     ;; ((integerp bytes) (format "%4d%s" bytes (car units)))
> -     ((>= bytes 100) (format "%4.0f%s" bytes (car units)))
> -     ((>= bytes 10) (format "%4.1f%s" bytes (car units)))
> -     (t (format "%4.2f%s" bytes (car units))))))
> +     ((>= bytes 100) (format "%4.0f&nbsp;%s" bytes (car units)))
> +     ((>= bytes 10) (format "%4.1f&nbsp;%s" bytes (car units)))
> +     (t (format "%4.2f&nbsp;%s" bytes (car units))))))

Is it possible to reuse file-size-human-readable here?

Does the no-break space have to be a HTML entity,
or can it be Unicode ?\u00A0?

Thanks,

-- 
Basil




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#35331; Package emacs. (Mon, 13 May 2019 15:19:01 GMT) Full text and rfc822 format available.

Message #20 received at 35331 <at> debbugs.gnu.org (full text, mbox):

From: Mattias Engdegård <mattiase <at> acm.org>
To: "Basil L. Contovounesios" <contovob <at> tcd.ie>
Cc: 35331 <at> debbugs.gnu.org
Subject: Re: bug#35331: [PATCH] Neater html table of old versions in ELPA
Date: Mon, 13 May 2019 17:18:38 +0200
[Message part 1 (text/plain, inline)]
13 maj 2019 kl. 16.25 skrev Basil L. Contovounesios <contovob <at> tcd.ie>:
> 
> Is it possible to reuse file-size-human-readable here?

That either requires modifying that function to (optionally) put a hard space between the number and unit, or post-processing its return value to achieve the same effect. The former is obviously the heroic way to go. Patch attached!

> Does the no-break space have to be a HTML entity,
> or can it be Unicode ?\u00A0?

Probably either would do, but since we don't control the web browser interpreting it, I went with what I thought was the safer option.

[0001-Optional-space-in-file-size-human-readable.patch (application/octet-stream, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#35331; Package emacs. (Wed, 15 May 2019 20:17:02 GMT) Full text and rfc822 format available.

Message #23 received at 35331 <at> debbugs.gnu.org (full text, mbox):

From: Mattias Engdegård <mattiase <at> acm.org>
To: "Basil L. Contovounesios" <contovob <at> tcd.ie>
Cc: 35331 <at> debbugs.gnu.org
Subject: Re: bug#35331: [PATCH] Neater html table of old versions in ELPA
Date: Wed, 15 May 2019 22:16:31 +0200
13 maj 2019 kl. 16.25 skrev Basil L. Contovounesios <contovob <at> tcd.ie>:
> 
> Is it possible to reuse file-size-human-readable here?

There turned out to be more things to fix in that function, so I opened a new bug for it (bug#35756).

I'm not sure what Emacs version elpa.gnu.org is using, so it is perhaps unwise to depend on a very recent addition to Emacs master.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#35331; Package emacs. (Wed, 26 Jun 2019 11:42:02 GMT) Full text and rfc822 format available.

Message #26 received at 35331 <at> debbugs.gnu.org (full text, mbox):

From: "Basil L. Contovounesios" <contovob <at> tcd.ie>
To: Mattias Engdegård <mattiase <at> acm.org>
Cc: 35331 <at> debbugs.gnu.org
Subject: Re: bug#35331: [PATCH] Neater html table of old versions in ELPA
Date: Wed, 26 Jun 2019 12:41:37 +0100
Mattias Engdegård <mattiase <at> acm.org> writes:

> 13 maj 2019 kl. 16.25 skrev Basil L. Contovounesios <contovob <at> tcd.ie>:
>> 
>> Is it possible to reuse file-size-human-readable here?
>
> There turned out to be more things to fix in that function, so I
> opened a new bug for it (bug#35756).
>
> I'm not sure what Emacs version elpa.gnu.org is using, so it is perhaps unwise
> to depend on a very recent addition to Emacs master.

Indeed.

I'd feel free to push the patch for archive-contents.el, given the lack
of objections in the last 6 weeks.

Thanks,

-- 
Basil




Reply sent to Mattias Engdegård <mattiase <at> acm.org>:
You have taken responsibility. (Wed, 26 Jun 2019 17:12:02 GMT) Full text and rfc822 format available.

Notification sent to Mattias Engdegård <mattiase <at> acm.org>:
bug acknowledged by developer. (Wed, 26 Jun 2019 17:12:03 GMT) Full text and rfc822 format available.

Message #31 received at 35331-done <at> debbugs.gnu.org (full text, mbox):

From: Mattias Engdegård <mattiase <at> acm.org>
To: "Basil L. Contovounesios" <contovob <at> tcd.ie>
Cc: 35331-done <at> debbugs.gnu.org
Subject: Re: bug#35331: [PATCH] Neater html table of old versions in ELPA
Date: Wed, 26 Jun 2019 19:11:35 +0200
26 juni 2019 kl. 13.41 skrev Basil L. Contovounesios <contovob <at> tcd.ie>:
> 
> I'd feel free to push the patch for archive-contents.el, given the lack
> of objections in the last 6 weeks.

Thank you, pushed.





bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 25 Jul 2019 11:24:08 GMT) Full text and rfc822 format available.

This bug report was last modified 5 years and 324 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.