From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: =?UTF-8?Q?Cl=C3=A9ment?= Pit-Claudel Newsgroups: gmane.emacs.bugs 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 Message-ID: <84be9f87-15ac-f501-13ba-5ce0372332ac@gmail.com> References: <33007735-30b9-4c52-c440-929686e1cb0e@gmail.com> <83o8rg809k.fsf@gnu.org> <5da7af4f-0f8c-c79c-38d7-ed7465d9b34d@gmail.com> <83sggr7jbf.fsf@gnu.org> 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="96283"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 Cc: 40821@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Apr 25 18:53:12 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 1jSO3C-000Ou2-Qi for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 25 Apr 2020 18:53:10 +0200 Original-Received: from localhost ([::1]:40852 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jSO3B-00053j-Fb for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 25 Apr 2020 12:53:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:35866) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jSO34-00053N-T2 for bug-gnu-emacs@gnu.org; Sat, 25 Apr 2020 12:53:03 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jSO34-0008HS-CF for bug-gnu-emacs@gnu.org; Sat, 25 Apr 2020 12:53:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:48721) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jSO34-0008FN-0A for bug-gnu-emacs@gnu.org; Sat, 25 Apr 2020 12:53:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jSO33-0007WT-Us for bug-gnu-emacs@gnu.org; Sat, 25 Apr 2020 12:53:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: =?UTF-8?Q?Cl=C3=A9ment?= Pit-Claudel Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 25 Apr 2020 16:53:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 40821 X-GNU-PR-Package: emacs Original-Received: via spool by 40821-submit@debbugs.gnu.org id=B40821.158783352328849 (code B ref 40821); Sat, 25 Apr 2020 16:53:01 +0000 Original-Received: (at 40821) by debbugs.gnu.org; 25 Apr 2020 16:52:03 +0000 Original-Received: from localhost ([127.0.0.1]:60267 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jSO26-0007VE-Ky for submit@debbugs.gnu.org; Sat, 25 Apr 2020 12:52:02 -0400 Original-Received: from mail-qv1-f46.google.com ([209.85.219.46]:41966) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jSO24-0007Uk-S6 for 40821@debbugs.gnu.org; Sat, 25 Apr 2020 12:52:01 -0400 Original-Received: by mail-qv1-f46.google.com with SMTP id h6so6308986qvz.8 for <40821@debbugs.gnu.org>; Sat, 25 Apr 2020 09:52:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=9fJwP1a95y4YlfnJaE2ZagkMQPgNo9DXBY6lT0JF/U8=; b=G40dKsQz639/VoLaAdBUwsbfd1+ZSAJCwSQzGL4jzbk77L3SoM6nWtVYe5uTGbIIkM 4kNAAqt3Q4YeQ3zCDZTn1qinXRa+j+W52DqMNBocjqvil11H6Xv1/NhqdTbqeOybOpFC yADRVw7FUUIJ9Q6s+A/inTDI8u0nwOcAI+5O20Ro0KYfjtcdVzLGpoDTW/8YZiq41dwZ UtzZVe8ZF1AO03HZ2KgcRc9Q1y35u2gKdNoj6Wslyq22BQIhT04HmJszlL3p3btyyVu6 pl8u22GPgIxYcrufepgLrC5bTnz3BGmecQs4ohq7EQLGOzecM3c0pJK2n0EVJvY8S4kg 7FYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=9fJwP1a95y4YlfnJaE2ZagkMQPgNo9DXBY6lT0JF/U8=; b=SPHIPFsXJt6uYX5TNx+AfXs6vYrYSY2bgwuLjRig4vqTsPA9pBs85wvt5CPUogp1E5 L46LRAbN8VoBQyUJnQjbaM3Ar0UJHabRhNk6peWDZjgC2qBM15/Vimhe1cHTrinmbx46 zBhMrbUXmxwHro87iBXJP/nXDX6F1Z6ekOPPJPa0tqVhQnpmHShEn8DrXCW7w/qrBSOo x4xTaXk/HQpja3pv6WcgkFW/L4RsaPUiAmgGf80vNgJkKmtlMLirS5erf3q2AfI8/aYB PdN1+O2bfo5x7O2nJvuEZnxyWuIwkzNzm/E4PEI8ZbJ1XZmalOgSgTG0hZpLjW+D+q0X EKYA== X-Gm-Message-State: AGi0PuZg9uWvRnRxtelMT9O/B5n4CnnSCWgpkelRfsvloJ5ArfEE+DV8 PkKqzmhsCrsGM6+2268ydEy6/37YR50= X-Google-Smtp-Source: APiQypJoCqy+hfdLyxuYTRApy7bM7IwfB+cSvueq8+hXkZ340HXjYkND9MoSit1nCbnTU9AQQj/nDg== X-Received: by 2002:a0c:e8c2:: with SMTP id m2mr14041772qvo.24.1587833514946; Sat, 25 Apr 2020 09:51:54 -0700 (PDT) Original-Received: from ?IPv6:2601:184:4180:66e7:54d6:bfeb:aa49:9d3b? ([2601:184:4180:66e7:54d6:bfeb:aa49:9d3b]) by smtp.googlemail.com with ESMTPSA id b19sm6196127qkg.72.2020.04.25.09.51.53 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 25 Apr 2020 09:51:54 -0700 (PDT) In-Reply-To: <83sggr7jbf.fsf@gnu.org> Content-Language: en-GB X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Received-From: 209.51.188.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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:179014 Archived-At: 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.