all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#68317: Can't sort *Packages* buffer by version after installing with package-vc
@ 2024-01-08  8:59 Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2024-01-08 13:03 ` Eli Zaretskii
  0 siblings, 1 reply; 11+ messages in thread
From: Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2024-01-08  8:59 UTC (permalink / raw)
  To: 68317

To reproduce:

1. Install some package using package-vc.

2. Open the *Packages* buffer: M-x list-packages.  The version column
for the newly installed package should display a git hash.

3. Click on the Version column header.  If the package's hash starts with
a letter, then instead of sorting the results, Emacs signals an error:

version-to-list: Invalid version syntax: ‘c99367ebc2f0afe0baaf2f5e5ca1ad9d62ba6e21’ (must start with a number)

Thank you!!

Joseph





^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#68317: Can't sort *Packages* buffer by version after installing with package-vc
  2024-01-08  8:59 bug#68317: Can't sort *Packages* buffer by version after installing with package-vc Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2024-01-08 13:03 ` Eli Zaretskii
  2024-01-09 19:25   ` Philip Kaludercic
  0 siblings, 1 reply; 11+ messages in thread
From: Eli Zaretskii @ 2024-01-08 13:03 UTC (permalink / raw)
  To: Joseph Turner, Philip Kaludercic; +Cc: 68317

> Date: Mon, 08 Jan 2024 00:59:38 -0800
> From:  Joseph Turner via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
> 
> To reproduce:
> 
> 1. Install some package using package-vc.
> 
> 2. Open the *Packages* buffer: M-x list-packages.  The version column
> for the newly installed package should display a git hash.
> 
> 3. Click on the Version column header.  If the package's hash starts with
> a letter, then instead of sorting the results, Emacs signals an error:
> 
> version-to-list: Invalid version syntax: ‘c99367ebc2f0afe0baaf2f5e5ca1ad9d62ba6e21’ (must start with a number)

Sounds like package-vc-commit should be modified to produce a valid
version string (which SHA1 is not)?  Philip?





^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#68317: Can't sort *Packages* buffer by version after installing with package-vc
  2024-01-08 13:03 ` Eli Zaretskii
@ 2024-01-09 19:25   ` Philip Kaludercic
  2024-01-09 19:53     ` Eli Zaretskii
  0 siblings, 1 reply; 11+ messages in thread
From: Philip Kaludercic @ 2024-01-09 19:25 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 68317, Joseph Turner

Eli Zaretskii <eliz@gnu.org> writes:

>> Date: Mon, 08 Jan 2024 00:59:38 -0800
>> From:  Joseph Turner via "Bug reports for GNU Emacs,
>>  the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
>> 
>> To reproduce:
>> 
>> 1. Install some package using package-vc.
>> 
>> 2. Open the *Packages* buffer: M-x list-packages.  The version column
>> for the newly installed package should display a git hash.
>> 
>> 3. Click on the Version column header.  If the package's hash starts with
>> a letter, then instead of sorting the results, Emacs signals an error:
>> 
>> version-to-list: Invalid version syntax: ‘c99367ebc2f0afe0baaf2f5e5ca1ad9d62ba6e21’ (must start with a number)
>
> Sounds like package-vc-commit should be modified to produce a valid
> version string (which SHA1 is not)?  Philip?

We can also adjust `package-menu--version-predicate' to handle
non-version numbers, which I think would be more robust.





^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#68317: Can't sort *Packages* buffer by version after installing with package-vc
  2024-01-09 19:25   ` Philip Kaludercic
@ 2024-01-09 19:53     ` Eli Zaretskii
  2024-01-09 20:19       ` Philip Kaludercic
  0 siblings, 1 reply; 11+ messages in thread
From: Eli Zaretskii @ 2024-01-09 19:53 UTC (permalink / raw)
  To: Philip Kaludercic; +Cc: 68317, joseph

