From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Philip Kaludercic Newsgroups: gmane.emacs.bugs Subject: bug#68317: Can't sort *Packages* buffer by version after installing with package-vc Date: Tue, 09 Jan 2024 20:19:15 +0000 Message-ID: <87plyaqmyk.fsf@posteo.net> References: <87edesnqd6.fsf@breatheoutbreathe.in> <835y04q8o0.fsf@gnu.org> <877ckis407.fsf@posteo.net> <83y1cynv02.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="13579"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 68317@debbugs.gnu.org, joseph@breatheoutbreathe.in To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Jan 09 21:20:23 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 1rNIaE-0003KE-Cd for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 09 Jan 2024 21:20:22 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rNIZp-0002rE-O8; Tue, 09 Jan 2024 15:19:57 -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 1rNIZo-0002pV-Ag for bug-gnu-emacs@gnu.org; Tue, 09 Jan 2024 15:19:56 -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 1rNIZo-0004zE-2H for bug-gnu-emacs@gnu.org; Tue, 09 Jan 2024 15:19:56 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rNIZv-0006rH-1P for bug-gnu-emacs@gnu.org; Tue, 09 Jan 2024 15:20:03 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Philip Kaludercic Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 09 Jan 2024 20:20:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 68317 X-GNU-PR-Package: emacs Original-Received: via spool by 68317-submit@debbugs.gnu.org id=B68317.170483157526309 (code B ref 68317); Tue, 09 Jan 2024 20:20:03 +0000 Original-Received: (at 68317) by debbugs.gnu.org; 9 Jan 2024 20:19:35 +0000 Original-Received: from localhost ([127.0.0.1]:41098 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rNIZT-0006qH-04 for submit@debbugs.gnu.org; Tue, 09 Jan 2024 15:19:35 -0500 Original-Received: from mout01.posteo.de ([185.67.36.65]:49247) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rNIZN-0006q1-HU for 68317@debbugs.gnu.org; Tue, 09 Jan 2024 15:19:33 -0500 Original-Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id C288A240027 for <68317@debbugs.gnu.org>; Tue, 9 Jan 2024 21:19:16 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1704831556; bh=JchRdW7LaAAL7W2gWp79STzv2y5zQwE7XFlf/FOxQTc=; h=From:To:Cc:Subject:Autocrypt:OpenPGP:Date:Message-ID:MIME-Version: From; b=WWIlAC031IpIF2Dz2w81pYwpBnu1F7rQF97dlfpl/yBXCsiXd7hbqzvgFzI5a/hCx cVs2FXZSugsFzh+40KT4eLZT9988Cx9mMp4jSUy3cmQ8nnJBGin6EJ6Y6mbxHsTNk4 sNTr/AERlYPS2ELunxBGGHG/Ck9BYHtzvDzKWeXCr4g+HkQCSzcSCCA7R+hzZA4VzA yD1yTI2KCDe2TrU3J+0DaFaygfRJXhSxMDVfqzoG622UsOP9rwpV+Gg9qOi7JtWcT9 tjCpZaj///gh53ojtiX3CMjDf4spFk0WB6Geper1ci16Ga6hVMgrbTIxdAsoSLMOZu oh15i1SjHci0w== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4T8j2C5D7mz6tmv; Tue, 9 Jan 2024 21:19:15 +0100 (CET) In-Reply-To: <83y1cynv02.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 09 Jan 2024 21:53:49 +0200") Autocrypt: addr=philipk@posteo.net; keydata= mDMEZBBQQhYJKwYBBAHaRw8BAQdAHJuofBrfqFh12uQu0Yi7mrl525F28eTmwUDflFNmdui0QlBo aWxpcCBLYWx1ZGVyY2ljIChnZW5lcmF0ZWQgYnkgYXV0b2NyeXB0LmVsKSA8cGhpbGlwa0Bwb3N0 ZW8ubmV0PoiWBBMWCAA+FiEEDg7HY17ghYlni8XN8xYDWXahwukFAmQQUEICGwMFCQHhM4AFCwkI BwIGFQoJCAsCBBYCAwECHgECF4AACgkQ8xYDWXahwulikAEA77hloUiSrXgFkUVJhlKBpLCHUjA0 mWZ9j9w5d08+jVwBAK6c4iGP7j+/PhbkxaEKa4V3MzIl7zJkcNNjHCXmvFcEuDgEZBBQQhIKKwYB BAGXVQEFAQEHQI5NLiLRjZy3OfSt1dhCmFyn+fN/QKELUYQetiaoe+MMAwEIB4h+BBgWCAAmFiEE Dg7HY17ghYlni8XN8xYDWXahwukFAmQQUEICGwwFCQHhM4AACgkQ8xYDWXahwukm+wEA8cml4JpK NeAu65rg+auKrPOP6TP/4YWRCTIvuYDm0joBALw98AMz7/qMHvSCeU/hw9PL6u6R2EScxtpKnWof z4oM OpenPGP: id=7126E1DE2F0CE35C770BED01F2C3CC513DB89F66; url="https://keys.openpgp.org/vks/v1/by-fingerprint/7126E1DE2F0CE35C770BED01F2C3CC513DB89F66"; preference=signencrypt 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:277660 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Eli Zaretskii writes: >> From: Philip Kaludercic >> Cc: Joseph Turner , 68317@debbugs.gnu.org >> Date: Tue, 09 Jan 2024 19:25:44 +0000 >>=20 >> Eli Zaretskii writes: >>=20 >> >> version-to-list: Invalid version syntax: =E2=80=98c99367ebc2f0afe0baa= f2f5e5ca1ad9d62ba6e21=E2=80=99 (must start with a number) >> > >> > Sounds like package-vc-commit should be modified to produce a valid >> > version string (which SHA1 is not)? Philip? >>=20 >> We can also adjust `package-menu--version-predicate' to handle >> non-version numbers, which I think would be more robust. > > Fine by me, but can this be done safely enough for emacs-29? This would be a simple implementation, I don't know if it is safe enough for you: --=-=-= Content-Type: text/plain Content-Disposition: inline diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index fa9903e13e3..f97c2cff783 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -4070,8 +4070,8 @@ package-menu-execute (defun package-menu--version-predicate (A B) "Predicate to sort \"*Packages*\" buffer by the version column. This is used for `tabulated-list-format' in `package-menu-mode'." - (let ((vA (or (version-to-list (aref (cadr A) 1)) '(0))) - (vB (or (version-to-list (aref (cadr B) 1)) '(0)))) + (let ((vA (or (ignore-error error (version-to-list (aref (cadr A) 1))) '(0))) + (vB (or (ignore-error error (version-to-list (aref (cadr B) 1))) '(0)))) (if (version-list-= vA vB) (package-menu--name-predicate A B) (version-list-< vA vB)))) --=-=-=--