From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#28390: 26.0.50; overlays-at actually sorts by increating priority Date: Fri, 08 Sep 2017 12:47:02 +0300 Message-ID: <83lglpy12h.fsf@gnu.org> References: <871snijgkk.fsf@lolita> <83tw0dy468.fsf@gnu.org> <87r2vhin47.fsf@lolita> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1504864172 24141 195.159.176.226 (8 Sep 2017 09:49:32 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 8 Sep 2017 09:49:32 +0000 (UTC) Cc: 28390@debbugs.gnu.org, monnier@iro.umontreal.ca To: joaotavora@gmail.com (=?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?=) Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Sep 08 11:49:18 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dqFuV-0005NP-C5 for geb-bug-gnu-emacs@m.gmane.org; Fri, 08 Sep 2017 11:49:15 +0200 Original-Received: from localhost ([::1]:44217 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dqFuZ-0005Az-Bm for geb-bug-gnu-emacs@m.gmane.org; Fri, 08 Sep 2017 05:49:19 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39154) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dqFtP-0004RC-Ck for bug-gnu-emacs@gnu.org; Fri, 08 Sep 2017 05:48:12 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dqFtK-0005Ca-MG for bug-gnu-emacs@gnu.org; Fri, 08 Sep 2017 05:48:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:46643) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dqFtK-0005CO-II for bug-gnu-emacs@gnu.org; Fri, 08 Sep 2017 05:48:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dqFtK-0003b9-7W for bug-gnu-emacs@gnu.org; Fri, 08 Sep 2017 05:48:02 -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, 08 Sep 2017 09:48:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 28390 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 28390-submit@debbugs.gnu.org id=B28390.150486403913780 (code B ref 28390); Fri, 08 Sep 2017 09:48:02 +0000 Original-Received: (at 28390) by debbugs.gnu.org; 8 Sep 2017 09:47:19 +0000 Original-Received: from localhost ([127.0.0.1]:55324 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dqFsc-0003aC-Ps for submit@debbugs.gnu.org; Fri, 08 Sep 2017 05:47:19 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:47972) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dqFsb-0003a0-BL for 28390@debbugs.gnu.org; Fri, 08 Sep 2017 05:47:17 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dqFsR-0004AM-Dz for 28390@debbugs.gnu.org; Fri, 08 Sep 2017 05:47:12 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:48851) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dqFsH-0003qg-5n; Fri, 08 Sep 2017 05:46:57 -0400 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:3345 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1dqFsG-0001cB-H0; Fri, 08 Sep 2017 05:46:57 -0400 In-reply-to: <87r2vhin47.fsf@lolita> (joaotavora@gmail.com) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:136681 Archived-At: > From: joaotavora@gmail.com (João Távora) > Cc: 28390@debbugs.gnu.org, monnier@iro.umontreal.ca > Date: Fri, 08 Sep 2017 09:57:28 +0100 > > Eli Zaretskii writes: > > > I think the doc string says what the implementation was supposed to > > do, so we need to change the implementation instead. > > Really? Won't that ripple very paintuflly across the elisp ecosphere? I don't think so. I believe this optional argument is used very rarely. > > If you look at the changeset where the SORTED argument was introduced, > > you will see that the old code sorted the list returned by overlays-at > > in descending order of priorities, i.e. overlays with the largest > > priority first. It used 'sort' like this: > > > > (sort (mapcar #'overlay-properties (overlays-at p)) > > (lambda (A B) (> (or (cadr (memq 'priority A)) 0) > > (or (cadr (memq 'priority B)) 0))))) > > I don't follow, where is the code that did this, or is this just an > illustration? This is the code which was replaced when overlays-at got its optional argument in that Stefan's change. > > The doc string of 'sort' says that its PREDICATE function should > > return non-nil if the first element passed to PREDICATE should sort > > _before_ the second. And the predicate above uses '>'. > > But where was sort() ever used before Stefan's 2014 change? Did > overlays-at make any sort guarantee back then? Look at the changeset of commit 20fa59a0, you will see that the uses if 'sort' were replaced with calls to overlays-at with the new optional argument. > I do agree that it should sort the other way, though. But it's too late > for that, bugs will be features :-). I'm not sure it's too late.