unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "Clément Pit-Claudel" <cpitclaudel@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 40821@debbugs.gnu.org
Subject: bug#40821: Margin strings are displayed in reverse order of overlay priority (low-priority specs hide high-priority ones)
Date: Sat, 25 Apr 2020 12:51:52 -0400	[thread overview]
Message-ID: <84be9f87-15ac-f501-13ba-5ce0372332ac@gmail.com> (raw)
In-Reply-To: <83sggr7jbf.fsf@gnu.org>

On 25/04/2020 10.04, Eli Zaretskii wrote:
>> I only want/need to display one margin indicator — the highest priority one :)
> 
> Then why not have your code do that?

It's quite complicated: every time I add a new overlay (they arrive asynchronously, not all at once), I need to check for others on the same line and adjust the symbols.  Every time the text is changed, I need to rescan the current line and adjust the overlay properties.

> It is your Lisp program that puts these overlays, isn't it?  Why
> cannot it put only one overlay, the one you want to be displayed in
> this case?

Because both are needed: for example, when the point is on ewew, the help-echo will be the concatenation of both.  Similarly, when the user browses the error list in a separate buffer, highlighting one error will light up the corresponding portion of the buffer.  Additionally, users can filter errors, hiding certain overlays.

>> I thought this would show a fringe icon in compilation-error face, because of the higher priority of the corresponding overlay.  It doesn't.
>> Should I report this as a separate issue?
> 
> Why is that an issue?  You in effect invoke undefined behavior, and
> the result is not outlandish, IMO.

It is: the buffer shows the face of one overlay and the icon of another one.

>> Widening the margin isn't a working solution for this case, but displaying the margin specs in order of increasing priority would work.  However, wouldn't that require a second pass as well?  That is, if margin specs were sorted by priority before being inserted, it would work (it wouldn't matter that there are multiple instead of one, since the most important one would be first).
> 
> Now I'm confused: the overlays are already being sorted by the display
> engine, and displayed in the order of increasing priority, as I
> explained in my original message.

The margin specs are displayed in order of decreasing priority, as far as I can tell: first the one coming from the overlay with the lowest priority, then the next one, etc.







  reply	other threads:[~2020-04-25 16:51 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-24 15:56 bug#40821: Margin strings are displayed in reverse order of overlay priority (low-priority specs hide high-priority ones) Clément Pit-Claudel
2020-04-25  7:58 ` Eli Zaretskii
2020-04-25 13:01   ` Clément Pit-Claudel
2020-04-25 14:04     ` Eli Zaretskii
2020-04-25 16:51       ` Clément Pit-Claudel [this message]
2020-04-25 17:08         ` Eli Zaretskii
2020-04-25 17:21           ` Clément Pit-Claudel
2020-04-25 17:36             ` Eli Zaretskii
2020-04-25 19:29               ` Dmitry Gutov
2020-04-25 20:50               ` Clément Pit-Claudel
2020-05-13 15:58   ` Clément Pit-Claudel
2020-05-13 16:25     ` 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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=84be9f87-15ac-f501-13ba-5ce0372332ac@gmail.com \
    --to=cpitclaudel@gmail.com \
    --cc=40821@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).