Subject: Re: bug#77732: grep-edit-buffer errors with incionsistent behaviour

From: Eli Zaretskii <[email-masked]>
Date: Sat, 12 Apr 2025 15:51:36 +0300

> From: Visuwesh <[email-masked]>
> Cc: [email-masked],  [email-masked]
> Date: Sat, 12 Apr 2025 17:40:07 +0530
> 
> [சனி ஏப்ரல் 12, 2025] Eli Zaretskii wrote:
> 
> >> From: Visuwesh <[email-masked]>
> >> Cc: [email-masked],  [email-masked]
> >> Date: Fri, 11 Apr 2025 21:42:51 +0530
> >> 
> >> [வெள்ளி ஏப்ரல் 11, 2025] Eli Zaretskii wrote:
> >> 
> >> >> From: Visuwesh <[email-masked]>
> >> >> Cc: Johann Höchtl <[email-masked]>,
> >> >>   [email-masked]
> >> >> Date: Fri, 11 Apr 2025 18:01:27 +0530
> >> >> 
> >> >> I inserted a few message statements (see patch below), and I cannot
> >> >> figure out where the sudden addition in the compilation-message is
> >> >> coming from.
> >> >
> >> > Which addition is that?  I'm afraid you lost me here.
> >> 
> >> Oops, I butchered the statement: after the second time you type 'e', the
> >> "Grep finished..." message attains a non-nil compilation-message
> >> text-property.
> >> 
> >> > Can you explain which line of code causes the error, and why?
> >> 
> >> That's what I tried to figure out by adding the message statements but I
> >> fail to understand how the compilation-message text-property is being
> >> Added.  The relevant bits from *Messages* is at the end.
> >> 
> >> When I say 'e' for the first time then go back to grep-mode with C-c
> >> C-c, there's no extra compilation-message text-property.
> >> 
> >> When I say 'e' for the second time around, till the end of
> >> grep-change-to-grep-edit-mode, there's no extra compilation-message
> >> text-property (lines marked with *).  But in the gap between
> >> grep-change-to-grep-edit-mode and me saying C-c C-c (with no other
> >> action being done by me in between), the extra compilation-message
> >> text-property is added to the "Grep finished..." line.
> >
> > I'm guessing this is font-lock (called via jit-lock mechanism)?
> 
> That may be the case...
> 
> > Maybe you should do something with font-lock-extra-managed-props?
> 
> Just pushing 'compilation-message to font-lock-extra-managed-props did
> not help.  Unfortunately, I do not know enough to debug this one.

And it doesn't help that it is a heisenbug: I could only reproduce it
once, even with your recipe.