From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#41706: 26.1; sort-subr predicate cannot be set successfully Date: Fri, 05 Jun 2020 11:32:51 +0300 Message-ID: <83d06dc3po.fsf@gnu.org> References: <20200604110922.GA9116@atlantis> <87pnafxc7e.fsf@web.de> <20200604190526.GA14104@atlantis> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="77004"; mail-complaints-to="usenet@ciao.gmane.io" Cc: michael_heerdegen@web.de, 41706@debbugs.gnu.org To: Marvin =?UTF-8?Q?G=C3=BClker?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Jun 05 10:34:09 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 1jh7nl-000Jwt-RU for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 05 Jun 2020 10:34:09 +0200 Original-Received: from localhost ([::1]:34784 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jh7nk-0002bt-TJ for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 05 Jun 2020 04:34:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33700) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jh7ne-0002ah-2M for bug-gnu-emacs@gnu.org; Fri, 05 Jun 2020 04:34:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:36713) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jh7nd-0000EM-PR for bug-gnu-emacs@gnu.org; Fri, 05 Jun 2020 04:34:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jh7nd-0002iZ-Mt for bug-gnu-emacs@gnu.org; Fri, 05 Jun 2020 04:34:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 05 Jun 2020 08:34:01 +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.159134599110393 (code B ref 41706); Fri, 05 Jun 2020 08:34:01 +0000 Original-Received: (at 41706) by debbugs.gnu.org; 5 Jun 2020 08:33:11 +0000 Original-Received: from localhost ([127.0.0.1]:48259 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jh7mp-0002hZ-5X for submit@debbugs.gnu.org; Fri, 05 Jun 2020 04:33:11 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:48948) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jh7mn-0002hM-TP for 41706@debbugs.gnu.org; Fri, 05 Jun 2020 04:33:10 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:48906) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jh7mh-00008r-ET; Fri, 05 Jun 2020 04:33:03 -0400 Original-Received: from [176.228.60.248] (port=2913 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jh7mg-0008S6-6J; Fri, 05 Jun 2020 04:33:03 -0400 In-Reply-To: <20200604190526.GA14104@atlantis> (message from Marvin =?UTF-8?Q?G=C3=BClker?= on Thu, 4 Jun 2020 21:05:26 +0200) 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:181541 Archived-At: > Date: Thu, 4 Jun 2020 21:05:26 +0200 > From: Marvin Gülker > Cc: 41706@debbugs.gnu.org > > >To understand how ‘sort-subr’ works, consider the whole accessible > >portion of the buffer as being divided into disjoint pieces called > >“sort records”. The records may or may not be contiguous, but they > >must not overlap. A portion of each sort record (perhaps all of > >it) is designated as the sort key. [...] > >The argument PREDICATE is the function to use to compare keys. If > >keys are numbers, it defaults to ‘<’; otherwise it defaults to > >string<’. > > No further mention of how to use PREDICATE is made, and the manual > continues with reproducing the source code of `sort-lines'. I took that > section to mean that the PREDICATE is in the default case `<' and > with strings `string<'. From the manual's text it became not clear to me > under which condition the keys are not strings, and I assumed they will > normally always be strings as buffer substrings are always strings. > > Now I see that the documentation for the `sort-subr' function is a > little more specific, but still it doesn't really make clear which kind > of "key" is received as arguments in the PREDICATE under which > conditions. The call above appearently yields cons cell keys whose CAR > and CDR correspond to buffer positions, but the documentation makes me > suspect that calling `sort-subr' differently will yield other kinds of > keys. > > I would suggest to amend the manual to be more precise about the > arguments that PREDICATE receives, and perhaps add an example. It is hard to be specific about the arguments to PREDICATE, because they depend on what the other arguments to sort-subr return. I augmented the manual to at least have the same information as the doc string; more detail is only possible if we discuss specific values of STARTKEYFUN and ENDKEYFUN. Thanks.