On Sat, 22 May 2021 at 10:51, David Bremner <
david@tethera.net> wrote:
>
> Salman Mohammadi <
salman@smoha.org> writes:
>
> > the command `apt-utils-search` does not sort the numbers based on integer value
> > from smallest to largest.
> >
> > How to reproduce:
> > -----------------
> > 1. M-x apt-utils-search
> > 2. Search packages for regexp: google-android-platform
>
> Since the function does not promise any particular order, and the order
> matches "apt search" on the command line, this seems more like a request
> for an enhancement. I guess sorting by version might be possible,
> although not trivial due to versions being complicated. Sorting by some
> number embedded in the package name sounds messy.
Salman, are you asking for a natural short, like piping a newline separated list to "sort -V" would provide? I think this is what you're asking for.
David, AFAIK Emacs doesn't yet provide a natural sort algorithm, but is there any reason why it wouldn't be a good idea to pass the data to "sort -V" before outputting to the *APT package info* buffer? I guess there's also the question of if a non-interactive call to apt-utils-search should return a natural sorted list...
But isn't the big question: If a user-friendly natural sorted list is a reasonable expectation, shouldn't "apt (and aptitude) search" do this directly? Better to fix it there, rather than in a way specific to debian-el, no?
Cheers,
Nicholas