all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: joaotavora@gmail.com (João Távora)
Cc: 28390@debbugs.gnu.org, monnier@iro.umontreal.ca
Subject: bug#28390: 26.0.50; overlays-at actually sorts by increating priority
Date: Fri, 08 Sep 2017 12:47:02 +0300	[thread overview]
Message-ID: <83lglpy12h.fsf@gnu.org> (raw)
In-Reply-To: <87r2vhin47.fsf@lolita> (joaotavora@gmail.com)

> 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 <eliz@gnu.org> 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.





  reply	other threads:[~2017-09-08  9:47 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-07 22:21 bug#28390: 26.0.50; overlays-at actually sorts by increating priority João Távora
2017-09-08  8:39 ` Eli Zaretskii
2017-09-08  8:57   ` João Távora
2017-09-08  9:47     ` Eli Zaretskii [this message]
     [not found]       ` <CALDnm5103cjV6TNKiGiaVEcJRLMfnM+wCuW3LrySh8dEur7uwg@mail.gmail.com>
2017-09-08 19:30         ` bug#28390: Fwd: " João Távora
2017-09-10 13:53   ` Stefan Monnier
2017-09-16 10:04     ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83lglpy12h.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=28390@debbugs.gnu.org \
    --cc=joaotavora@gmail.com \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.