GNU bug report logs - #77732
grep-edit-buffer errors with incionsistent behaviour

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Johann Höchtl <johann.hoechtl@HIDDEN>; dated Fri, 11 Apr 2025 09:35:02 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 77732 <at> debbugs.gnu.org:


Received: (at 77732) by debbugs.gnu.org; 12 Apr 2025 12:51:46 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Apr 12 08:51:46 2025
Received: from localhost ([127.0.0.1]:54384 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1u3aKo-0004c5-4j
	for submit <at> debbugs.gnu.org; Sat, 12 Apr 2025 08:51:46 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:45590)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1u3aKm-0004ar-5V
 for 77732 <at> debbugs.gnu.org; Sat, 12 Apr 2025 08:51:44 -0400
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 <eliz@HIDDEN>)
 id 1u3aKg-0001ir-HU; Sat, 12 Apr 2025 08:51:38 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From:
 Date; bh=fyM+UNHKAJOKNQkK6UvvmdDYFNyBT37tqxVn0E5jl7Q=; b=awPp2jFUg+INUz4sAj7m
 UZA2n2GvudM6RjFAgMz2YKWRQGC4eTvGxZzLSPEawTxn2wpKzg6tVy0Dfs5dan4pcYOAkmD+/iK1y
 xBrIlp5JA/ou5Rsw5PjmcX2rCUaMV7eVanVGPp40/fHpP60kFirVqx6WviYyt4fzHtWDncUQodbgJ
 B9jyoQzCG3Reeimaf7vLuUpbGUg3LdeLE2Dr2Hbx50jDrznaZLx/xTsmARQXNcScYzHngnTPtjbdn
 qFV/bxsfS7DvV+K3c+xITuKFCgIKchNY6a6Ona2by6J9qszdX/Ut8WxN57KrILBANpV0M8ReBrd1W
 PoiWvOcd5gfPqA==;
Date: Sat, 12 Apr 2025 15:51:36 +0300
Message-Id: <868qo5mtk7.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Visuwesh <visuweshm@HIDDEN>
In-Reply-To: <87tt6t60o0.fsf@HIDDEN> (message from Visuwesh on Sat, 12 Apr
 2025 17:40:07 +0530)
Subject: Re: bug#77732: grep-edit-buffer errors with incionsistent behaviour
References: <CAH4isRxsU63ycL-Ckr=v86sHEzoMvT-6ZrGiLroZUmLwof2ung@HIDDEN>
 <86wmbqoqq1.fsf@HIDDEN> <87bjt298ww.fsf@HIDDEN>
 <86tt6uofnu.fsf@HIDDEN> <871pty8ynw.fsf@HIDDEN>
 <86r01xn0ah.fsf@HIDDEN> <87tt6t60o0.fsf@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 77732
Cc: johann.hoechtl@HIDDEN, 77732 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Visuwesh <visuweshm@HIDDEN>
> Cc: johann.hoechtl@HIDDEN,  77732 <at> debbugs.gnu.org
> Date: Sat, 12 Apr 2025 17:40:07 +0530
> 
> [சனி ஏப்ரல் 12, 2025] Eli Zaretskii wrote:
> 
> >> From: Visuwesh <visuweshm@HIDDEN>
> >> Cc: johann.hoechtl@HIDDEN,  77732 <at> debbugs.gnu.org
> >> Date: Fri, 11 Apr 2025 21:42:51 +0530
> >> 
> >> [வெள்ளி ஏப்ரல் 11, 2025] Eli Zaretskii wrote:
> >> 
> >> >> From: Visuwesh <visuweshm@HIDDEN>
> >> >> Cc: Johann Höchtl <johann.hoechtl@HIDDEN>,
> >> >>   77732 <at> debbugs.gnu.org
> >> >> 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.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#77732; Package emacs. Full text available.

Message received at 77732 <at> debbugs.gnu.org:


Received: (at 77732) by debbugs.gnu.org; 12 Apr 2025 12:10:25 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Apr 12 08:10:24 2025
Received: from localhost ([127.0.0.1]:54341 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1u3Zgk-0005cK-7d
	for submit <at> debbugs.gnu.org; Sat, 12 Apr 2025 08:10:24 -0400
Received: from mail-pl1-x641.google.com ([2607:f8b0:4864:20::641]:60641)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <visuweshm@HIDDEN>)
 id 1u3Zgf-0005ZG-9A
 for 77732 <at> debbugs.gnu.org; Sat, 12 Apr 2025 08:10:19 -0400
Received: by mail-pl1-x641.google.com with SMTP id
 d9443c01a7336-22403cbb47fso30927915ad.0
 for <77732 <at> debbugs.gnu.org>; Sat, 12 Apr 2025 05:10:17 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1744459811; x=1745064611; darn=debbugs.gnu.org;
 h=content-transfer-encoding:mime-version:user-agent:message-id:date
 :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date
 :message-id:reply-to;
 bh=zOkHzmlLP783bbUPn/F2HynrIiJKFxZfNTXRXz1EM78=;
 b=KwUzxTR1qB34gA0JDEhugwt7hRQ554obg9Z8BZGZiVHY0mc+5kxqZdWIur06bPCFXV
 04xoZwyrumg37UYPdRdcq6pmHr8PUip91NfrVAp+wZ0vteNLbmr97lVJVAOT6VdqAtQX
 lccgw03+E23NX3gy237YoaBgbjP/3wBLoxYhYYnzhGsQT7qqTLlak15DhSmAPGl9MuWe
 rGWOj7D3deibk1KJOwhXZ2lbG7/vGY/OBXGhUCOsl8VhyVrzh/96nNYM0dEqDh5QY+k6
 At+fHaoN8sk+z7rUcAEmHvyb7eUKLXhHJHWMlmn4HW1qfG9b7mqNIP2RjUiTBiZWXFNq
 vkNg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1744459811; x=1745064611;
 h=content-transfer-encoding:mime-version:user-agent:message-id:date
 :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from
 :to:cc:subject:date:message-id:reply-to;
 bh=zOkHzmlLP783bbUPn/F2HynrIiJKFxZfNTXRXz1EM78=;
 b=lW8Q6rM+xOA8KB8JjPmPxXYsfhZErdAeRpbIE539jyoZY9InhVH7n59JqXrxl/u5zL
 gK2xyGm27cSgBf9pmUGzXBsG9GyPjAiATzKd2h1FdFxxHOD0V8Liaozt6PIfWbL3IgiW
 RypZvYTUUGyq3Oglnsdocphqxoel+EzxCKUjGVz6rhWzKSYiy5Ac6FcMc0jGuFarsBxE
 A0u8T0VVk0AY8dYM0H2WbSdynbyqOD+/vh/t6Bj0n0cKnot6w5yeL6tridUm4sZcSgta
 BZ6SjJMl5IZcF8BBk2vTwVpgIEI3UJxHSI8Z3df4hulDO2MT9hDoXqOdxAyCd6dW0tLk
 iMoQ==
X-Forwarded-Encrypted: i=1;
 AJvYcCXkk5CGlwom1N0NhM53A2RRP8LO9arcOkAu7vE3rj9ZMcBwXn0RMCKUBbbzMc5dAbAi3M4Q1w==@debbugs.gnu.org
X-Gm-Message-State: AOJu0Yz4017WWu0xtcIici7g1p5coASY3MO/MZdMGXYYryA4vr3HSysZ
 igGqDVvvpnqLcmeUiP1OPt9Dif/rJ/SR3RoOwED5xAHGFF6AB+Pm
X-Gm-Gg: ASbGncvgVnJHjNOdylPZITEBH+ypLCB2ZPnF/32eu6jQOrB9zRF3eXULecDwlLhe9ny
 bvbkAnkDtAN4Kpp9bGceG9IrvZqBd7FjwTI9WtRlUSje2ZUyp2O5TX1503UJIkDFor2iBWmzPxP
 CA5vLfzYufCc+SomI5dZYOahe+6jXzj36vZvw0/o6ki/EOTSSDB5WUfRoFl/3Tuc9AHZDEWNEGD
 PRmLczdbHgC9GQNw7GLLJXLHhKV6T55MhxkVnfKzyrw8WqsZWg/QGRuQKCf0audr6J1entkB7V/
 cz2S37p76EtdgWmOR0KDRPdGPOaMiaZ7CZUlbOQr6Q==
X-Google-Smtp-Source: AGHT+IEZCeXWxnDjCMqm4/w7K/O6Q61yjJhX/WYug9a910RouyTc/8aXMaky121MMOAId6Iv6XLk5A==
X-Received: by 2002:a17:902:d4ca:b0:223:54aa:6d15 with SMTP id
 d9443c01a7336-22bea4b6e10mr81643095ad.12.1744459810853; 
 Sat, 12 Apr 2025 05:10:10 -0700 (PDT)
Received: from localhost ([1.7.159.71]) by smtp.gmail.com with UTF8SMTPSA id
 d9443c01a7336-22ac7cbee8bsm66478965ad.208.2025.04.12.05.10.09
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Sat, 12 Apr 2025 05:10:10 -0700 (PDT)
From: Visuwesh <visuweshm@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#77732: grep-edit-buffer errors with incionsistent behaviour
In-Reply-To: <86r01xn0ah.fsf@HIDDEN>
References: <CAH4isRxsU63ycL-Ckr=v86sHEzoMvT-6ZrGiLroZUmLwof2ung@HIDDEN>
 <86wmbqoqq1.fsf@HIDDEN> <87bjt298ww.fsf@HIDDEN>
 <86tt6uofnu.fsf@HIDDEN> <871pty8ynw.fsf@HIDDEN>
 <86r01xn0ah.fsf@HIDDEN>
