Subject: Re: bug#41706: 26.1; sort-subr predicate cannot be set successfully

From: Michael Heerdegen <[email-masked]>
Date: Wed, 10 Jun 2020 20:59:30 +0200

Eli Zaretskii <[email-masked]> writes:

> > This is the sentence that misled the OP I think.  Could we be more
> > precise and tell that the key is actually the cons cell (BEG . END)
> > denoting these strings?
>
> Patches welcome.

Something like this (maybe enhanced using better English):

diff --git a/lisp/sort.el b/lisp/sort.el
index de0e1b9519..a87f33eaee 100644
--- a/lisp/sort.el
+++ b/lisp/sort.el
@@ -67,11 +67,12 @@ sort-subr
 ENDRECFUN is called with point within the record.
 It should move point to the end of the record.

-STARTKEYFUN moves from the start of the record to the start of the key.
-It may return either a non-nil value to be used as the key, or
-else the key is the substring between the values of point after
-STARTKEYFUN and ENDKEYFUN are called.  If STARTKEYFUN is nil, the key
-starts at the beginning of the record.
+STARTKEYFUN moves from the start of the record to the start of
+the key.  It may return either a non-nil value to be used as the
+key, or else the key is a cons (BEG . END) designating the
+substring of the record between the values of point after
+STARTKEYFUN and ENDKEYFUN are called.  If STARTKEYFUN is nil, the
+key starts at the beginning of the record.

 ENDKEYFUN moves from the start of the sort key to the end of the sort key.
 ENDKEYFUN may be nil if STARTKEYFUN returns a value or if it would be the

Then the doc should already list all possible key formats AFAIU.

BTW, what about the suggestion to support collation order out of the
box?

Thanks,

Michael.