From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Tassilo Horn Newsgroups: gmane.emacs.help Subject: How to solve overlay conflict between invisible and display? Date: Wed, 17 Jul 2024 10:16:01 +0200 Message-ID: <87o76wl9ha.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="33063"; mail-complaints-to="usenet@ciao.gmane.io" To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Wed Jul 17 10:16:51 2024 Return-path: Envelope-to: geh-help-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 1sTzqF-0008RT-5F for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 17 Jul 2024 10:16:51 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sTzpd-0004R3-1D; Wed, 17 Jul 2024 04:16:13 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sTzpb-0004Jq-Ol for help-gnu-emacs@gnu.org; Wed, 17 Jul 2024 04:16:11 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sTzpb-0006gS-GF for help-gnu-emacs@gnu.org; Wed, 17 Jul 2024 04:16:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:Subject:To:From:in-reply-to: references; bh=FLXuUUBmd+WeuvRcmBurqRlP51woOv0xajT4tfFGx+Q=; b=Ri/6vN1F+tf85G LLVE3vI9uvfL0g8W1w7chMRJgzLF7HoT9mEyc4WFys47mueY1k/VJ+hCz7RtWwxb2qI9kLTHCcRSD LQfDx9shEWykV+imQa2y13xmWA3mD4mzT8pEC3cfN9JmTwcmVRTjzj7Z3/7LdAN8jz8GkuOl8O2Rh Ro1t0Yi7Cnj4+h+2/4XZbSU8CB5Yw7pxD5T/189fhZ8pbzocwjBc639V1WPIr7JZp4xYi9EDJqpYd KzoJbNDNty9yuz2XJnQ2GiWAw1r2oT3HPyA+NLyuqtf8ttByn7Yb890uqil+L1pVZnISR/kMRnwey WQxoyTZx6gZdW5cqlGzQ==; X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrgeeiucetufdoteggodetrfdotffvucfrrh hofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgenuceurghi lhhouhhtmecufedttdenucenucfjughrpefhvffufffkgggtgfesthhqredttddtjeenuc fhrhhomhepvfgrshhsihhlohcujfhorhhnuceothhsughhsehgnhhurdhorhhgqeenucgg tffrrghtthgvrhhnpedtledtteetuedvhfejkedujeffgfejleekffeijeffjeefiefhle etheeuhedvfeenucffohhmrghinhepghhithhhuhgsrdgtohhmnecuvehluhhsthgvrhfu ihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepthhhohhrnhdomhgvshhmthhprg huthhhphgvrhhsohhnrghlihhthidqkeeijeefkeejkeegqdeifeehvdelkedqthhsughh peepghhnuhdrohhrghesfhgrshhtmhgrihhlrdhfmh X-ME-Proxy: Feedback-ID: ib2b94485:Fastmail X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:147263 Archived-At: Hi all, I have a problem where two modes use overlays in a way where the result is not desirable. One mode hides complete sections of text by adding overlays with `invisible` property, the other mode alters the displayed text using overlays with `display` property. In the concrete scenario [1], the invisible-overlays always surround the overlays with display property, e.g., the latter are nested in the former. [invisible t [display foo] [display bar]...] So effectively the nested overlays have both a non-nil `invisible` property and additionally a `display` property. In that case, it seems the `display` property wins. That can be validated using this simple demo command in a buffer with text where the word foo will get an overlay with both `invisible` and `display` property: --8<---------------cut here---------------start------------->8--- (defun th/overlay-invisible-and-display-test () (interactive) (save-excursion (goto-char 1) (while (re-search-forward "foo" nil t) (let ((o (make-overlay (match-beginning 0) (match-end 0)))) (overlay-put o 'invisible t) (overlay-put o 'display "=C2=A7"))))) --8<---------------cut here---------------end--------------->8--- In my scenario, I would like that the outer invisible overlay also hides the nested display overlays. In there anything either the mode producing the outer `invisible` overlay or the mode producing the inner `display` overlay could do so that what should be invisible actually becomes invisible? I've already tried setting `display` to nil in the outer overlays and raising the priority in the howe that `display nil` then overrides `display "some string"` from the inner overlays but that doesn't seem to make any difference. Well, it sounds like common sense that invisible should win over display, or to be more clear, display should only be effective on visible overlays. So maybe that's actually a bug in emacs (current master)? Thanks, Tassilo [1] https://github.com/magit/magit/issues/5176