Date: Sat, 12 Apr 2025 17:40:07 +0530
Message-ID: <87tt6t60o0.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 4.6 (++++)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 
 Content preview:  [சனி ஏப்ரல் 12, 2025] Eli Zaretskii wrote:
    >> From: Visuwesh >> Cc: johann.hoechtl@HIDDEN, 77732 <at> debbugs.gnu.org
   >> Date: Fri, 11 Apr 2025 21:42:51 +0530 >> >> [வெள்ளி ஏப்ரல்
    11, 2025] Eli Zaretskii wrote: >> >> >> [...] 
 
 Content analysis details:   (4.6 points, 10.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
  3.6 RCVD_IN_SBL_CSS        RBL: Received via a relay in Spamhaus SBL-CSS
                             [1.7.159.71 listed in zen.spamhaus.org]
 -0.0 RCVD_IN_DNSWL_NONE     RBL: Sender listed at https://www.dnswl.org/,
                              no trust
                             [2607:f8b0:4864:20:0:0:0:641 listed in]
                             [list.dnswl.org]
  0.0 FREEMAIL_FROM          Sender email is commonly abused enduser mail
                             provider (visuweshm[at]gmail.com)
 -0.0 SPF_PASS               SPF: sender matches SPF record
  0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
  1.0 FREEMAIL_REPLY         From and body contain different freemails
X-Debbugs-Envelope-To: 77732
Cc: johann.hoechtl@HIDDEN, 77732 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 2.6 (++)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 
 Content preview:  [சனி ஏப்ரல் 12, 2025] Eli Zaretskii wrote:
    >> From: Visuwesh >> Cc: johann.hoechtl@HIDDEN, 77732 <at> debbugs.gnu.org
   >> Date: Fri, 11 Apr 2025 21:42:51 +0530 >> >> [வெள்ளி ஏப்ரல்
    11, 2025] Eli Zaretskii wrote: >> >> >> [...] 
 
 Content analysis details:   (2.6 points, 10.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -0.0 RCVD_IN_DNSWL_NONE     RBL: Sender listed at https://www.dnswl.org/,
                              no trust
                             [2607:f8b0:4864:20:0:0:0:641 listed in]
                             [list.dnswl.org]
  3.6 RCVD_IN_SBL_CSS        RBL: Received via a relay in Spamhaus SBL-CSS
                             [1.7.159.71 listed in zen.spamhaus.org]
  0.0 FREEMAIL_FROM          Sender email is commonly abused enduser mail
                             provider (visuweshm[at]gmail.com)
 -0.0 SPF_PASS               SPF: sender matches SPF record
  0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 -1.0 MAILING_LIST_MULTI     Multiple indicators imply a widely-seen list
                             manager

[=E0=AE=9A=E0=AE=A9=E0=AE=BF =E0=AE=8F=E0=AE=AA=E0=AF=8D=E0=AE=B0=E0=AE=B2=
=E0=AF=8D 12, 2025] Eli Zaretskii wrote:

>> From: Visuwesh <visuweshm@HIDDEN>
>> Cc: johann.hoechtl@HIDDEN,  77732 <at> debbugs.gnu.org
>> Date: Fri, 11 Apr 2025 21:42:51 +0530
>>=20
>> [=E0=AE=B5=E0=AF=86=E0=AE=B3=E0=AF=8D=E0=AE=B3=E0=AE=BF =E0=AE=8F=E0=AE=
=AA=E0=AF=8D=E0=AE=B0=E0=AE=B2=E0=AF=8D 11, 2025] Eli Zaretskii wrote:
>>=20
>> >> From: Visuwesh <visuweshm@HIDDEN>
>> >> Cc: Johann H=C3=B6chtl <johann.hoechtl@HIDDEN>,
>> >>   77732 <at> debbugs.gnu.org
>> >> Date: Fri, 11 Apr 2025 18:01:27 +0530
>> >>=20
>> >> 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.
>>=20
>> Oops, I butchered the statement: after the second time you type 'e', the
>> "Grep finished..." message attains a non-nil compilation-message
>> text-property.
>>=20
>> > Can you explain which line of code causes the error, and why?
>>=20
>> 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.
>>=20
>> 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.
>>=20
>> 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.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#77732; Package emacs. Full text available.

Message received at 77732 <at> debbugs.gnu.org:


Received: (at 77732) by debbugs.gnu.org; 12 Apr 2025 10:26:25 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Apr 12 06:26:25 2025
Received: from localhost ([127.0.0.1]:54119 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1u3Y48-00017g-HU
	for submit <at> debbugs.gnu.org; Sat, 12 Apr 2025 06:26:24 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:50748)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1u3Y46-00017P-U7
 for 77732 <at> debbugs.gnu.org; Sat, 12 Apr 2025 06:26:23 -0400
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 <eliz@HIDDEN>)
 id 1u3Y41-0004XH-Gc; Sat, 12 Apr 2025 06:26:17 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From:
 Date; bh=qu5CimedZffVlGb61Xa5tRsb8IzFzYA8j2wp56WdQX0=; b=drjOGgzyDkH5z5K1x5Bt
 RCU5SInYyEc4pURvxUcRxXxxWMcSU6hRopQkaP+ZayTomfE2Q8z/LhhoCS0ypkzGZic4T6YvuJnb6
 kGlRNBblQoEdQEqIlMrf9WsIrmyYikd46VTsueK344kCoE1isMCZV7CnTSes7NDfTjzrZb0PiAspN
 pdtEXzogh0CeReb2/wFo+lerKta8waZRaHML5OFKADE3YmdFfj5a2FIj/95/+bONrnFBFZEUV7u6L
 hr+uGU3qnkbRWbJnsBB+rv88bqSxx9CNt59Uh5YyCXjxYzMFQmPr93BiclMaiN3f1Ng/KLewkGj1y
 LBvOlaDOJulnWQ==;
Date: Sat, 12 Apr 2025 13:26:14 +0300
Message-Id: <86r01xn0ah.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Visuwesh <visuweshm@HIDDEN>
In-Reply-To: <871pty8ynw.fsf@HIDDEN> (message from Visuwesh on Fri, 11 Apr
 2025 21:42:51 +0530)
Subject: Re: bug#77732: grep-edit-buffer errors with incionsistent behaviour
References: <CAH4isRxsU63ycL-Ckr=v86sHEzoMvT-6ZrGiLroZUmLwof2ung@HIDDEN>
 <86wmbqoqq1.fsf@HIDDEN> <87bjt298ww.fsf@HIDDEN>
 <86tt6uofnu.fsf@HIDDEN> <871pty8ynw.fsf@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 77732
Cc: johann.hoechtl@HIDDEN, 77732 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Visuwesh <visuweshm@HIDDEN>
> Cc: johann.hoechtl@HIDDEN,  77732 <at> debbugs.gnu.org
> Date: Fri, 11 Apr 2025 21:42:51 +0530
> 
> [வெள்ளி ஏப்ரல் 11, 2025] Eli Zaretskii wrote:
> 
> >> From: Visuwesh <visuweshm@HIDDEN>
> >> Cc: Johann Höchtl <johann.hoechtl@HIDDEN>,
> >>   77732 <at> debbugs.gnu.org
> >> 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)?

Maybe you should do something with font-lock-extra-managed-props?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#77732; Package emacs. Full text available.

Message received at 77732 <at> debbugs.gnu.org:


Received: (at 77732) by debbugs.gnu.org; 11 Apr 2025 16:13:06 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Apr 11 12:13:06 2025
Received: from localhost ([127.0.0.1]:51451 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1u3H06-0000VC-4A
	for submit <at> debbugs.gnu.org; Fri, 11 Apr 2025 12:13:06 -0400
Received: from mail-pl1-x641.google.com ([2607:f8b0:4864:20::641]:45225)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <visuweshm@HIDDEN>)
 id 1u3H01-0000UY-2c
 for 77732 <at> debbugs.gnu.org; Fri, 11 Apr 2025 12:13:05 -0400
Received: by mail-pl1-x641.google.com with SMTP id
 d9443c01a7336-22423adf751so22226275ad.2
 for <77732 <at> debbugs.gnu.org>; Fri, 11 Apr 2025 09:13:01 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1744387975; x=1744992775; darn=debbugs.gnu.org;
 h=content-transfer-encoding:mime-version:message-id:date:user-agent
 :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date
 :message-id:reply-to;
 bh=93RJY3zoyAf6MMOHLiyB2+26Wc3b6yfBK06/cEORh8w=;
 b=ZBmvsVxRQn32EvFJISlX7tK6zsWFqlCwnkVXcSP7iLCSLaMKnpFTbWQTFCxCcufqWm
 vzUeEkT1ChUk1rf/49ChwT+mj0MOrdBa134IvA0p9ZGmci1p43ORLUVZw991dH4TPe8Q
 p0IJN+TEPse7cYRzbxGJ0C5MQsGd62/NntmSRWx4wKTMUBbzSx3pPGjjHcQYaC5EF7M6
 pD+jyD2wlyi2Fo3W27EENvCkNGbU6OB2lioQTufQ9e92BtmfNIxUhtekgXdfW5RiO7aj
 MFibmsyxJL9sBZWTkC1DIciTnvWB5IEyqdHK7+F/HoqRfrbCsOhLZe7natwDcENrKFnb
 FdzQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1744387975; x=1744992775;
 h=content-transfer-encoding:mime-version:message-id:date:user-agent
 :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from
 :to:cc:subject:date:message-id:reply-to;
 bh=93RJY3zoyAf6MMOHLiyB2+26Wc3b6yfBK06/cEORh8w=;
 b=mlXmdWPH63KP6yvu6CsfeprlQC5QUzVu3fi31bCULxjs5GzLUnIuukp0M0yLw+65gv
 wv4NROivjGaSEt1WYUyvnzezSCGBrQGYroJvLUDNKj2AreyopGM4vKTqDmRcbnJ+3XY9
 c4Kp3jeM5dbzBGh9GsOVRXiU2EmTqZVLbNFxKZG8nygLgttQcqYWINzwuLpWLzTLpXsZ
 lHwSM9ucwR6wktYsXUS2e4BsktkbJwgLsYB0BCb2GHDVvhKm90nyWiMfTIUyLM6t24vQ
 Y8ZO7wGr4n1bBP315ez0p/Qb9325qvFCSYUtbZ8g0H+6tJZvTAt7vPNUBG3Y0wnz4B6k
 YjiA==
X-Forwarded-Encrypted: i=1;
 AJvYcCXYqkSkdDvkqu/Jv87Bz5ToDtDLpgTpaAfgRPJCtUGfkKD0LjMWdC7j/Bl1aGUo4Wd3e/VldQ==@debbugs.gnu.org
X-Gm-Message-State: AOJu0YxiAgFDb7nAjJd1XwoVPQW5CCLBnq1Hk9PEu5v3KSKgo0f+eWYI
 VrRL09YWnFYAwjY/yRCZ+8l0mM2YOWDe6SZQQOFcckUdLSw37P0g
X-Gm-Gg: ASbGncu+bov3o6QC6pubtE6QB7PP3gT2+Neom4bmySudCkLwu0JH3GZFPY2XToYyn0M
 rLPfjvmulHX2sqy7m3VlUrPJJ+y12GXN+P56apWAOax5wZGUxasN8usoTsat1T7msrSzTP9xeKx
 tOljcUOI9wIx6kp4bB4o74vkJgB4seHLf4qOvZT7Pxh3YibstHbJ1ztcJlMijwZNCMzkjfdMz9J
 OfU2m5uSDuG/QBQCEoslLcM/tDYBa4e4HXdhxqDYCghGfwmTrdF2YL5mZEVYxcldQ8Z6AHM14zv
 ARmhYdPMzmEu/Nf3aG3V0O2DDgeDqikxyQQFi8xV3g==
X-Google-Smtp-Source: AGHT+IEkro/SYgNkBGiQGT3uQMr1U/ljyW++JUm7GpSRasCz18kT96FvKLt4aNPYOAw4y+qWUh55Rg==
X-Received: by 2002:a17:902:cec9:b0:227:e980:9190 with SMTP id
 d9443c01a7336-22bea4fcad1mr53843465ad.44.1744387974742; 
 Fri, 11 Apr 2025 09:12:54 -0700 (PDT)
Received: from localhost ([1.7.159.71]) by smtp.gmail.com with UTF8SMTPSA id
 d9443c01a7336-22ac7c93aa3sm51302895ad.149.2025.04.11.09.12.53
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 11 Apr 2025 09:12:54 -0700 (PDT)
From: Visuwesh <visuweshm@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#77732: grep-edit-buffer errors with incionsistent behaviour
In-Reply-To: <86tt6uofnu.fsf@HIDDEN>
References: <CAH4isRxsU63ycL-Ckr=v86sHEzoMvT-6ZrGiLroZUmLwof2ung@HIDDEN>
 <86wmbqoqq1.fsf@HIDDEN> <87bjt298ww.fsf@HIDDEN>
 <86tt6uofnu.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