> From: Philip Kaludercic <philipk@posteo.net>
> Cc: Joseph Turner <joseph@breatheoutbreathe.in>,  68317@debbugs.gnu.org
> Date: Tue, 09 Jan 2024 19:25:44 +0000
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> >> version-to-list: Invalid version syntax: ‘c99367ebc2f0afe0baaf2f5e5ca1ad9d62ba6e21’ (must start with a number)
> >
> > Sounds like package-vc-commit should be modified to produce a valid
> > version string (which SHA1 is not)?  Philip?
> 
> 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?





^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#68317: Can't sort *Packages* buffer by version after installing with package-vc
  2024-01-09 19:53     ` Eli Zaretskii
@ 2024-01-09 20:19       ` Philip Kaludercic
  2024-01-10  3:27         ` Eli Zaretskii
  0 siblings, 1 reply; 11+ messages in thread
From: Philip Kaludercic @ 2024-01-09 20:19 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 68317, joseph

[-- Attachment #1: Type: text/plain, Size: 799 bytes --]

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Philip Kaludercic <philipk@posteo.net>
>> Cc: Joseph Turner <joseph@breatheoutbreathe.in>,  68317@debbugs.gnu.org
>> Date: Tue, 09 Jan 2024 19:25:44 +0000
>> 
>> Eli Zaretskii <eliz@gnu.org> writes:
>> 
>> >> version-to-list: Invalid version syntax: ‘c99367ebc2f0afe0baaf2f5e5ca1ad9d62ba6e21’ (must start with a number)
>> >
>> > Sounds like package-vc-commit should be modified to produce a valid
>> > version string (which SHA1 is not)?  Philip?
>> 
>> 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:


[-- Attachment #2: Type: text/plain, Size: 789 bytes --]

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))))

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* bug#68317: Can't sort *Packages* buffer by version after installing with package-vc
  2024-01-09 20:19       ` Philip Kaludercic
@ 2024-01-10  3:27         ` Eli Zaretskii
  2024-01-10  5:16           ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 11+ messages in thread
From: Eli Zaretskii @ 2024-01-10  3:27 UTC (permalink / raw)
  To: Philip Kaludercic; +Cc: 68317, joseph

> From: Philip Kaludercic <philipk@posteo.net>
> Cc: joseph@breatheoutbreathe.in,  68317@debbugs.gnu.org
> Date: Tue, 09 Jan 2024 20:19:15 +0000
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> >> From: Philip Kaludercic <philipk@posteo.net>
> >> Cc: Joseph Turner <joseph@breatheoutbreathe.in>,  68317@debbugs.gnu.org
> >> Date: Tue, 09 Jan 2024 19:25:44 +0000
> >> 
> >> Eli Zaretskii <eliz@gnu.org> writes:
> >> 
> >> >> version-to-list: Invalid version syntax: ‘c99367ebc2f0afe0baaf2f5e5ca1ad9d62ba6e21’ (must start with a number)
> >> >
> >> > Sounds like package-vc-commit should be modified to produce a valid
> >> > version string (which SHA1 is not)?  Philip?
> >> 
> >> 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:

Looks safe enough, thanks.





^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#68317: Can't sort *Packages* buffer by version after installing with package-vc
  2024-01-10  3:27         ` Eli Zaretskii
@ 2024-01-10  5:16           ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2024-01-10  8:28             ` Philip Kaludercic
  2024-01-10 13:13             ` Eli Zaretskii
  0 siblings, 2 replies; 11+ messages in thread
From: Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2024-01-10  5:16 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Philip Kaludercic, 68317

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Philip Kaludercic <philipk@posteo.net>
>> Cc: joseph@breatheoutbreathe.in,  68317@debbugs.gnu.org
>> Date: Tue, 09 Jan 2024 20:19:15 +0000
>>
>> Eli Zaretskii <eliz@gnu.org> writes:
>>
>> >> From: Philip Kaludercic <philipk@posteo.net>
>> >> Cc: Joseph Turner <joseph@breatheoutbreathe.in>,  68317@debbugs.gnu.org
>> >> Date: Tue, 09 Jan 2024 19:25:44 +0000
>> >>
>> >> Eli Zaretskii <eliz@gnu.org> writes:
>> >>
>> >> >> version-to-list: Invalid version syntax: ‘c99367ebc2f0afe0baaf2f5e5ca1ad9d62ba6e21’ (must start with a number)
>> >> >
>> >> > Sounds like package-vc-commit should be modified to produce a valid
>> >> > version string (which SHA1 is not)?  Philip?
>> >>
>> >> 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:
>
> Looks safe enough, thanks.

