bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#53362: 29.0.50; [PATCH] Make Completions sorting a user option


From: Protesilaos Stavrou
Subject: bug#53362: 29.0.50; [PATCH] Make Completions sorting a user option
Date: Wed, 19 Jan 2022 15:17:13 +0200
User-agent: Notmuch/0.34.2 (https://notmuchmail.org) Emacs/29.0.50 (x86_64-pc-linux-gnu)

On 2022-01-19, 14:56 +0200, Eli Zaretskii <eliz@gnu.org> wrote:

>> From: Protesilaos Stavrou <info@protesilaos.com>
>> Date: Wed, 19 Jan 2022 14:26:47 +0200
>> 
>> +(defcustom completions-sort 'lexicographic
>> +  "Sort candidates in the *Completions* buffer.
>> +
>> +The value can be nil to disable sorting altogether,
>> +`alphabetical' for alphabetical sorting, `lexicographic' for
>> +lexicographic sorting
>
> Here you expect everyone to understand the subtle difference between
> these two sorting orders.  I don't think this expectation is
> reasonable.

Perhaps it is better to reference string-lessp and string-version-lessp
directly?

>> +                                            ('alphabetical (sort 
>> completions #'string-version-lessp))
>
> Doesn't string-version-lessp do stuff that is only appropriate with
> version numbers like 1.2.3beta?

It also helps when the string starts with a number:

    (sort '("1 test" "21 test" "11 test" "2 test") #'string-lessp)
    ;; => ("1 test" "11 test" "2 test" "21 test")

    (sort '("1 test" "21 test" "11 test" "2 test") #'string-version-lessp)
    ;; => ("1 test" "2 test" "11 test" "21 test")


-- 
Protesilaos Stavrou
https://protesilaos.com





reply via email to

[Prev in Thread] Current Thread [Next in Thread]