From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#58122: 28.2; overlay before/after-string does not render more than one fringe display spec Date: Wed, 28 Sep 2022 16:40:44 +0300 Message-ID: <83fsgbiplv.fsf@gnu.org> References: <55613fb3-91db-4fb0-aaa7-120888b9db10@www.fastmail.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="34304"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 58122@debbugs.gnu.org To: "Josh Caswell" Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Sep 28 15:54:56 2022 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 1odXWa-0008je-3R for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 28 Sep 2022 15:54:56 +0200 Original-Received: from localhost ([::1]:40892 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1odXWW-0004xb-Vm for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 28 Sep 2022 09:54:54 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39778) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1odXJ8-0007V2-On for bug-gnu-emacs@gnu.org; Wed, 28 Sep 2022 09:41:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:33409) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1odXJ8-000380-Eh for bug-gnu-emacs@gnu.org; Wed, 28 Sep 2022 09:41:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1odXJ8-0003xt-2B for bug-gnu-emacs@gnu.org; Wed, 28 Sep 2022 09:41:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 28 Sep 2022 13:41:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58122 X-GNU-PR-Package: emacs Original-Received: via spool by 58122-submit@debbugs.gnu.org id=B58122.166437246115231 (code B ref 58122); Wed, 28 Sep 2022 13:41:02 +0000 Original-Received: (at 58122) by debbugs.gnu.org; 28 Sep 2022 13:41:01 +0000 Original-Received: from localhost ([127.0.0.1]:60718 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1odXJ6-0003xQ-Rh for submit@debbugs.gnu.org; Wed, 28 Sep 2022 09:41:01 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:54706) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1odXJ3-0003x8-M1; Wed, 28 Sep 2022 09:40:59 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:51482) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1odXIy-00036v-Cr; Wed, 28 Sep 2022 09:40:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=NaHazQArHwDZB+IjB6gp2Q4QrEDcDck8vCNqnz3n1nA=; b=jlWiy/7PWBBc AHQwZl7YYhX52Q4auvXITXEzrjvzvtO2CavIiky4GrmpPjCmHnUqxogEnVDNKE0ZuIhelKxFcJEwI TiO5lQzomo6A7BZOBxq+nswvqfG4Oj6A36aZdWGysolvUfw+sHZ7x2NFqzax7nU72jqE/6y4uOJyI J9ateEv2XmFhsi7Obnnmxq8wVJ+bnH/dSB8zVyFNBUID28lOlnXgT6+10QuRIEj9vsotcaYsRTd5C vCmT/eihvNMKOVlhOKwW2nz3lcI9q9VSTAhlBCng9ijm9/cQac+pn2UkKEae105FJzl1rg4ftDhUY FETBfUzDCql0JnBEcumEHw==; Original-Received: from [87.69.77.57] (port=4887 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1odXIv-0003rv-JU; Wed, 28 Sep 2022 09:40:52 -0400 In-Reply-To: <55613fb3-91db-4fb0-aaa7-120888b9db10@www.fastmail.com> (emacs@woolsweater.net) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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:243805 Archived-At: tags 58122 wontfix thanks > Date: Tue, 27 Sep 2022 11:05:10 -0700 > From: "Josh Caswell" > > An overlay `before-string' or `after-string' property with both left and right fringe display specs only seems to render the first spec. > > *Demonstration*: > - Launch GUI Emacs with the -q flag > - In an Elisp buffer, define these two commands > > (defun insert-two-squares () > (interactive) > (insert (propertize " " 'display [(left-fringe hollow-square) > (right-fringe hollow-square)]))) > > (defun overlay-two-squares (right-first) > (interactive "P") > (remove-overlays) > (let ((ov (make-overlay (point) (point))) > (specs [(left-fringe hollow-square) > (right-fringe hollow-square)])) > (overlay-put ov 'before-string > (propertize " " > 'display > (if right-first > (reverse specs) > specs))))) > > - Switch to a new test buffer > - Invoke `insert-two-squares'; observe that both left and right fringes display a hollow square > - Delete the inserted character (fringe bitmaps disappear) > - Invoke `overlay-two-squares'; observe that only the left fringe displays a hollow square > - Invoke `overlay-two-squares' prefixed with `C-u'; observe that only the _right_ fringe displays the hollow square > > The same behavior is seen if the overlay property is `after-string' rather than `before-string'. > > *Expectation*: > Based on the display spec documentation I would expect the overlay to render fringes the same way as an inserted propertized string. Thank you for your report. This was never supported in Emacs. The reasons are subtle and very technical, and I will not go into them here. Making this work as expected might be possible, but it would require changes on a very low level in the code that handles nested display properties and overlay strings, which is already extremely complicated. I find changes of such nature unjustified for such a fringe (pun intended) use case. As an easy work-around, you can have 2 different overlay strings at the same position, like this: (defun insert-two-overlays () (interactive) (remove-overlays) (let ((ov1 (make-overlay (point) (point))) (ov2 (make-overlay (point) (point)))) (overlay-put ov1 'before-string (propertize " " 'display '(left-fringe hollow-square))) (overlay-put ov2 'before-string (propertize " " 'display '(right-fringe hollow-square)))))