With this solution, when sorting by version, packages at version 0.0.0
are interleaved with packages whose version string is a hash, such as:

  breadcrumb                     c99367ebc2f0afe0baaf2f5e5ca1ad9d62ba6e21 source                No description available.
  chordpro-mode                  a63fc0b7181299befc4496cba04e0f84d5953000 source                No description available.
  consult-emms                   407edec0f2a997e32cb1bbeff811f73b6fac42ac source                No description available.
  denote                         5e9b6b3bf0a81e00b0db0071f0c06a889f7e4a71 source                No description available.
  disable-mouse                  0.0.0          external              Disable mouse commands globally
  emacsql                        0.0.0          external              High-level SQL database front-end
  hl-todo                        0.0.0          external              Highlight TODO and similar keywords
  hyperdrive                     2930992446f508a7716b1e52a6aaf824d3f152d9 source                No description available.
  jabber                         6900d9e085bbb2ef35b731c661fe54fa88422d6a source                No description available.
  ledger-mode                    0.0.0          external              Helper code for use with the "ledger" command-line tool
  lisp                           unknown        source                No description available.
  macrostep                      0.0.0          external              Interactive macro expander

While this is a little bit awkward, it's certainly better than an error.

Thank you for the quick fix!

Joseph





^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#68317: Can't sort *Packages* buffer by version after installing with package-vc
  2024-01-10  5:16           ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2024-01-10  8:28             ` Philip Kaludercic
  2024-01-10  9:06               ` Stefan Kangas
  2024-01-10 13:13             ` Eli Zaretskii
  1 sibling, 1 reply; 11+ messages in thread
From: Philip Kaludercic @ 2024-01-10  8:28 UTC (permalink / raw)
  To: Joseph Turner; +Cc: Eli Zaretskii, 68317-done

Joseph Turner <joseph@breatheoutbreathe.in> writes:

> Eli Zaretskii <eliz@gnu.org> writes:
>
>>> From: Philip Kaludercic <philipk@posteo.net>
>>> Cc: joseph@breatheoutbreathe.in,  68317@debbugs.gnu.org
>>> Date: Tue, 09 Jan 2024 20:19:15 +0000
>>>
>>> Eli Zaretskii <eliz@gnu.org> writes:
>>>
>>> >> From: Philip Kaludercic <philipk@posteo.net>
>>> >> Cc: Joseph Turner <joseph@breatheoutbreathe.in>,  68317@debbugs.gnu.org
>>> >> Date: Tue, 09 Jan 2024 19:25:44 +0000
>>> >>
>>> >> Eli Zaretskii <eliz@gnu.org> writes:
>>> >>
>>> >> >> version-to-list: Invalid version syntax: ‘c99367ebc2f0afe0baaf2f5e5ca1ad9d62ba6e21’ (must start with a number)
>>> >> >
>>> >> > Sounds like package-vc-commit should be modified to produce a valid
>>> >> > version string (which SHA1 is not)?  Philip?
>>> >>
>>> >> 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:
>>
>> Looks safe enough, thanks.
>
> With this solution, when sorting by version, packages at version 0.0.0
> are interleaved with packages whose version string is a hash, such as:
>
>   breadcrumb                     c99367ebc2f0afe0baaf2f5e5ca1ad9d62ba6e21 source                No description available.
>   chordpro-mode                  a63fc0b7181299befc4496cba04e0f84d5953000 source                No description available.
>   consult-emms                   407edec0f2a997e32cb1bbeff811f73b6fac42ac source                No description available.
>   denote                         5e9b6b3bf0a81e00b0db0071f0c06a889f7e4a71 source                No description available.
>   disable-mouse                  0.0.0          external              Disable mouse commands globally
>   emacsql                        0.0.0          external              High-level SQL database front-end
>   hl-todo                        0.0.0          external              Highlight TODO and similar keywords
>   hyperdrive                     2930992446f508a7716b1e52a6aaf824d3f152d9 source                No description available.
>   jabber                         6900d9e085bbb2ef35b731c661fe54fa88422d6a source                No description available.
>   ledger-mode                    0.0.0          external              Helper code for use with the "ledger" command-line tool
>   lisp                           unknown        source                No description available.
>   macrostep                      0.0.0          external              Interactive macro expander
>
> While this is a little bit awkward, it's certainly better than an error.
>
> Thank you for the quick fix!

I agree it is not ideal, I can take a look at it again after emacs-29 is
cut.  But for now I'll mark the bug report as resolved.

> Joseph





^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#68317: Can't sort *Packages* buffer by version after installing with package-vc
  2024-01-10  8:28             ` Philip Kaludercic