Date: Fri, 11 Apr 2025 21:42:51 +0530
Message-ID: <871pty8ynw.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 3.6 (+++)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 
 Content preview:  [வெள்ளி ஏப்ரல் 11, 2025] Eli Zaretskii
    wrote: >> From: Visuwesh >> Cc: Johann Höchtl , >> 77732 <at> debbugs.gnu.org
    >> Date: Fri, 11 Apr 2025 18:01:27 +0530 >> >> I inserted a few message statements
    (see patch below), and I cannot >> figure out w [...] 
 
 Content analysis details:   (3.6 points, 10.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
  3.6 RCVD_IN_SBL_CSS        RBL: Received via a relay in Spamhaus SBL-CSS
                             [1.7.159.71 listed in zen.spamhaus.org]
  0.0 FREEMAIL_FROM          Sender email is commonly abused enduser mail
                             provider (visuweshm[at]gmail.com)
 -0.0 SPF_PASS               SPF: sender matches SPF record
  0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 -0.0 RCVD_IN_DNSWL_NONE     RBL: Sender listed at https://www.dnswl.org/,
                              no trust
                             [2607:f8b0:4864:20:0:0:0:641 listed in]
                             [list.dnswl.org]
X-Debbugs-Envelope-To: 77732
Cc: johann.hoechtl@HIDDEN, 77732 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 2.6 (++)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 
 Content preview:  [வெள்ளி ஏப்ரல் 11, 2025] Eli Zaretskii
    wrote: >> From: Visuwesh >> Cc: Johann Höchtl , >> 77732 <at> debbugs.gnu.org
    >> Date: Fri, 11 Apr 2025 18:01:27 +0530 >> >> I inserted a few message statements
    (see patch below), and I cannot >> figure out w [...] 
 
 Content analysis details:   (2.6 points, 10.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -0.0 RCVD_IN_DNSWL_NONE     RBL: Sender listed at https://www.dnswl.org/,
                              no trust
                             [2607:f8b0:4864:20:0:0:0:641 listed in]
                             [list.dnswl.org]
  3.6 RCVD_IN_SBL_CSS        RBL: Received via a relay in Spamhaus SBL-CSS
                             [1.7.159.71 listed in zen.spamhaus.org]
  0.0 FREEMAIL_FROM          Sender email is commonly abused enduser mail
                             provider (visuweshm[at]gmail.com)
 -0.0 SPF_PASS               SPF: sender matches SPF record
  0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 -1.0 MAILING_LIST_MULTI     Multiple indicators imply a widely-seen list
                             manager

[=E0=AE=B5=E0=AF=86=E0=AE=B3=E0=AF=8D=E0=AE=B3=E0=AE=BF =E0=AE=8F=E0=AE=AA=
=E0=AF=8D=E0=AE=B0=E0=AE=B2=E0=AF=8D 11, 2025] Eli Zaretskii wrote:

>> From: Visuwesh <visuweshm@HIDDEN>
>> Cc: Johann H=C3=B6chtl <johann.hoechtl@HIDDEN>,
>>   77732 <at> debbugs.gnu.org
>> Date: Fri, 11 Apr 2025 18:01:27 +0530
>>=20
>> 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.

    Grep finished with 17 matches found
    before prep 1 nil
    ----
    1666 nil
    1718 nil
    1769 nil
    1809 nil
    1847 nil
    1890 nil
    1932 nil
    1974 nil
    2024 nil
    2074 nil
    2149 nil
    2218 nil
    2269 nil
    2321 nil
    2378 nil
    2424 nil
    2471 nil [2 times]
    after prep 1 nil
    after undo 1 nil
    after hook 1 nil
    Editing: Type C-c C-c to return to Grep mode
    1 nil
    Switching to Grep mode
    1 nil
    before prep 1 nil
    ----
    1666 nil
    1718 nil
    1769 nil
    1809 nil
    1847 nil
    1890 nil
    1932 nil
    1974 nil
    2024 nil
    2074 nil
    2149 nil
    2218 nil
    2269 nil
    2321 nil
    2378 nil
    2424 nil
    2471 nil [2 times]
*   after prep 1 nil
*   after undo 1 nil
*   after hook 1 nil
    Editing: Type C-c C-c to return to Grep mode
    1 #s(compilation--message (nil 33 (("Grep finished with 17 matches foun=
d at Fri Apr 11 21" nil) nil (33 #1)) nil nil) 2 nil nil)
    Switching to Grep mode
    1 #s(compilation--message (nil 33 (("Grep finished with 17 matches foun=
d at Fri Apr 11 21" nil) nil (33 #1)) nil nil) 2 nil nil)
    before prep 1 #s(compilation--message (nil 33 (("Grep finished with 17 =
matches found at Fri Apr 11 21" nil) nil (33 #1)) nil nil) 2 nil nil)
    ----
    1666 #s(compilation--message (nil 33 (("Grep finished with 17 matches f=
ound at Fri Apr 11 21" nil) nil (33 #1)) nil nil) 2 nil nil)
    1718 #s(compilation--message (nil 33 (("Grep finished with 17 matches f=
ound at Fri Apr 11 21" nil) nil (33 #1)) nil nil) 2 nil nil)
    1769 #s(compilation--message (nil 33 (("Grep finished with 17 matches f=
ound at Fri Apr 11 21" nil) nil (33 #1)) nil nil) 2 nil nil)
    1809 #s(compilation--message (nil 33 (("Grep finished with 17 matches f=
ound at Fri Apr 11 21" nil) nil (33 #1)) nil nil) 2 nil nil)
    1847 #s(compilation--message (nil 33 (("Grep finished with 17 matches f=
ound at Fri Apr 11 21" nil) nil (33 #1)) nil nil) 2 nil nil)
    1890 #s(compilation--message (nil 33 (("Grep finished with 17 matches f=
ound at Fri Apr 11 21" nil) nil (33 #1)) nil nil) 2 nil nil)
    1932 #s(compilation--message (nil 33 (("Grep finished with 17 matches f=
ound at Fri Apr 11 21" nil) nil (33 #1)) nil nil) 2 nil nil)
    1974 #s(compilation--message (nil 33 (("Grep finished with 17 matches f=
ound at Fri Apr 11 21" nil) nil (33 #1)) nil nil) 2 nil nil)
    2024 #s(compilation--message (nil 33 (("Grep finished with 17 matches f=
ound at Fri Apr 11 21" nil) nil (33 #1)) nil nil) 2 nil nil)
    2074 #s(compilation--message (nil 33 (("Grep finished with 17 matches f=
ound at Fri Apr 11 21" nil) nil (33 #1)) nil nil) 2 nil nil)
    2149 #s(compilation--message (nil 33 (("Grep finished with 17 matches f=
ound at Fri Apr 11 21" nil) nil (33 #1)) nil nil) 2 nil nil)
    2218 #s(compilation--message (nil 33 (("Grep finished with 17 matches f=
ound at Fri Apr 11 21" nil) nil (33 #1)) nil nil) 2 nil nil)
    2269 #s(compilation--message (nil 33 (("Grep finished with 17 matches f=
ound at Fri Apr 11 21" nil) nil (33 #1)) nil nil) 2 nil nil)
    2321 #s(compilation--message (nil 33 (("Grep finished with 17 matches f=
ound at Fri Apr 11 21" nil) nil (33 #1)) nil nil) 2 nil nil)
    2378 #s(compilation--message (nil 33 (("Grep finished with 17 matches f=
ound at Fri Apr 11 21" nil) nil (33 #1)) nil nil) 2 nil nil)
    2424 #s(compilation--message (nil 33 (("Grep finished with 17 matches f=
ound at Fri Apr 11 21" nil) nil (33 #1)) nil nil) 2 nil nil)
    2471 #s(compilation--message (nil 33 (("Grep finished with 17 matches f=
ound at Fri Apr 11 21" nil) nil (33 #1)) nil nil) 2 nil nil)
    2583 #s(compilation--message (nil 33 (("Grep finished with 17 matches f=
ound at Fri Apr 11 21" nil) nil (33 #1)) nil nil) 2 nil nil)
    Entering debugger...




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#77732; Package emacs. Full text available.

Message received at 77732 <at> debbugs.gnu.org:


Received: (at 77732) by debbugs.gnu.org; 11 Apr 2025 15:56:49 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Apr 11 11:56:49 2025
Received: from localhost ([127.0.0.1]:51388 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1u3GkL-00087v-By
	for submit <at> debbugs.gnu.org; Fri, 11 Apr 2025 11:56:49 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:52614)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1u3GkI-00087f-Vq
 for 77732 <at> debbugs.gnu.org; Fri, 11 Apr 2025 11:56:48 -0400
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 <eliz@HIDDEN>)
 id 1u3GkD-0006KI-El; Fri, 11 Apr 2025 11:56:41 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From:
 Date; bh=JZO3xfBh3Z6tr8zX//53ENTSnLP+ARZON2ehwk/KqIE=; b=Uyqi9ZnH6H6bTopvJLt1
 yIVNtt+mTW08lf1bttDxoRXo6De82W8LNyxvewkNoY3TGHJoSL39lwx1jLlwN8O0n3Hw6BqTGnN+z
 PpD1v45PUYLfnKQL6QdiCFJmZBsyphN7jtoJaMnTyEgno1eQdjMX9aQ2alDxtasoQjob7NkUe/NZa
 r/MqU2l47DftaWefQXY42hi1nsjK6dCzke+BL0nD2XDB1tZx4rSA67pUsrHXkMDMK7pKuZW+6xuCI
 mIEEc1vcpVzP7+gbLVo46AIc8UHRenoT2KAy5z0lOr2yKrh24RfFTdpcgtwugiN5oLseHIPZ6KL/3
 xz1MnGNYLW7lrA==;
Date: Fri, 11 Apr 2025 18:56:37 +0300
Message-Id: <86tt6uofnu.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Visuwesh <visuweshm@HIDDEN>
In-Reply-To: <87bjt298ww.fsf@HIDDEN> (message from Visuwesh on Fri, 11 Apr
 2025 18:01:27 +0530)
Subject: Re: bug#77732: grep-edit-buffer errors with incionsistent behaviour
References: <CAH4isRxsU63ycL-Ckr=v86sHEzoMvT-6ZrGiLroZUmLwof2ung@HIDDEN>
 <86wmbqoqq1.fsf@HIDDEN> <87bjt298ww.fsf@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 77732
Cc: johann.hoechtl@HIDDEN, 77732 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Visuwesh <visuweshm@HIDDEN>
> Cc: Johann Höchtl <johann.hoechtl@HIDDEN>,
>   77732 <at> debbugs.gnu.org
> 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.

Can you explain which line of code causes the error, and why?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#77732; Package emacs. Full text available.

Message received at 77732 <at> debbugs.gnu.org:


Received: (at 77732) by debbugs.gnu.org; 11 Apr 2025 12:31:58 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Apr 11 08:31:58 2025
Received: from localhost ([127.0.0.1]:49374 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1u3DY4-0001iz-Uu
	for submit <at> debbugs.gnu.org; Fri, 11 Apr 2025 08:31:57 -0400
Received: from mail-pg1-x543.google.com ([2607:f8b0:4864:20::543]:45414)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <visuweshm@HIDDEN>)
 id 1u3DXy-0001hi-G8
 for 77732 <at> debbugs.gnu.org; Fri, 11 Apr 2025 08:31:51 -0400
Received: by mail-pg1-x543.google.com with SMTP id
 41be03b00d2f7-af5cdf4a2f8so1460948a12.3
 for <77732 <at> debbugs.gnu.org>; Fri, 11 Apr 2025 05:31:50 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1744374704; x=1744979504; darn=debbugs.gnu.org;
 h=mime-version:user-agent:message-id:date:references:in-reply-to
 :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to;
 bh=ScKDWx3P/kkqK/9IDuSV7VLVRA+b6CqaxyDdPNWsPqQ=;
 b=F7MCF/P+Gp2CcIYnLzs3hBUB00DKeCsM/DRH3s2NCpngYOJ655GElVL8hecSY4s0bP
 qxTAGUyUO5PxMT6erhmoVyy9re4uckx96CBoyIuzoRBrLYLHnHUoObc1xe/1KyXZOa4/
 efdwv5kWPsFucKe2dLzPvjJch5mhUkPuwucD4mJubRwrzavoTCjLYWo+rmOOLsKV2KXh
 CGiNlaXV3nrRwSRpf4B2PuHSP8f+iPCYwfqjxCbfF3HdQmWRwZp4VRsbi3qlEJHs6mKj
 wuygWexJQT6GPZGll4fww6Qe2K9jx0rLmGhFglA8csaGnC7zgZ04ZPk/hu98h/b0TTZY
 0D8g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1744374704; x=1744979504;
 h=mime-version:user-agent:message-id:date:references:in-reply-to
 :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date
 :message-id:reply-to;
 bh=ScKDWx3P/kkqK/9IDuSV7VLVRA+b6CqaxyDdPNWsPqQ=;
 b=pKPIbFd77vErZQ9Ke7w4OSoIC07KRMlGosHBkV6ihelLPk4SZzM565QyUKHMbUW9+R
 SM99fm5QRIKkDpilfTh/AK69DM/0iRvai5GX8gHGnPD5qM3Vg+zURbhWKvXTT7COEoC6
 2dHwckxmqxaZYdPbK4t2RxODRBdYgyQL2DQ/wLglPHVoFkFnF93o9I09OGCyjGT9yWbu
 5GEsllGSZeH9ATZF4umiJZdPHuQvxV105f6XzLWiLwPJ0y35vbqBehY4ypBcvDiYaauy
 Y9epZWsD8hpEnGZZrZ3fbs0VT8FTW7UFGVc4RM0kt1VQlUnCgzPMLTsEYkoba3uosa5n
 Lcaw==
X-Forwarded-Encrypted: i=1;
 AJvYcCUcCbufoJsouBx00PSrLFETZYiHGhsar7Bb6PNEDSi1A2dC3fELZ9U9+ooLHVlQIdVAVVH6Dg==@debbugs.gnu.org
X-Gm-Message-State: AOJu0YwMwvsyrae0GGsIEv1bvdJSMXeAQQFeBj96OYd6BAUpRrbuGvhR
 ZWcJlfPid2fpbCN1KSriFI/rlSk0O97TlDnXvHCLIFfL2EAWOzgu
X-Gm-Gg: ASbGnctezJHnPqXJ3wQ7ZvS77nBDDwOe9sPPOpf68UWg62h/NGnU/5DYofIwu6OMv1D
 fLHCU6/bF0IFCBSgyg/xVLHYYrvdJ4dZkHQW4kZhZTy/7PEoAvUdwf7NqTdOkS1U/PBOp1OkVof
 6ryMCIbwBqftl/hdqdHgQ39Ftp0vmODOMGXhoEjf58kHgNQ+GKOQ6cPTB/unyDnbo+ozb/5esVr
 ay2AcuufdCwQxQ5jPObMXRJ/5w+KTyfD3O82qAyxQB2zNlI2WP+Y05ZmGa90UJhl1SDMhNDfpCh
 N4J7JH0bxN2Ns0Ro15820/2ylHs9YrKV1OBJquem8hdkpoZ64Gc/
X-Google-Smtp-Source: AGHT+IFGTDYEGRaT5vAd7rRyFhbQ/QBpHww79JdFcMvvc8z+iS6vzcRmNag83HyeCHwZDijrXDqpTg==
X-Received: by 2002:a17:90b:274e:b0:2f9:c139:b61f with SMTP id
 98e67ed59e1d1-30823670d71mr4362825a91.14.1744374703526; 
 Fri, 11 Apr 2025 05:31:43 -0700 (PDT)
Received: from localhost ([1.7.159.71]) by smtp.gmail.com with UTF8SMTPSA id
 98e67ed59e1d1-306dd10c447sm5570864a91.3.2025.04.11.05.31.41
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 11 Apr 2025 05:31:42 -0700 (PDT)
From: Visuwesh <visuweshm@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#77732: grep-edit-buffer errors with incionsistent behaviour
In-Reply-To: <86wmbqoqq1.fsf@HIDDEN>
References: <CAH4isRxsU63ycL-Ckr=v86sHEzoMvT-6ZrGiLroZUmLwof2ung@HIDDEN>
 <86wmbqoqq1.fsf@HIDDEN>
Date: Fri, 11 Apr 2025 18:01:27 +0530
Message-ID: <87bjt298ww.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-Spam-Score: 3.6 (+++)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 
 Content preview:  [வெள்ளி ஏப்ரல் 11, 2025] Eli Zaretskii
    wrote: >> From: Johann Höchtl >> Date: Fri, 11 Apr 2025 11:33:59 +0200 >>
    >> I am using Emacs from HEAD on Windows >> >> I tried to reproduce the behaviour
    with emacs -Q but it still remains inconsistent. [...] 
 
 Content analysis details:   (3.6 points, 10.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
  3.6 RCVD_IN_SBL_CSS        RBL: Received via a relay in Spamhaus SBL-CSS
                             [1.7.159.71 listed in zen.spamhaus.org]
 -0.0 RCVD_IN_DNSWL_NONE     RBL: Sender listed at https://www.dnswl.org/,
                              no trust
                             [2607:f8b0:4864:20:0:0:0:543 listed in]
                             [list.dnswl.org]
 -0.0 SPF_PASS               SPF: sender matches SPF record
  0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
  0.0 FREEMAIL_FROM          Sender email is commonly abused enduser mail
                             provider (visuweshm[at]gmail.com)
X-Debbugs-Envelope-To: 77732
Cc: Johann =?utf-8?Q?H=C3=B6chtl?= <johann.hoechtl@HIDDEN>,
 77732 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 2.6 (++)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 
 Content preview:  [வெள்ளி ஏப்ரல் 11, 2025] Eli Zaretskii
    wrote: >> From: Johann Höchtl >> Date: Fri, 11 Apr 2025 11:33:59 +0200 >>
    >> I am using Emacs from HEAD on Windows >> >> I tried to reproduce the behaviour
    with emacs -Q but it still remains inconsistent. [...] 
 
 Content analysis details:   (2.6 points, 10.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -0.0 RCVD_IN_DNSWL_NONE     RBL: Sender listed at https://www.dnswl.org/,
                              no trust
                             [2607:f8b0:4864:20:0:0:0:543 listed in]
                             [list.dnswl.org]
  3.6 RCVD_IN_SBL_CSS        RBL: Received via a relay in Spamhaus SBL-CSS
                             [1.7.159.71 listed in zen.spamhaus.org]
 -0.0 SPF_PASS               SPF: sender matches SPF record
  0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
  0.0 FREEMAIL_FROM          Sender email is commonly abused enduser mail
                             provider (visuweshm[at]gmail.com)
 -1.0 MAILING_LIST_MULTI     Multiple indicators imply a widely-seen list
                             manager

--=-=-=
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

[=E0=AE=B5=E0=AF=86=E0=AE=B3=E0=AF=8D=E0=AE=B3=E0=AE=BF =E0=AE=8F=E0=AE=AA=
=E0=AF=8D=E0=AE=B0=E0=AE=B2=E0=AF=8D 11, 2025] Eli Zaretskii wrote:

>> From: Johann H=C3=B6chtl <johann.hoechtl@HIDDEN>
>> Date: Fri, 11 Apr 2025 11:33:59 +0200
>>=20
>> I am using Emacs from HEAD on Windows
>>=20
>> I tried to reproduce the behaviour with emacs -Q but it still remains in=
consistent.
>>=20
>> When I rgrep and there are few results (< 15) , I can enter grep buffer =
pres 'e' to enter grep-edit mode, get
>> out of it with C-c C-c, re-enter with 'e' and so on.
>>=20
>> When there are more results, (between 15 and 70)  I still can enter with=
 'e' get out with C-c C-c but when I try
>> to re-enter I get the error message Wrong type argument: stringp, nil
>> The buffer later although still in grp-mode does not behave any longer a=
s a grep mode, 'g' or 'e' results in the
>> error Buffer is read only : #<buffer *grep*>
>>=20
>> When there are many results, I get the error message Wrong type argument=
: stringp, nil already on the first
>> invocation attempt.
>
> I cannot reproduce this with today's master branch on MS-Windows.  I
> just tried with a Grep command that yielded 128 hits, and didn't see
> any errors.

It seems like the number of hits is specific for this bug to hit.

> Please show the complete recipe for reproducing the problem, with all
> the steps and commands explicitly shown.  It is best if you can show
> this in the Emacs source tree, so that all of us can easily try the
> same recipe with the same files.

Here's a reproduction:

  1. Download the attachment cp2k-mode.el
  2. emacs -Q
  3. M-x grep RET
  4. After '-e' in the command, type " '^(def[^ ]\+ cp2k-' cp2k-mode.el".
  5. The above grep command should produce 17 hits.
  6. Say e.
  7. Say C-c C-c.
  8. Say e.
  9. After this, move your point to "Grep finished..." message, and
     inspect the value of the text-property compilation-message.  It
     should have a non-nil value.
  10. Say C-c.
  11. Say e, and witness the reported error.

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.  We could bail from calling grep-edit--prepare-buffer if we
detect an occur-target-prefix text-property but there might be a deeper
seated bug somewhere.

diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el
index b0105f08ea2..ec2b600971c 100644
--- a/lisp/progmodes/grep.el
+++ b/lisp/progmodes/grep.el
@@ -1055,15 +1055,18 @@ grep
 (defun grep-edit--prepare-buffer ()
   "Mark relevant regions read-only, and add relevant occur text-properties=
."
   (save-excursion
+    (message "----")
     (goto-char (point-min))
     (let ((inhibit-read-only t)
           (dummy (make-marker))
           match)
-      (while (setq match (text-property-search-forward 'compilation-annota=
tion))
+      (while (setq match (text-property-search-forward 'compilation-annota=
tion
+                                                       nil (lambda (_val p=
rop-val) prop-val)))
         (add-text-properties (prop-match-beginning match) (prop-match-end =
match)
                              '(read-only t)))
       (goto-char (point-min))
       (while (setq match (text-property-search-forward 'compilation-messag=
e))
+        (message "%S %S" (point) (get-text-property 2527 'compilation-mess=
age))
         (add-text-properties (prop-match-beginning match) (prop-match-end =
match)
                              '(read-only t occur-prefix t))
         (let ((loc (compilation--message->loc (prop-match-value match)))
@@ -1078,7 +1081,8 @@ grep-edit--prepare-buffer
                                     (prop-match-end match)
                                     'compilation-message)
                                    (1+ (pos-eol)))
-                               `(occur-target ((,m . ,m)))))))))
+                               `(occur-target ((,m . ,m))))))
+      (message "%S %S" (point) (get-text-property 2527 'compilation-messag=
e)))))
=20
 (defvar-keymap grep-edit-mode-map
   :doc "Keymap for `grep-edit-mode'."
@@ -1109,21 +1113,26 @@ grep-change-to-grep-edit-mode
   (when (get-buffer-process (current-buffer))
     (error "Cannot switch when grep is running"))
   (use-local-map grep-edit-mode-map)
+  (message "before prep %S %S" (point) (get-text-property 2527 'compilatio=
n-message))
   (grep-edit--prepare-buffer)
+  (message "after prep %S %S" (point) (get-text-property 2527 'compilation=
-message))
   (setq buffer-read-only nil)
   (setq major-mode 'grep-edit-mode)
   (setq mode-name "Grep-Edit")
   (buffer-enable-undo)
+  (message "after undo %S %S" (point) (get-text-property 2527 'compilation=
-message))
   (set-buffer-modified-p nil)
   (setq buffer-undo-list nil)
   (add-hook 'after-change-functions #'occur-after-change-function nil t)
   (run-mode-hooks 'grep-edit-mode-hook)
+  (message "after hook %S %S" (point) (get-text-property 2527 'compilation=
-message))
   (message (substitute-command-keys
             "Editing: Type \\[grep-edit-save-changes] to return to Grep mo=
de")))
=20
 (defun grep-edit-save-changes ()
   "Switch back to Grep mode."
   (interactive)
+  (message "%S %S" (point) (get-text-property 2527 'compilation-message))
   (unless (derived-mode-p 'grep-edit-mode)
     (error "Not a Grep-Edit buffer"))
   (remove-hook 'after-change-functions #'occur-after-change-function t)
@@ -1134,7 +1143,8 @@ grep-edit-save-changes
   (force-mode-line-update)
   (buffer-disable-undo)
   (setq buffer-undo-list t)
-  (message "Switching to Grep mode"))
+  (message "Switching to Grep mode")
+  (message "%S %S" (point) (get-text-property 2527 'compilation-message)))
=20
 ;;;###autoload
 (defun grep-find (command-args)


--=-=-=
Content-Type: application/emacs-lisp
Content-Disposition: attachment; filename=cp2k-mode.el
Content-Transfer-Encoding: quoted-printable

;;;;; Emacs major mode for cp2k input, written by Lianheng Tong  -*- lexica=
l-binding: t; -*-
;;;;; Copyright (c) Lianheng Tong
;;;;; Last modify date: Saturday, 2014/01/25

;;;; Syntax highlighting of keywords
(defconst cp2k-font-lock-keywords
  (rx-let ((spc (+ (any " \t")))
           (maybe-spc (* (any " \t")))
           (cp2k-bol (seq bol maybe-spc)))
    ;; Blocks.
    `((,(rx cp2k-bol
            (group "&"
                   ;; Consider BEGIN and END lines.
                   (? "END" maybe-spc)
                   (1+ (syntax word))))
       (1 font-lock-function-name-face))
      ;; Keywords.
      (,(rx cp2k-bol
            bow (group (not (any "0-9" "@$&"))
                       (1+ (syntax word)))
            spc
            (? (1+ (syntax word))))
       (1 font-lock-keyword-face))
      ;; Preprocessor type 1.
      (,(rx cp2k-bol
            (group "@" (or "IF" "INCLUDE" "ENDIF")))
       (1 font-lock-preprocessor-face))
      ;; Preprocessor type 2.
      (,(rx cp2k-bol
            (group "@SET")
            spc (group (1+ (syntax word))))
       (1 font-lock-preprocessor-face) (2 font-lock-variable-name-face nil =
t))
      ;; variables
      (,(rx "$" (? "{")
            (group (1+ (syntax word)))
            (? "}"))
       (1 font-lock-variable-name-face))))
  "Font-lock keywords for `cp2k-mode'.")

;;;; Syntax table
(defconst cp2k-mode-syntax-table
  (let ((st (make-syntax-table)))
    (modify-syntax-entry ?# "<" st)   ; #  is beg. comment
    (modify-syntax-entry ?! "<" st)   ; !  is beg. comment
    (modify-syntax-entry ?\n ">" st)  ; \n is end. comment
    (modify-syntax-entry ?_ "w" st)   ; underscore is part of names
    (modify-syntax-entry ?\' "\"" st) ; string quote
    (modify-syntax-entry ?\" "\"" st) ; string quote
    (modify-syntax-entry ?\r "-" st)  ; return is whitespace
    (modify-syntax-entry ?+ "." st)   ; + is puntuation
    (modify-syntax-entry ?- "." st)   ; - is puntuation
    (modify-syntax-entry ?* "." st)   ; * is puntuation
    (modify-syntax-entry ?/ "." st)   ; / is puntuation
    (modify-syntax-entry ?=3D "." st)   ; =3D is puntuation
    (modify-syntax-entry ?\\ "\\" st) ; \ is escape char
    st)
  "Syntax table for `cp2k-mode'.")

;;;; Define keymap for the major mode
(defvar cp2k-mode-map
  (let ((map (make-sparse-keymap)))
    ;; Define mode specific key-bindings here
    (define-key map (kbd "C-j")     #'newline-and-indent)
    (define-key map (kbd "C-c ;")   #'comment-region)
    (define-key map (kbd "TAB")     #'cp2k-indent-line)
    (define-key map (kbd "C-M-a")   #'cp2k-beginning-of-block)
    (define-key map (kbd "C-M-e")   #'cp2k-end-of-block)
    (define-key map (kbd "C-c C-c") #'outline-toggle-children)
    (define-key map (kbd "C-c C-a") #'outline-show-all)
    (define-key map (kbd "C-c C-t") #'outline-show-subtree)
    map)
  "Keymap for `cp2k-mode'.")

;;;; Syntax indentation
(defvar cp2k-indent
  2
  "standard indentation for in `cp2k-mode'")

(defconst cp2k-emptyline
  "^\\s-*$"
  "regexp matching an empty line in `cp2k-mode'")

(defconst cp2k-opening
  ;; note that this definition also matches cp2k-closing, so for
  ;; positive identification of cp2k-opening, one must use AND
  ;; construct with (not lookingat cp2k-closing).  One way to avoid
  ;; this is to construct search for line that does NOT contain END,
  ;; however, practical implementation of that leads to emacs
  ;; occasionally throwing the exception "regex stack overflow"...
  ;; The emacs regex search is pretty crudely implemented, and it is
  ;; far more robust to do a positive search, than negative
  ;; searches. So I opted for this more crude method here.
  (rx bol (* (any " \t"))
      (or (seq "&" (1+ (syntax word)))
          (seq "@IF" eow)))
;;  "^[ \t]*\\(\\(&\\sw+\\)\\|\\(@IF\\>\\)\\)"
  "regexp matching lines starting (or closing --- due to
  limitations in regex implementation) a cp2k block in
  `cp2k-mode'")

(defconst cp2k-closing
  (rx bol (* any " \t")
      (or (seq "&END" (* any) eol)
          (seq "@ENDIF" eow))
      eol)
  ;;"^[ \t]*\\(\\(&END[ \t]*.*$\\)\\|\\(@ENDIF\\>\\)\\).*$"
  "regexp matching lines closing a cp2k block in `cp2k-mode'")

(defsubst cp2k-at-opening-p ()
  "Return non-nil if looking at a section opening line."
  (and (looking-at-p cp2k-opening)
       (not (looking-at-p cp2k-closing))))

(defsubst cp2k-at-closing-p ()
  "Return non-nil if looking at a section closing line."
  (looking-at-p cp2k-closing))

(defun cp2k-beginning-of-block (&optional not-set-mark)
  "move the cursor to the beginning of the block in `cp2k-mode'"
  (interactive)
  (if (not not-set-mark)
      (push-mark))
  (beginning-of-line)
  (let ((find-opening t)
        (in-nested nil)
        (initial-opening nil))
    ;; If at section opening, search for the parent.
    (when (and (cp2k-at-opening-p)
               (not (bobp)))
      (setq initial-opening t))
    (while (and find-opening (not (bobp)))
      ;; We are not in a nested situation, and we found the necessary
      ;; section opening.
      (if (and (cp2k-at-opening-p)
               (not in-nested)
               (not initial-opening))
          (setq find-opening nil)
        (when (cp2k-at-opening-p)
          (setq in-nested nil)
          (setq initial-opening nil))
        (forward-line -1)
        ;; If the line is a closing statement, skip to the line of
        ;; the opening statement.
        (when (cp2k-at-closing-p)
          (setq in-nested t)
          (cp2k-beginning-of-block t))))))

(defun cp2k-end-of-block (&optional not-set-mark)
  "move the cursor to the ending of the block in `cp2k-mode'"
  (interactive)
  (if (not not-set-mark)
      (push-mark))
  (beginning-of-line)
  (let ((find-closing t)
        (in-nested nil)
        (initial-closing nil))
    ;; If at section closing, search for the parent.
    (if (and (cp2k-at-closing-p)
             (not (eobp)))
        (setq initial-closing t))
    (while (and find-closing (not (eobp)))
      (if (and (cp2k-at-closing-p)
               (not in-nested)
               (not initial-closing))
          (setq find-closing nil)
        (when (cp2k-at-closing-p)
          (setq in-nested nil)
          (setq initial-closing nil))
        (forward-line 1)
        ;; If the line is a opening statement, skip to the line of
        ;; the closing statement.
        (when (cp2k-at-opening-p)
          (setq in-nested t)
          (cp2k-end-of-block t))))))

(defun cp2k-forward-one-line ()
  "move the cursor forward one line, ignore empty or comment lines, in `cp2=
k-mode'"
  (beginning-of-line)
  (forward-line 1)
  (while (and (or (looking-at cp2k-emptyline)
                  (looking-at "^[ \t]*#"))
              (not (eobp)))
    (forward-line 1)))

(defun cp2k-backward-one-line ()
  "move the cursor forward one line, ignore empty or comment lines, in `cp2=
k-mode'"
  (beginning-of-line)
  (forward-line -1)
  (while (and (or (looking-at cp2k-emptyline)
                  (looking-at "^[ \t]*#"))
              (not (bobp)))
    (forward-line -1)))

(defun cp2k-left-of-point-is-empty ()
  "check if the left of the point is only white space in `cp2k-mode'"
  (let (not-empty)
    (save-excursion
      (setq not-empty
            (re-search-backward "[^ \t]" (line-beginning-position) t 1)))
    (not not-empty)))

(defun cp2k-indent-line ()
  "indent current line in `cp2k-mode'"
  (interactive)
  (let ((indent 0)
        (position (point-marker)))
    ;; record initial indentation position
    (back-to-indentation)
    (indent-line-to
     (max
      0
      (catch 'indentation
        (save-excursion
          (beginning-of-line)
          (and (bobp) (throw 'indentation 0))
          ;; get the block indentation
          (save-excursion
            (cp2k-beginning-of-block t)
            (setq indent (current-indentation)))
          ;; look at the current line
          (when (cp2k-at-closing-p)
            (throw 'indentation indent))
          ;; move up one non-empty line
          (cp2k-backward-one-line)
          (setq indent (current-indentation))
          (when (cp2k-at-opening-p)
            (setq indent (+ indent cp2k-indent)))
          (throw 'indentation indent)))))
    ;; move cursor to indentation point if in the beginning white
    ;; space otherwise leave unchanged
    (goto-char position)
    (when (cp2k-left-of-point-is-empty)
      (back-to-indentation))
    (set-marker position nil)))

;;;; Define mode hook
(defvar cp2k-mode-hook nil)

;;;; Entry function
(define-derived-mode cp2k-mode fundamental-mode "cp2k"
  "Major mode for editing cp2k input. Copyright (c) Lianheng Tong 2013/12/0=
6"
  :syntax-table cp2k-mode-syntax-table
  ;; setq-local is undefined in emacs versions prior 24.3, it is
  ;; equivalent to make-local-variable, and followed by setq, and this
  ;; is what has been used here. This works for older versions of
  ;; emacs.
  (make-local-variable 'comment-start)
  (setq comment-start "# ")
  (make-local-variable 'comment-start-skip)
  (setq comment-start-skip "#+\\s-*")
  ;; see emacs manual on font-lock-defaults, nil here means also
  ;; font-lock comments and strings, and t means the value of
  ;; font-lock-keywords-case-fold-search is set to non-nil, allowing
  ;; case insensitive search
  (make-local-variable 'font-lock-defaults)
  (setq font-lock-defaults '(cp2k-font-lock-keywords nil t))
  ;; whether the indentation key-word search case-sensitive or not (in
  ;; my implementation, using looking-at function) is effected only by
  ;; the variable case-fold-search, and is uneffected by
  ;; font-lock-keywords-case-fold-search. So turn case-fold-search on
  ;; just in case
  (make-local-variable 'case-fold-search)
  (setq case-fold-search t)
  (make-local-variable 'indent-line-function)
  (setq indent-line-function 'cp2k-indent-line))

;;;; Add to autoload alist
(add-to-list 'auto-mode-alist '("\\.cp2kin\\'" . cp2k-mode))

;;;; Setup outline mode
(when (require 'outline nil 'noerror)
  (add-hook 'cp2k-mode-hook 'outline-minor-mode)
  ;; in outline mode, the level of header depends on the length of
  ;; match, which suits our purposes quite well
  (setq outline-regexp "[ \t]*\\(&\\|@\\(IF\\|EN\\)\\)"))

;;;; Last line
(provide 'cp2k-mode)

--=-=-=--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#77732; Package emacs. Full text available.

Message received at 77732 <at> debbugs.gnu.org:


Received: (at 77732) by debbugs.gnu.org; 11 Apr 2025 11:57:55 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Apr 11 07:57:55 2025
Received: from localhost ([127.0.0.1]:49237 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1u3D18-0007hA-OC
	for submit <at> debbugs.gnu.org; Fri, 11 Apr 2025 07:57:55 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:41562)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1u3D15-0007gn-Qt
 for 77732 <at> debbugs.gnu.org; Fri, 11 Apr 2025 07:57:52 -0400
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 <eliz@HIDDEN>)
 id 1u3D10-0003MY-GY; Fri, 11 Apr 2025 07:57:46 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From:
 Date; bh=IwEBYeOmNGm/jiy9ubtU3WPn3dHQrOzNnJTMFbSa9no=; b=KLD5HNMpC7HBrNY1UGV9
 3B13Fe+75cYxNga/GYPebwUBnAb9FU2BEG8hNNWYwq+sL/L0GZMXQ1Q6lOch5X2NgiiSF3J4Bu/7R
 BatS6q/EwaqUT9dAQB1muw6y94Lweb6Cd+qwALRKY+ksGvL2hK86nt0GOrO+ZneQDF1H1MmXQ+cm0
 7biUzMv+IAFaRfIAh6yfi6N9eqMQkJvBcL6E5ZSBSMfHqWLxnxdFBjyYAqDyfWJwtXpZ1iaHUrPfo
 kpVzqi2KqgZ1U+KbNqqIB7N4qDHxG/xBDpZ4IM0K+Ph1Hkrp8STuESYODQoqhj4NkV7WiL5ujd1Q9
 De+2XxvEw5eILA==;
Date: Fri, 11 Apr 2025 14:57:42 +0300
Message-Id: <86wmbqoqq1.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Johann =?utf-8?Q?H=C3=B6chtl?= <johann.hoechtl@HIDDEN>
In-Reply-To: <CAH4isRxsU63ycL-Ckr=v86sHEzoMvT-6ZrGiLroZUmLwof2ung@HIDDEN>
 (message from Johann =?utf-8?Q?H=C3=B6chtl?= on Fri, 11 Apr 2025 11:33:59
 +0200)
Subject: Re: bug#77732: grep-edit-buffer errors with incionsistent behaviour
References: <CAH4isRxsU63ycL-Ckr=v86sHEzoMvT-6ZrGiLroZUmLwof2ung@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 77732
Cc: 77732 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Johann Höchtl <johann.hoechtl@HIDDEN>
> Date: Fri, 11 Apr 2025 11:33:59 +0200
> 
> I am using Emacs from HEAD on Windows
> 
> I tried to reproduce the behaviour with emacs -Q but it still remains inconsistent.
> 
> When I rgrep and there are few results (< 15) , I can enter grep buffer pres 'e' to enter grep-edit mode, get
> out of it with C-c C-c, re-enter with 'e' and so on.
> 
> When there are more results, (between 15 and 70)  I still can enter with 'e' get out with C-c C-c but when I try
> to re-enter I get the error message Wrong type argument: stringp, nil
> The buffer later although still in grp-mode does not behave any longer as a grep mode, 'g' or 'e' results in the
> error Buffer is read only : #<buffer *grep*>
> 
> When there are many results, I get the error message Wrong type argument: stringp, nil already on the first
> invocation attempt.

I cannot reproduce this with today's master branch on MS-Windows.  I
just tried with a Grep command that yielded 128 hits, and didn't see
any errors.

Please show the complete recipe for reproducing the problem, with all
the steps and commands explicitly shown.  It is best if you can show
this in the Emacs source tree, so that all of us can easily try the
same recipe with the same files.

Thanks.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#77732; Package emacs. Full text available.

Message received at 77732 <at> debbugs.gnu.org:


Received: (at 77732) by debbugs.gnu.org; 11 Apr 2025 11:51:54 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Apr 11 07:51:54 2025
Received: from localhost ([127.0.0.1]:49220 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1u3CvJ-0007Na-PM
	for submit <at> debbugs.gnu.org; Fri, 11 Apr 2025 07:51:54 -0400
Received: from mail-pg1-x541.google.com ([2607:f8b0:4864:20::541]:42151)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <visuweshm@HIDDEN>)
 id 1u3CvG-0007NF-Mw
 for 77732 <at> debbugs.gnu.org; Fri, 11 Apr 2025 07:51:51 -0400
Received: by mail-pg1-x541.google.com with SMTP id
 41be03b00d2f7-af52a624283so1625508a12.0
 for <77732 <at> debbugs.gnu.org>; Fri, 11 Apr 2025 04:51:50 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1744372304; x=1744977104; darn=debbugs.gnu.org;
 h=content-transfer-encoding:mime-version:message-id:date:user-agent
 :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date
 :message-id:reply-to;
 bh=QEZFCc5PMkMuprUJCMDWccWRpZGl5H50kw9rdUzWlIQ=;
 b=HwUT0/Jk3D1ZTro01wE8SEWgTgpcemnqezA8RPZry2v8f58YSayib9IBhMHvuBauWK
 l2xmyLWTfFpdyBGzGE+xcN9s69D0+9ykr2O4K8SdQafVIh7bs0nOQFwGemzfErVcSz5f
 gq6YUMiqj5wPhqfjTbje49uPYeOc8cO5O6PUX3lo0wvCFEA3nSv4t75FUYDez0KzcuiX
 zQGx3y//c3gtg7vxd31dyD1vyiad43u59cgIa0E5Maf3mcGIcsYAI2G+z8qfTnEIoGFi
 tdn5Jvlus/zZrykDECQ5PzLcd7dgJBGXD4tiWl/dPPDga+TUnvdUmybUv+D3bf43sXkz
 3sBw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1744372304; x=1744977104;
 h=content-transfer-encoding:mime-version:message-id:date:user-agent
 :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from
 :to:cc:subject:date:message-id:reply-to;
 bh=QEZFCc5PMkMuprUJCMDWccWRpZGl5H50kw9rdUzWlIQ=;
 b=uGOxm9pTBVQ3wJ9kcVe/N3HYEfbGzq5Lgfejq9lRy62ZOxYci9OMgC4v6AZva853eG
 znoFiHuo7i7m3dahLAMDfZIuyBk/9dCrF3VjUFuB8pzBJNPmkO07bF/5+ykT9FtHFkNG
 Y4tZaIgrSywbVb9fnNa1yO0BIfhLasvJtlq9BlzI/br+wno3gGY/pODkiABBasrQOJN8
 noU3GHmGrDWTbWcwWcU/xR3+tXbURucd5GiWs1qBx+peu6FvFlbJOsVi1i3nluIm7v8v
 CBPlXaWM3HbAMVPgiek9ZnIOAphyqdhqlH3Go5Egp0boffTkWzr8YxYCX71gpw0qQduJ
 RNwg==
X-Gm-Message-State: AOJu0YwuT3Un8YcBkrW3Vd2c+7DJU1Fp8StNznhMIkNeqR+ao7TSquzW
 149F9Q1cKt9jvT3chwMdPNm3Go5//gBzH90ePCwa6aU41XD+H7Qw
X-Gm-Gg: ASbGncuEwt+MO7P3CCXA4Z5us3k6DlUm8AtoWCloTHLSE6Ip9dJRQCqjFOsZ1/pKCFU
 WGJVwjQGXo2I7Os5PDOtSaSMBL1YLZDZ2kgNsGKil2/jy9MIstqHP/ZHjm3dad/FLtGK427dc6W
 x+b/roiTk+P80Qd/pY0U33iTBhfFE4uOQQLKqUVCwpHPT9k0f8Z9hQQVDBM3Yl5C6hgqSX8zuLR
 5I0twiTyG0T0BEGaM6bQalkqbIk8IseH1T8ieJafy5vQEALqAUiLeN2htcOstpltmXS9te5+I8Q
 beWZbgTADTzNu+ldJbOCQQi2jGLTFz0QlTxBug==
X-Google-Smtp-Source: AGHT+IEh4pb+qkF0Ldy86doByvfoDGoLsdQNf7PlZn4AKjKTCfL9kBDIudq9xb8tf6QQcPK+sR72RQ==
X-Received: by 2002:a17:90b:2b8f:b0:2ee:c30f:33c9 with SMTP id
 98e67ed59e1d1-30823672ee2mr4201206a91.14.1744372304523; 
 Fri, 11 Apr 2025 04:51:44 -0700 (PDT)
Received: from localhost ([115.240.90.130])
 by smtp.gmail.com with UTF8SMTPSA id
 98e67ed59e1d1-306df06a1aesm5335650a91.5.2025.04.11.04.51.43
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 11 Apr 2025 04:51:44 -0700 (PDT)
From: Visuwesh <visuweshm@HIDDEN>
To: Johann =?utf-8?Q?H=C3=B6chtl?= <johann.hoechtl@HIDDEN>
Subject: Re: bug#77732: grep-edit-buffer errors with incionsistent behaviour
In-Reply-To: <CAH4isRwy=jou7YaQSKuJCOstQOJKFQi2qwJg3aBRKyJ=-JiPcw@HIDDEN>
References: <CAH4isRxsU63ycL-Ckr=v86sHEzoMvT-6ZrGiLroZUmLwof2ung@HIDDEN>
 <87plhj7zlp.fsf@HIDDEN>
 <CAH4isRwy=jou7YaQSKuJCOstQOJKFQi2qwJg3aBRKyJ=-JiPcw@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
Date: Fri, 11 Apr 2025 17:21:40 +0530
Message-ID: <87frie9ar7.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 77732
Cc: 77732 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

[ Please use Reply All in your mail client to ensure the entire
  conversation is recorded in the bug tracker.  ]

[=E0=AE=B5=E0=AF=86=E0=AE=B3=E0=AF=8D=E0=AE=B3=E0=AE=BF =E0=AE=8F=E0=AE=AA=
=E0=AF=8D=E0=AE=B0=E0=AE=B2=E0=AF=8D 11, 2025] Johann H=C3=B6chtl wrote:

> First thank you for the hint of toggle-debug-on-error, TIL
>
> The trace:
>
> Debugger entered--Lisp error: (wrong-type-argument stringp nil)
>   compilation-find-file-1(#<marker in no buffer> "Grep started at Fri Apr
> 11 12" nil nil)
>   compilation-find-file(#<marker in no buffer> "Grep started at Fri Apr 11
> 12" nil)
>   compilation--update-markers((nil 58 (("Grep started at Fri Apr 11 12"
> nil) nil (58 #1)) nil nil) #<marker in no buffer> nil 0)
>   grep-edit--prepare-buffer()
>   grep-change-to-grep-edit-mode()
>   funcall-interactively(grep-change-to-grep-edit-mode)
>   command-execute(grep-change-to-grep-edit-mode)
>
>
> The buffer starts the following:
>
> -*- mode: grep; default-directory: "~/OneDrive - Online/Dokumente/" -*-
> Grep started at Fri Apr 11 12:58:57
>

I can reproduce the issue with 17 hits but not with >200.  I will try
digging into this more.

> Am Fr., 11. Apr. 2025 um 12:37 Uhr schrieb Visuwesh <visuweshm@HIDDEN>:
>
>> [=E0=AE=B5=E0=AF=86=E0=AE=B3=E0=AF=8D=E0=AE=B3=E0=AE=BF =E0=AE=8F=E0=AE=
=AA=E0=AF=8D=E0=AE=B0=E0=AE=B2=E0=AF=8D 11, 2025] Johann H=C3=B6chtl wrote:
>>
>> > I am using Emacs from HEAD on Windows
>> >
>> > I tried to reproduce the behaviour with emacs -Q but it still remains
>> > inconsistent.
>> >
>> > When I rgrep and there are few results (< 15) , I can enter grep buffer
>> > pres 'e' to enter grep-edit mode, get out of it with C-c C-c, re-enter
>> with
>> > 'e' and so on.
>> >
>> > When there are more results, (between 15 and 70)  I still can enter wi=
th
>> > 'e' get out with C-c C-c but when I try to re-enter I get the error
>> message
>> > Wrong type argument: stringp, nil
>> > The buffer later although still in grp-mode does not behave any longer
>> as a
>> > grep mode, 'g' or 'e' results in the error Buffer is read only : #<buf=
fer
>> > *grep*>
>> >
>> > When there are many results, I get the error message Wrong type argume=
nt:
>> > stringp, nil already on the first invocation attempt.
>> >
>> > Thew boundaries are somewhat moving but at least I have the feeling the
>> > more matches are, the more frequently I run into the
>> >
>> > Wrong type argument: stringp, nil
>> >
>> > already at first try.
>>
>> Can you please share the backtrace?  Say M-x toggle-debug-on-error RET
>> before trying to reproduce the error above.  I mostly tested
>> grep-edit-mode with M-x rgrep, and a good amount of results.
>>




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#77732; Package emacs. Full text available.

Message received at 77732 <at> debbugs.gnu.org:


Received: (at 77732) by debbugs.gnu.org; 11 Apr 2025 10:38:08 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Apr 11 06:38:08 2025
Received: from localhost ([127.0.0.1]:48943 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1u3Blw-0000Ze-1j
	for submit <at> debbugs.gnu.org; Fri, 11 Apr 2025 06:38:08 -0400
Received: from mail-pl1-x642.google.com ([2607:f8b0:4864:20::642]:43172)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <visuweshm@HIDDEN>)
 id 1u3Blt-0000Z6-1b
 for 77732 <at> debbugs.gnu.org; Fri, 11 Apr 2025 06:38:05 -0400
Received: by mail-pl1-x642.google.com with SMTP id
 d9443c01a7336-225df540edcso29826525ad.0
 for <77732 <at> debbugs.gnu.org>; Fri, 11 Apr 2025 03:38:05 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1744367879; x=1744972679; darn=debbugs.gnu.org;
 h=content-transfer-encoding:mime-version:user-agent:message-id:date
 :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date
 :message-id:reply-to;
 bh=e5/PwgdCozFitc7uvgNkzRXV7WRS696eqYb9GAT0QIc=;
 b=l+xZ57Xjv7/ABNdZPeJJJ+csZOxRYz0XUJXQl/eQjnIIEct2HHn+ftSCZQ6DV0tx1C
 rkvivGBkxRfMkDgypFMHDm8ZB3LwPf1VY/t4oCUgO5vSuKZcex075YvSzPdJusfVCZ6r
 MnhZN/5VDhPmv6cwwatftF8n6BppNw0txLdV38GamBTRQNMSBoY3aEp7t9rJZ2ZfM8yK
 XQrgfZs5im7CSonSuWmqK3YXqSaTqQ1ihsigOt+B/61jqrXiWbaE8G84vmI9j+5gnLR/
 gu2b4mfHQqpxdoX2gVM2+E0P4tX8EAS50K7maldyRK+rrFHPi7tl3g6Kx/CgpmwV0TS0
 FEvg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1744367879; x=1744972679;
 h=content-transfer-encoding:mime-version:user-agent:message-id:date
 :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from
 :to:cc:subject:date:message-id:reply-to;
 bh=e5/PwgdCozFitc7uvgNkzRXV7WRS696eqYb9GAT0QIc=;
 b=JhmxTNrKIRK30/BIj3gCf2w+m815mNodITsFkVQA0DweiysnzQQx6Jlo/yrQbJpSdF
 YK/JvTL/IFsJfnV/bd/6E4ei+dII7GCZAXgR48RUJp4sZ3vQjn78QG06AL0mX9UQupQO
 wc7Lsv3mlHWMEQ2ICqpZTA9RJ6ma2aNSxJ+GHUeAZAR4vvL+xghvPjDIakrjY6O/l5uJ
 DbjnmbU0n0UBHajwAiRMgast2Ug8BzviCspaLo1edIUm0E51yoQzSqkw07JRAEyf7OKr
 Gbl9WLWBL9144uETj2QU41sOIlK3uk5913gdeFq6sa7mHT4QZOPb585hzyz1XpQfKiw/
 U9wg==
X-Gm-Message-State: AOJu0YzhEg3+wfMS/VD9U3itXft9dLjkkZ3BiCFGVH8mlzMBSVFpP456
 H5jm+UnDHLyGMQPrje0DkvSjo6JZgQR2qoBo9LlTaCXF7YleIQG4
X-Gm-Gg: ASbGnctDSZk6F3n5ychXHc6ydTe9ARYyGZRNZLyFc28KO/KR+Arahm1Ea4Uz3hp78GY
 FVTsCIPNywLaJi3e2nVrCuJUCGRf5UNoJ8AFpk4yds4197pAarO8+Q9sWH12ibRRcVv59Y1XznF
 FlNyCVNKQPSrw2J4BIxWhAWV6VU5JdJ8Mu8OzAZbvsZn0R5NdBQBKWRLypzi5YymrJxHTKQmmJc
 EivSx2PDoMumCAVwkBplrcZAqDocn7XsXLpJURAa7g8RTfQhJtO6Py4OCvmYgw+D/M4YVJyZLL8
 dt7r9QfRdD7pm8PGvkobluhPxCC2KJvXRnbzE+8ZTAZj0ua7UFrx
X-Google-Smtp-Source: AGHT+IH71UfMU3uDYegnfFVWUKpV+QBeVeAYyv8I5+fJZMkvU5qfeeWvTjKADgdCttTHgeefTbdL7w==
X-Received: by 2002:a17:903:8cd:b0:224:3994:8a8c with SMTP id
 d9443c01a7336-22b69474cb3mr93968535ad.8.1744367878627; 
 Fri, 11 Apr 2025 03:37:58 -0700 (PDT)
Received: from localhost ([1.7.159.71]) by smtp.gmail.com with UTF8SMTPSA id
 d9443c01a7336-22ac7b65112sm45467135ad.19.2025.04.11.03.37.57
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 11 Apr 2025 03:37:58 -0700 (PDT)
From: Visuwesh <visuweshm@HIDDEN>
To: Johann =?utf-8?Q?H=C3=B6chtl?= <johann.hoechtl@HIDDEN>
Subject: Re: bug#77732: grep-edit-buffer errors with incionsistent behaviour
In-Reply-To: <CAH4isRxsU63ycL-Ckr=v86sHEzoMvT-6ZrGiLroZUmLwof2ung@HIDDEN>
References: <CAH4isRxsU63ycL-Ckr=v86sHEzoMvT-6ZrGiLroZUmLwof2ung@HIDDEN>
Date: Fri, 11 Apr 2025 16:07:54 +0530
Message-ID: <87plhj7zlp.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 3.6 (+++)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 
 Content preview:  [வெள்ளி ஏப்ரல் 11, 2025] Johann Höchtl
    wrote: > I am using Emacs from HEAD on Windows > > I tried to reproduce the
    behaviour with emacs -Q but it still remains > inconsistent. > > When I rgrep
    and there are few results (< 15) , I can enter grep b [...] 
 
 Content analysis details:   (3.6 points, 10.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -0.0 SPF_PASS               SPF: sender matches SPF record
  0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
  0.0 FREEMAIL_FROM          Sender email is commonly abused enduser mail
                             provider (visuweshm[at]gmail.com)
  3.6 RCVD_IN_SBL_CSS        RBL: Received via a relay in Spamhaus SBL-CSS
                             [1.7.159.71 listed in zen.spamhaus.org]
 -0.0 RCVD_IN_DNSWL_NONE     RBL: Sender listed at https://www.dnswl.org/,
                              no trust
                             [2607:f8b0:4864:20:0:0:0:642 listed in]
                             [list.dnswl.org]
X-Debbugs-Envelope-To: 77732
Cc: 77732 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 2.6 (++)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 
 Content preview:  [வெள்ளி ஏப்ரல் 11, 2025] Johann Höchtl
    wrote: > I am using Emacs from HEAD on Windows > > I tried to reproduce the
    behaviour with emacs -Q but it still remains > inconsistent. > > When I rgrep
    and there are few results (< 15) , I can enter grep b [...] 
 
 Content analysis details:   (2.6 points, 10.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -0.0 RCVD_IN_DNSWL_NONE     RBL: Sender listed at https://www.dnswl.org/,
                              no trust
                             [2607:f8b0:4864:20:0:0:0:642 listed in]
                             [list.dnswl.org]
  3.6 RCVD_IN_SBL_CSS        RBL: Received via a relay in Spamhaus SBL-CSS
                             [1.7.159.71 listed in zen.spamhaus.org]
 -0.0 SPF_PASS               SPF: sender matches SPF record
  0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
  0.0 FREEMAIL_FROM          Sender email is commonly abused enduser mail
                             provider (visuweshm[at]gmail.com)
 -1.0 MAILING_LIST_MULTI     Multiple indicators imply a widely-seen list
                             manager

[=E0=AE=B5=E0=AF=86=E0=AE=B3=E0=AF=8D=E0=AE=B3=E0=AE=BF =E0=AE=8F=E0=AE=AA=
=E0=AF=8D=E0=AE=B0=E0=AE=B2=E0=AF=8D 11, 2025] Johann H=C3=B6chtl wrote:

> I am using Emacs from HEAD on Windows
>
> I tried to reproduce the behaviour with emacs -Q but it still remains
> inconsistent.
>
> When I rgrep and there are few results (< 15) , I can enter grep buffer
> pres 'e' to enter grep-edit mode, get out of it with C-c C-c, re-enter wi=
th
> 'e' and so on.
>
> When there are more results, (between 15 and 70)  I still can enter with
> 'e' get out with C-c C-c but when I try to re-enter I get the error messa=
ge
> Wrong type argument: stringp, nil
> The buffer later although still in grp-mode does not behave any longer as=
 a
> grep mode, 'g' or 'e' results in the error Buffer is read only : #<buffer
> *grep*>
>
> When there are many results, I get the error message Wrong type argument:
> stringp, nil already on the first invocation attempt.
>
> Thew boundaries are somewhat moving but at least I have the feeling the
> more matches are, the more frequently I run into the
>
> Wrong type argument: stringp, nil
>
> already at first try.

Can you please share the backtrace?  Say M-x toggle-debug-on-error RET
before trying to reproduce the error above.  I mostly tested
grep-edit-mode with M-x rgrep, and a good amount of results.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#77732; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 11 Apr 2025 09:34:23 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Apr 11 05:34:23 2025
Received: from localhost ([127.0.0.1]:48762 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1u3AmE-0005Sl-Qf
	for submit <at> debbugs.gnu.org; Fri, 11 Apr 2025 05:34:23 -0400
Received: from lists.gnu.org ([2001:470:142::17]:37312)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <johann.hoechtl@HIDDEN>)
 id 1u3AmC-0005SW-73
 for submit <at> debbugs.gnu.org; Fri, 11 Apr 2025 05:34:20 -0400
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 <johann.hoechtl@HIDDEN>)
 id 1u3Am6-00068j-OK
 for bug-gnu-emacs@HIDDEN; Fri, 11 Apr 2025 05:34:14 -0400
Received: from mail-yw1-x112c.google.com ([2607:f8b0:4864:20::112c])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <johann.hoechtl@HIDDEN>)
 id 1u3Am5-0007XL-7J
 for bug-gnu-emacs@HIDDEN; Fri, 11 Apr 2025 05:34:14 -0400
Received: by mail-yw1-x112c.google.com with SMTP id
 00721157ae682-7043db8491dso18244937b3.0
 for <bug-gnu-emacs@HIDDEN>; Fri, 11 Apr 2025 02:34:12 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1744364051; x=1744968851; darn=gnu.org;
 h=to:subject:message-id:date:from:mime-version:from:to:cc:subject
 :date:message-id:reply-to;
 bh=RF6cALKpFI/lwOeQ/Nc/1TjY/bh4ZozgF+82LxEA4HM=;
 b=im/WREMqv6wY8G4wPK58071bcogKSZLNWpskw5DwORJidUgiotYhGN8Sn2zXct3fyp
 EiYsL7vKdQHEIY9NvAd/YQLTgguJVyJE0bZforBOnYlKjk2Q6Xb8z+Eow2gBYepXQ/ut
 vqP66lfueIDO5SuDRa4V+FO/ddpMEu6aoTmPF8TLFyV0IBzoiO4VxrGZdhchJf3pq3Ra
 jKcbmE2eGiX/1V0Njgz9BQ4I2jBGtAx9aHuVdqvajTANNmqVlyh/5O3clxpL9i5HSRnq
 PDKHKAIGrcWwuP8RsuS1COIQ/K6YIqIpnPkNm55AT2iGqlEteqDMKbGZU8kqI8tOGGL5
 9uRg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1744364051; x=1744968851;
 h=to:subject:message-id:date:from:mime-version:x-gm-message-state
 :from:to:cc:subject:date:message-id:reply-to;
 bh=RF6cALKpFI/lwOeQ/Nc/1TjY/bh4ZozgF+82LxEA4HM=;
 b=RnmudyUKQnzR3bl3jLBQo7VP8syxYbApGWu5gsbyb4CSN3+xzai5xGqT+CG3xid0kD
 +LVUqiRVoD0y95yuDx37aiWsLL9KoySE4Oi4ZLr+BJ8S74ZsBYGKNUEtg0jEudN4b9Tk
 Z32mCwbW9JJ/6oGUxZxU4edukOwThgFmPMc7OjJ+b0zqOKMx7PO3r6+2CMt/zdky9Aam
 XjPxVL4MXvQanrsKtZlbL35fkEBpLLuQY74zl6vsd2/e8o+URYBnqmJLxyxP4dfuw6d0
 cOjnJrD17ZeoJ1ngY1LqwMrhbfzJL0RiPJtgIwxuDsvSPzdMgHdg6uWSj80mmsUGaDlL
 lCaA==
X-Gm-Message-State: AOJu0YymHsWXKsVN6x/1MmAY0y8kVUnP+oOhoHY0KhPkvf5aPRFjqbSc
 oZXx3JasBAZmf97gYNEVOjoN/cCx00JQp3XUleoLG6s2EfeLR9Vi44AbAp8GBZ+nlvvKGHInVSP
 QFruggSq5QQp+Ep90e/G9bBP16+qlRcw=
X-Gm-Gg: ASbGncvJOM3hWfp5OZ2ogRThNK9LzBDKUMsP5Ir+8qIbv0Fa7QrWYdKJnP+wraJKIwC
 Cpx3jRrGUhAlVBlJ3iLGjKUyzMpW+DLpcOV00i28btGbSrDPvIa8xPv+eKCXbdYBGmhU9tuTjJc
 7UXroZQCcLV+rzXVJH4v88Rg==
X-Google-Smtp-Source: AGHT+IF/Tqq5j7hGvGaCRuBqcyRezZC+dFRUauSG2ovi3krpj5XIzFOs6yVvKJ9jGFHDrJ8m5SkcYkrEY0vElFxkpGA=
X-Received: by 2002:a05:690c:45c4:b0:6ff:28b2:50bd with SMTP id
 00721157ae682-70559981602mr32821057b3.2.1744364051416; Fri, 11 Apr 2025
 02:34:11 -0700 (PDT)
MIME-Version: 1.0
From: =?UTF-8?Q?Johann_H=C3=B6chtl?= <johann.hoechtl@HIDDEN>
Date: Fri, 11 Apr 2025 11:33:59 +0200
X-Gm-Features: ATxdqUHafRUnuUC41DjDcDNZbgGEQSO4FAZmfH8rzBEP4hpUf6G-9nnI6aozt-g
Message-ID: <CAH4isRxsU63ycL-Ckr=v86sHEzoMvT-6ZrGiLroZUmLwof2ung@HIDDEN>
Subject: grep-edit-buffer errors with incionsistent behaviour
To: bug-gnu-emacs@HIDDEN
Content-Type: multipart/alternative; boundary="000000000000a4d48806327d6768"
Received-SPF: pass client-ip=2607:f8b0:4864:20::112c;
 envelope-from=johann.hoechtl@HIDDEN; helo=mail-yw1-x112c.google.com
X-Spam_score_int: -20
X-Spam_score: -2.1
X-Spam_bar: --
X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001,
 HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: 1.0 (+)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.0 (/)

--000000000000a4d48806327d6768
Content-Type: text/plain; charset="UTF-8"

I am using Emacs from HEAD on Windows

I tried to reproduce the behaviour with emacs -Q but it still remains
inconsistent.

When I rgrep and there are few results (< 15) , I can enter grep buffer
pres 'e' to enter grep-edit mode, get out of it with C-c C-c, re-enter with
'e' and so on.

When there are more results, (between 15 and 70)  I still can enter with
'e' get out with C-c C-c but when I try to re-enter I get the error message
Wrong type argument: stringp, nil
The buffer later although still in grp-mode does not behave any longer as a
grep mode, 'g' or 'e' results in the error Buffer is read only : #<buffer
*grep*>

When there are many results, I get the error message Wrong type argument:
stringp, nil already on the first invocation attempt.

Thew boundaries are somewhat moving but at least I have the feeling the
more matches are, the more frequently I run into the

Wrong type argument: stringp, nil

already at first try.

--000000000000a4d48806327d6768
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr"><div>I am using Emacs from HEAD on Window=
s</div><div><br></div><div>I tried to reproduce the behaviour with emacs -Q=
 but it still remains inconsistent.</div><div><br></div><div>When I rgrep a=
nd there are few results (&lt; 15) , I can enter grep buffer pres &#39;e&#3=
9; to enter grep-edit mode, get out of it with C-c C-c, re-enter with &#39;=
e&#39; and so on.<br></div><div><br></div><div>When there are more results,=
 (between 15 and 70)=C2=A0 I still can enter with &#39;e&#39; get out with =
C-c C-c but when I try to re-enter I get the error message Wrong type argum=
ent: stringp, nil</div><div>The buffer later although still in grp-mode doe=
s not behave any longer as a grep mode, &#39;g&#39; or &#39;e&#39; results =
in the error Buffer is read only : #&lt;buffer *grep*&gt;</div><div><br></d=
iv><div>When there are many results, I get the error message=20
Wrong type argument: stringp, nil already on the first invocation attempt.<=
/div><div><br></div><div>Thew boundaries are somewhat moving but at least I=
 have the feeling the more matches are, the more frequently I run into the =
</div><div><br></div><div>
Wrong type argument: stringp, nil <br></div><div><br></div><div>already at =
first try.<br></div></div>
</div>

--000000000000a4d48806327d6768--




Acknowledgement sent to Johann Höchtl <johann.hoechtl@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#77732; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Sat, 12 Apr 2025 13:00:04 UTC

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