GNU bug report logs - #79275
30.2.50; overlay line-prefix display property fighting with text display property

Previous Next

Package: emacs;

Reported by: JD Smith <jdtsmith <at> gmail.com>

Date: Wed, 20 Aug 2025 01:40:02 UTC

Severity: normal

Found in version 30.2.50

Done: Eli Zaretskii <eliz <at> gnu.org>

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#79275: closed (30.2.50; overlay line-prefix display property
 fighting with text display property)
Date: Sat, 23 Aug 2025 08:40:02 +0000
[Message part 1 (text/plain, inline)]
Your message dated Sat, 23 Aug 2025 11:38:56 +0300
with message-id <864ityctzz.fsf <at> gnu.org>
and subject line Re: bug#79275: 30.2.50; overlay line-prefix display property fighting with text display property
has caused the debbugs.gnu.org bug report #79275,
regarding 30.2.50; overlay line-prefix display property fighting with text display property
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
79275: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=79275
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: JD Smith <jdtsmith <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 30.2.50; overlay line-prefix display property fighting with text
 display property
Date: Tue, 19 Aug 2025 21:39:38 -0400
An overlay which applies a line-prefix (e.g. to set the fringe) across several lines conflicts with underlying text which has a replacing display property set.  Evaluate the following in the *scratch* buffer, with at least 3 blank lines at the top of the buffer.

(progn
  (delete-all-overlays)
  (let ((ov (make-overlay 1 4)))
    (overlay-put ov 'line-prefix (propertize "SHOULDNOTSEETHIS" 'display
                                             '(left-fringe right-triangle success))))
  (put-text-property 2 3 'display ">testing fringe display"))

The result is very strange: the SHOULDNOTSEETHIS prefix string appears (sans fringe display), but then vanishes on the next redisplay.  Some (well-balanced) fight between overlay line-prefix display and normal display properties seems to be occurring.

[Message part 3 (message/rfc822, inline)]
From: Eli Zaretskii <eliz <at> gnu.org>
To: jdtsmith <at> gmail.com
Cc: 79275-done <at> debbugs.gnu.org
Subject: Re: bug#79275: 30.2.50;
 overlay line-prefix display property fighting with text display
 property
Date: Sat, 23 Aug 2025 11:38:56 +0300
> Cc: 79275 <at> debbugs.gnu.org
> Date: Fri, 22 Aug 2025 09:49:04 +0300
> From: Eli Zaretskii <eliz <at> gnu.org>
> 
> > From: "J.D. Smith" <jdtsmith <at> gmail.com>
> > Cc: 79275 <at> debbugs.gnu.org
> > Date: Thu, 21 Aug 2025 15:46:03 -0400
> > 
> > Eli Zaretskii <eliz <at> gnu.org> writes:
> > 
> > > Please try the patch below, I hope it fixes both of the situations you
> > > described.
> > 
> > Your latest patch indeed fixes this display conflict between overlays
> > and text properties at both the front of a fringe-displaying overlay and
> > in its middle.  The code I used to test:
> > 
> >    ;; Insert at least 4 blank lines above this and evaluate
> >    (progn
> >      (delete-all-overlays)
> >      (let ((ov (make-overlay 1 5)))
> >        (overlay-put ov 'line-prefix (propertize "SHOULDNOTSEETHIS" 'display
> >    				     '(left-fringe right-triangle success))))
> >      (put-text-property 1 2 'display ">testing front-fringe display\n")
> >      (put-text-property 3 4 'display ">testing mid-fringe display\n"))   
> > 
> > Thanks very much for your work on this.  I know how challenging it can
> > be to hunt down subtle bugs in the redisplay code.  I appreciate all the
> > time and energy you volunteer to continuously improve Emacs.
> 
> Thanks for testing.  I will run a few more tests before installing
> this: as you could see, this bug revealed a couple of serious design
> blunders in how line/wrap-prefix was implemented, so I'd like to make
> sure the changes didn't break anything.
> 
> What astonished me the most was the use of it->object to decide
> whether we iterate a buffer or a string, something that I learned long
> ago (and forgot) to be a very bad idea, see this comment in
> dispextern.h:
> 
>      Do NOT use !BUFFERP (it.object) as a test whether we are
>      iterating over a string; use STRINGP (it.string) instead.
> 

The fix is now installed on the master branch.  Closing the bug.


This bug report was last modified 20 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.