@ 2024-01-10  9:06               ` Stefan Kangas
  2024-01-10 19:10                 ` Philip Kaludercic
  0 siblings, 1 reply; 11+ messages in thread
From: Stefan Kangas @ 2024-01-10  9:06 UTC (permalink / raw)
  To: Philip Kaludercic, Joseph Turner; +Cc: Eli Zaretskii, 68317

Philip Kaludercic <philipk@posteo.net> writes:

> I agree it is not ideal, I can take a look at it again after emacs-29 is
> cut.  But for now I'll mark the bug report as resolved.

Shouldn't we rather leave the bug open with the tag "fixed" in that case?

According to https://debbugs.gnu.org/Developer.html

    fixed: This bug is fixed or worked around, but there's still an
               issue that needs to be resolved.





^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#68317: Can't sort *Packages* buffer by version after installing with package-vc
  2024-01-10  5:16           ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2024-01-10  8:28             ` Philip Kaludercic
@ 2024-01-10 13:13             ` Eli Zaretskii
  1 sibling, 0 replies; 11+ messages in thread
From: Eli Zaretskii @ 2024-01-10 13:13 UTC (permalink / raw)
  To: Joseph Turner; +Cc: philipk, 68317

> From: Joseph Turner <joseph@breatheoutbreathe.in>
> Cc: Philip Kaludercic <philipk@posteo.net>, 68317@debbugs.gnu.org
> Date: Tue, 09 Jan 2024 21:16:06 -0800
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> With this solution, when sorting by version, packages at version 0.0.0
> are interleaved with packages whose version string is a hash, such as:

We could produce a version of 0.0-git, in which case all those
packages that have a hash as the version will be sorted together.





^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#68317: Can't sort *Packages* buffer by version after installing with package-vc
  2024-01-10  9:06               ` Stefan Kangas
@ 2024-01-10 19:10                 ` Philip Kaludercic
  0 siblings, 0 replies; 11+ messages in thread
From: Philip Kaludercic @ 2024-01-10 19:10 UTC (permalink / raw)
  To: Stefan Kangas; +Cc: Eli Zaretskii, 68317, Joseph Turner

Stefan Kangas <stefankangas@gmail.com> writes:

> Philip Kaludercic <philipk@posteo.net> writes:
>
>> I agree it is not ideal, I can take a look at it again after emacs-29 is
>> cut.  But for now I'll mark the bug report as resolved.
>
> Shouldn't we rather leave the bug open with the tag "fixed" in that case?
>
> According to https://debbugs.gnu.org/Developer.html
>
>     fixed: This bug is fixed or worked around, but there's still an
>                issue that needs to be resolved.

I have tried to adjust the status, but never having done so, I am not
sure if I have succeeded.





^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2024-01-10 19:10 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-08  8:59 bug#68317: Can't sort *Packages* buffer by version after installing with package-vc Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-01-08 13:03 ` Eli Zaretskii
2024-01-09 19:25   ` Philip Kaludercic
2024-01-09 19:53     ` Eli Zaretskii
2024-01-09 20:19       ` Philip Kaludercic
2024-01-10  3:27         ` Eli Zaretskii
2024-01-10  5:16           ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-01-10  8:28             ` Philip Kaludercic
2024-01-10  9:06               ` Stefan Kangas
2024-01-10 19:10                 ` Philip Kaludercic
2024-01-10 13:13             ` Eli Zaretskii

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.