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 16:50:03 -0400 Message-ID: <90da1348-eff5-853f-8258-d78c49c71593@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> <84be9f87-15ac-f501-13ba-5ce0372332ac@gmail.com> <83imhn7at9.fsf@gnu.org> <949b79b9-0009-6f36-7d6d-8be895d2cf19@gmail.com> <83h7x779iw.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="40901"; 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 22:51:10 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 1jSRlW-000AVX-Pd for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 25 Apr 2020 22:51:10 +0200 Original-Received: from localhost ([::1]:47338 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jSRlV-0003vd-GA for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 25 Apr 2020 16:51:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48050) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jSRlO-0003vU-SB for bug-gnu-emacs@gnu.org; Sat, 25 Apr 2020 16:51:03 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jSRlO-0005nT-DE for bug-gnu-emacs@gnu.org; Sat, 25 Apr 2020 16:51:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:48914) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jSRlN-0005nJ-VG for bug-gnu-emacs@gnu.org; Sat, 25 Apr 2020 16:51:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jSRlN-0006ur-Tk for bug-gnu-emacs@gnu.org; Sat, 25 Apr 2020 16:51: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 20:51: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.158784781326521 (code B ref 40821); Sat, 25 Apr 2020 20:51:01 +0000 Original-Received: (at 40821) by debbugs.gnu.org; 25 Apr 2020 20:50:13 +0000 Original-Received: from localhost ([127.0.0.1]:60460 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jSRkb-0006th-H3 for submit@debbugs.gnu.org; Sat, 25 Apr 2020 16:50:13 -0400 Original-Received: from mail-qt1-f177.google.com ([209.85.160.177]:43099) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jSRkZ-0006tR-Jl for 40821@debbugs.gnu.org; Sat, 25 Apr 2020 16:50:11 -0400 Original-Received: by mail-qt1-f177.google.com with SMTP id z90so11022434qtd.10 for <40821@debbugs.gnu.org>; Sat, 25 Apr 2020 13:50:11 -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=o05ddLv0V5vlWkRyGVyvIJ4Q8HtQCmyimS1VtanbIxs=; b=grLfxdKDUSBaso/0B0/LwN0ki5zkcHFgwiEzyk8ItHM60tzvc+G+WC5ugQaYB2anuE 8mE1QloukDsY9HA7Dj7X5ekKjI0RYNLg1lxg7n5GIVpauRAg7f9rsvdEyPv1SvXbmv4w Hv7Sc9/5iC/SY9wvPGzZ1/o8X8gFQUdCBW238vpCamrIWI/1999EFg3CNI7w+2ouap+f 2Q+a0Pr3b02CleDrlsyjAKT10hU/Kmjgn1C/AZMsCe7XSW40XsjGUGt3vg/QjkosrKKS GbS7B3ilM68IMV9EThCmPw0aSR8vCvFDm78QJHHIERsrBq6aN2If8DI58Rdahb0N0/CD pOVQ== 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=o05ddLv0V5vlWkRyGVyvIJ4Q8HtQCmyimS1VtanbIxs=; b=g+5/tBxps+qwlIDTbt1SupzOmV1faJLBZyj2Xj9sixNegSzQy9fsPO3/Os+yNGuP+Q wzs7NDNnpFGf6sCiEdUPdno3ypsSTY+QpGs5AT5u8ai2qKcnR5S4FmhD3sy2Ui2vQak/ TER9NeMiGG1fv2ww12Rm8aYwvLO04Qg05yIgmseWx10iOZLthaICxLdi90HuVQltNzKH cFlDCjnfLUmn2Tf4l+gmRTsr4WGu1iowt394AqvOpqYTlWKeIvaxw7H8f7X+URUhJYix ItY3xJVyiRlMbBAdJpxRRUhAnpXTbH7naQVI09LhC3AwCVyIg0LemcbIEr6Xdn+9Uq/d bLKQ== X-Gm-Message-State: AGi0Puax/cvlLUlCRKsVidHcRBjIKViEnfCdqjjfyXM01wSlGEly9NFR eDFPLYYIY5sJPVTt8c4GgTbpVlRfM04= X-Google-Smtp-Source: APiQypL5Yynfg2s53ir2vCuwzOScZQbsrz6eOvH5bsI4uBgR7aOUs8hK768r2GvoHPVZ4vJvIjr7xQ== X-Received: by 2002:aed:3b0b:: with SMTP id p11mr15996777qte.109.1587847805072; Sat, 25 Apr 2020 13:50:05 -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 d4sm6437020qtw.25.2020.04.25.13.50.04 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 25 Apr 2020 13:50:04 -0700 (PDT) In-Reply-To: <83h7x779iw.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:179034 Archived-At: On 25/04/2020 13.36, Eli Zaretskii wrote: >> Cc: 40821@debbugs.gnu.org >> From: Clément Pit-Claudel >> Date: Sat, 25 Apr 2020 13:21:13 -0400 >> >>> Yes, but is it reasonable to ask the display engine to figure that out >>> for you? You are talking about something that is clearly application >>> logic; other applications might want some other logic to have other >>> overlays "win". >> >> I think it is reasonable: we already have a notion of overlays "winning", namely their priority. > > But you want to change that, based I don't really understand on what? I think we're getting too closely attached to a specific use case. There's a simple problem with the margins: you put two overlays on one line, they both have margin specs, they both have faces with a foreground. One is priority 100, the other 0. The margin is 1-character wide. Then you see just one thing in the margin: the spec from the low-priority overlay. And you see one face in the buffer: the one from the high priority overlay. I'm saying it doesn't make much sense. Same for the fringes. Of course, it's not specified, so nowhere have committed to this broken behavior or to any other beahvior at this point. But that doesn't make it less broken: the one mechanism we have for determining which overlay wins (priorities) applies in reverse for the fringes and the margins. Maybe what we need is a more general mechanism for deciding which spec wins, if you don't think priority is the right one. > I can only reiterate my suggestion: don't rely on the display engine > to solve the problems in such cases. The best solution is for the > Lisp program to apply its logic and put only the overlays it needs. > … > We shouldn't complicate it more where Lisp programs > which create the overlays can DTRT instead. Then TRT sounds a lot like reimplementing a part of the display engine in ELisp: iterating over overlays on each line, sorting them by priority, taking their margin specs and fringes, determining the highest priority one, and displaying that in the margin/fringe, for each modified line, after each command. And ideally, doing that lazily too, to avoid doing work on the whole buffer at once and slowing editing down. Isn't that the job description of the display engine? Thanks for your help, Clément.