From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Michael Heerdegen Newsgroups: gmane.emacs.bugs Subject: bug#41706: 26.1; sort-subr predicate cannot be set successfully Date: Thu, 11 Jun 2020 15:59:39 +0200 Message-ID: <87pna5put0.fsf@web.de> References: <20200604110922.GA9116@atlantis> <87pnafxc7e.fsf@web.de> <20200604190526.GA14104@atlantis> <83d06dc3po.fsf@gnu.org> <87h7vpg85k.fsf@web.de> <83a71hbuvo.fsf@gnu.org> <874kriiw6l.fsf@web.de> <83k10e68nu.fsf@gnu.org> <87tuzhpxsd.fsf@web.de> <838sgt67rk.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="126700"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: 41706@debbugs.gnu.org, post+ebugs@guelker.eu To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jun 11 16:03:05 2020 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 1jjNnN-000WpD-Eh for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 11 Jun 2020 16:03:05 +0200 Original-Received: from localhost ([::1]:33714 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jjNnM-00050v-7A for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 11 Jun 2020 10:03:04 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52008) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jjNkR-0002hQ-D0 for bug-gnu-emacs@gnu.org; Thu, 11 Jun 2020 10:00:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:54302) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jjNkQ-0002CH-LH for bug-gnu-emacs@gnu.org; Thu, 11 Jun 2020 10:00:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jjNkQ-0003An-H9 for bug-gnu-emacs@gnu.org; Thu, 11 Jun 2020 10:00:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Michael Heerdegen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 11 Jun 2020 14:00:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 41706 X-GNU-PR-Package: emacs Original-Received: via spool by 41706-submit@debbugs.gnu.org id=B41706.159188398912145 (code B ref 41706); Thu, 11 Jun 2020 14:00:02 +0000 Original-Received: (at 41706) by debbugs.gnu.org; 11 Jun 2020 13:59:49 +0000 Original-Received: from localhost ([127.0.0.1]:37615 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jjNkD-00039p-1O for submit@debbugs.gnu.org; Thu, 11 Jun 2020 09:59:49 -0400 Original-Received: from mout.web.de ([217.72.192.78]:39385) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jjNkB-00039c-AH for 41706@debbugs.gnu.org; Thu, 11 Jun 2020 09:59:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=dbaedf251592; t=1591883980; bh=2acCui4RdAcw6+PicD1kBahznAUAy+9UlhTXlS/pFDg=; h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date:In-Reply-To; b=MM8cdRmzJ2z6DSEKFZPWTGjFD0D37/k33SQ+Y6aq7lcNP7oZcJjIlt4xlv0v8xRhJ NAn4XrG0jXuKYv4xnZM8N9q+woU3vUStwspP5ZquvRzr+hbw3dNL8YQ1lSTSEQayUA ekdPQuxb+1/RLMW+BVQYx7WJtZsDTfe3vOz/wb/8= X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 Original-Received: from drachen.dragon ([94.217.119.187]) by smtp.web.de (mrweb106 [213.165.67.124]) with ESMTPSA (Nemesis) id 1MHEbq-1jevm82QSG-00DMaX; Thu, 11 Jun 2020 15:59:40 +0200 In-Reply-To: <838sgt67rk.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 11 Jun 2020 16:39:59 +0300") X-Provags-ID: V03:K1:7G1KLpy4gH8X+oPMR+nW2B+UApfPeKYLvDEiX5ewe8GR9AZ/NyY +MhD7TmvF+o3UCcr++jrapn6tC5+z81nnc19UG3zys1MmbxYOPqq0hlqq1AvFxjA5orIKGP NrXPg6e95n7EtM8v3bm2KrRIMs+Jtp9pgh4etB0b4DUPWrCO+N6pB2+v+pjZOz+ixmzDrsZ 99LEuAnZ+siMCQIy13N5Q== X-UI-Out-Filterresults: notjunk:1;V03:K0:sqMDV+PkABA=:jY4H7ZfatBzSbNFT78KKtT DjTPQBJJj1QEbdJ4N4qHmTSeE+vTxsHEUPZJOR3pOaBFVcBj6CdkNN0R48Y+HEIZGWfDrFTQm WnupXxW2PxKssbdTKQrk96pgOhPt2T3/N/axjJTlVKKH+ykccAQRzhCToR+/qAmuwtPULwfMu W9c8nn7UdI0ld15bsSWY04kpOlceYeF7n79GxvJxpB4AYv6V8kH9gRELsC17BzgzOL0QXv+pS c6DidHHFiRHP2GERIMztW9cKOUhzRDuzqXGyW5g0OXsUxjG+K1WRqGz6NveywtbK/3vhtiWz3 IZ5xh/Tj+vHqXvv3K667X+pjpGt0sWhV4me8wu7nWhJjQoeOwOOmyVf1c2gcEQtTh6tmTjPKd ZpIEMEFbliQD6jSdcrOkd5YzBnjN7eofelXrVjDFWJVjBFqETxVn0q1HGLtM2sWDT/gmDZ6mC maqm7a/XxRQhnoNdR111+qdh8N38YRxNfsnROVNDERSG4YvgFnHxb54G3S/Hrf5Sknq5f64Sm Cf2PneZu/tBBRj6ECX43mkU6fUT11glG0clr/yUafkK8zSdhCe7p5GDFi2O0p1TYlOjjdRK/I b7FwM7PIn2v4QR2ttX3ImJIuqdOr2f45mPqsDvaFqiVWJXRDkf8dRX0H+XousPWqfPrvq1ulk 6ZWJ95a6V9n2nZFbxxDNQfjKP9bwK7gz3mnpgxx+c3O4Xew3Qu2Kdf+/R/PEsdw9MDcOVLdJx cBbFXZkhT41Z0Az00kCYc56pZf4kfkP/py3dJK3fbu74H8aS0Hrwi9RfNKy6hnDt6iYUZW/f 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" Xref: news.gmane.io gmane.emacs.bugs:181854 Archived-At: Eli Zaretskii writes: > > +second key. The key values PREDICATE is called with are the > > +either the return values of STARTKEYFUN when that function is > > +specified and returns a non-nil value. > > The last sentence is incomplete and/or needs some fixing, AFAICT. If you mean something else than in you subsequent comment, please elaborate. > > In any other case the keys > > +are cons cells of the form (BEG . END), where BEG is the value of > > +point after calling STARTKEYFUN when given, else after calling > > +ENDRECFUN, and END is the value of point after calling ENDKEYFUN when > > +given, and after calling ENDRECFUN else. > > This seems to contradict the following part, which seems to say that > the key arguments are not always cons cells: > > > +If PREDICATE is nil, comparison is done with `<' if > > the keys are numbers, with `compare-buffer-substrings' if the > > keys are cons cells (the car and cdr of each cons cell are taken > > as start and end positions), and with `string<' otherwise." > > Am I missing something? Not really. AFAIU the only case where this applies is when STARTKEYFUN is specified and returns values of this type - else `sort-build-lists' always generates conses. The different defaults of PREDICATE depending on some types of STARTKEYFUN seem to be predefined just for convenience. > > What I also would like to add to the docstring of this function, and of > > that of `sort', is that the PREDICATE must be transitive and > > antisymmetric - mentioning only in the manual is not enough IMHO. > > Fine with me, provided that you explain what those two attributes > mean. Is it enough to relegate to the manual? > The main problem with collation is that it's locale-specific, and > different C libraries implement collation for the same locale in > slightly different ways. The result is that the sorted text may not > be the same even if you do that on two systems in the same locale. > How would you suggest to solve this issue? I have no clue. Is this a general requirement? For `sort-subr' I think the requirement is not so much absolute reproducibility (sorry if that word doesn't exist) but that it is able to sort lexicographically in a reasonably sensible way. Michael.