GNU bug report logs - #77747
'cursor-face-highlight-mode' signals 'args-out-of-range' in narrowed buffer

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: Ship Mints <shipmints@HIDDEN>; dated Fri, 11 Apr 2025 15:33:02 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

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


Received: (at 77747) by debbugs.gnu.org; 25 Apr 2025 13:51:44 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Apr 25 09:51:44 2025
Received: from localhost ([127.0.0.1]:49050 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1u8JSx-0005aN-6c
	for submit <at> debbugs.gnu.org; Fri, 25 Apr 2025 09:51:43 -0400
Received: from mail-vk1-xa2c.google.com ([2607:f8b0:4864:20::a2c]:52350)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <shipmints@HIDDEN>)
 id 1u8JSv-0005a2-2d
 for 77747 <at> debbugs.gnu.org; Fri, 25 Apr 2025 09:51:41 -0400
Received: by mail-vk1-xa2c.google.com with SMTP id
 71dfb90a1353d-525b44b7720so985135e0c.0
 for <77747 <at> debbugs.gnu.org>; Fri, 25 Apr 2025 06:51:41 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1745589095; x=1746193895; darn=debbugs.gnu.org;
 h=cc:to:subject:message-id:date:from:in-reply-to:references
 :mime-version:from:to:cc:subject:date:message-id:reply-to;
 bh=OgKewPP1w2JsBwLR+oVzibUyXYo+N0n82XLwsctRySY=;
 b=DhvKOJZMvqsmAHqkh51bqR74gnanasN0Fl48GCno1ghzCuVXKEy50TMPmWzO15Yx8A
 bo2jQgi721FMv1WjMpi260mMIDGbD9y/j1vDg2J9gvdi1P29Bdrgp3EBZhs6zmpWWMBL
 EhehxHNS6rjwhLPVugzLRG82+ME17qBoPsLamaXN9v4JmCqbTIv096wsSNXZgil1anUq
 JdjYmDnq1cfkd4R5nvcquA0iM/WDiJswOv5bLFK5RCn3pbocXiZtjNKzIJ2Ia8MT/IbX
 lg7IzYML3LTwXSgIKGCRwNsc59RFFbwFH/xU3axZBk3vH/Qln36+jSrO3KHmoA36YBfy
 lKeA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1745589095; x=1746193895;
 h=cc:to:subject:message-id:date:from:in-reply-to:references
 :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id
 :reply-to;
 bh=OgKewPP1w2JsBwLR+oVzibUyXYo+N0n82XLwsctRySY=;
 b=Zf942o+G4QfECSBs1NTHyZ0sSt3+QyZ8IwxeFxNwbvuRF0iSCuCF9SFMKfPOoc5F6a
 82HsMK9LJWLaZ8ixIdFjwgu16+5RhQYB0Z13lZVJGs5y4yXNmCbXMgGBIxV4OtUHTuqc
 yHbncYxfiisRMQxrNM1XpCMDfM3wzbQRwqSAJPn/VC0quNasuJUZG8ZovpU8WCfT5SP0
 Y7IuOa3FjF/EPSckLkEeMwLngnMVa8DgrQIDxC35KZmb7qF5gOWdyVIozTrzX4po4+FJ
 jHzPSEly639Ga8/BOHLVDd5iTlUbvlGzlAlVC0fDNTkRji+76pQGgmpmRAJgPMz1ErqS
 GOzA==
X-Gm-Message-State: AOJu0YyT9ZVZRF4aVrEylW37fBf3t0I0CFRiMsY8nUg19vRHslcwjwPX
 rf+8zupAwGIdYpv1dtfTzHfsY1frB4fJ5atuXnE+rUNdo+qE4icPERi8J4w3lWWRTQv7GmSzRhk
 Jn2d/PO+F15xmT8SajDYi/gftr0c=
X-Gm-Gg: ASbGnctGMImAT7vxq+RSBItzWijfwfWCa+3UI6ay1lpuzScLA+mAL/oLlohN4FULL2g
 T5JD68YkV9kL6EM+Fq/uehXaT+ETI6z3QuZXTGQGRV5yETvX26MlnjqBjGWDR2/jMu1nDpDiFVG
 0uMY/D6SrhOhu4wwWNgVGjgQ==
X-Google-Smtp-Source: AGHT+IFqOnmTWsOD2HkIfrsFNrib49N7Qam6lp5wxiiQ+xe13cUcOs3Gd3GEbplOtQ48TK2MMX8c66YrrLwGXolXhHA=
X-Received: by 2002:a05:6102:3e0e:b0:4c1:76a4:aee4 with SMTP id
 ada2fe7eead31-4d54516e869mr1316593137.19.1745589095271; Fri, 25 Apr 2025
 06:51:35 -0700 (PDT)
MIME-Version: 1.0
References: <CAN+1HbrcbGaR8atcJWL_VnPLMPaHEFB4-R4p97z4i=2=H+WKcg@HIDDEN>
 <86wmbojslo.fsf@HIDDEN>
In-Reply-To: <86wmbojslo.fsf@HIDDEN>
From: Ship Mints <shipmints@HIDDEN>
Date: Fri, 25 Apr 2025 09:51:22 -0400
X-Gm-Features: ATxdqUF2H2Ft-MrrxQVyOadYbtGE_my_3YCVdcWLhuzTjyrlDw9GH5iCPaEM2bg
Message-ID: <CAN+1HbqF-xEKitXhW=MNNYrBGhNom5OWyA9_MEEWELh=rsRBkg@HIDDEN>
Subject: Re: bug#77747: 'cursor-face-highlight-mode' signals
 'args-out-of-range' in narrowed buffer
To: Eli Zaretskii <eliz@HIDDEN>
Content-Type: multipart/alternative; boundary="000000000000f295d606339aa113"
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 77747
Cc: 77747 <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 (-)

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

On Sun, Apr 13, 2025 at 5:52=E2=80=AFAM Eli Zaretskii <eliz@HIDDEN> wrote:

> > From: Ship Mints <shipmints@HIDDEN>
> > Date: Fri, 11 Apr 2025 11:32:18 -0400
> >
> > -Q reproducer
> >
> > ;; The culprit appears to be `redisplay--update-cursor-face-highlight'
> > (setq debug-on-error t)
> > (cursor-face-highlight-mode)
> > (save-excursion (insert (propertize "cursor face text\n"
> >                                     'cursor-face 'region)))
> > (narrow-to-region (pos-bol) (pos-eol))
> > (setq unread-command-events (mapcar #'identity
> >                                     (kbd "C-n")))
>
> Thanks, does the below fix it?
>
> diff --git a/lisp/simple.el b/lisp/simple.el
> index ee09a6f..9e9dd15 100644
> --- a/lisp/simple.el
> +++ b/lisp/simple.el
> @@ -7265,7 +7265,7 @@ redisplay--update-cursor-face-highlight
>                (pt (window-point window))
>                (cursor-face (get-text-property pt 'cursor-face)))
>          (let* ((start (previous-single-property-change
> -                       (1+ pt) 'cursor-face nil (point-min)))
> +                       (min (1+ pt) (point-min)) 'cursor-face nil
> (point-min)))
>                 (end (next-single-property-change
>                       pt 'cursor-face nil (point-max)))
>                 (new (redisplay--highlight-overlay-function
>

Eli, possible to apply the above soon?

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

<div dir=3D"ltr"><div dir=3D"ltr"><div class=3D"gmail_default" style=3D"fon=
t-family:monospace"><span style=3D"font-family:Arial,Helvetica,sans-serif">=
On Sun, Apr 13, 2025 at 5:52=E2=80=AFAM Eli Zaretskii &lt;<a href=3D"mailto=
:eliz@HIDDEN">eliz@HIDDEN</a>&gt; wrote:</span></div></div><div class=3D"=
gmail_quote gmail_quote_container"><blockquote class=3D"gmail_quote" style=
=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding=
-left:1ex">&gt; From: Ship Mints &lt;<a href=3D"mailto:shipmints@HIDDEN"=
 target=3D"_blank">shipmints@HIDDEN</a>&gt;<br>
&gt; Date: Fri, 11 Apr 2025 11:32:18 -0400<br>
&gt; <br>
&gt; -Q reproducer<br>
&gt; <br>
&gt; ;; The culprit appears to be `redisplay--update-cursor-face-highlight&=
#39;<br>
&gt; (setq debug-on-error t)<br>
&gt; (cursor-face-highlight-mode)<br>
&gt; (save-excursion (insert (propertize &quot;cursor face text\n&quot;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&#39;cursor-f=
ace &#39;region)))<br>
&gt; (narrow-to-region (pos-bol) (pos-eol))<br>
&gt; (setq unread-command-events (mapcar #&#39;identity<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(kbd &quot;C-=
n&quot;)))<br>
<br>
Thanks, does the below fix it?<br>
<br>
diff --git a/lisp/simple.el b/lisp/simple.el<br>
index ee09a6f..9e9dd15 100644<br>
--- a/lisp/simple.el<br>
+++ b/lisp/simple.el<br>
@@ -7265,7 +7265,7 @@ redisplay--update-cursor-face-highlight<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(pt (window-point wi=
ndow))<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(cursor-face (get-te=
xt-property pt &#39;cursor-face)))<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(let* ((start (previous-single-property-c=
hange<br>
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0(1+ pt) &#39;cursor-face nil (point-min)))<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0(min (1+ pt) (point-min)) &#39;cursor-face nil (point-min)))<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (end (next-single-p=
roperty-change<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 pt &#39;cursor-face nil (point-max)))<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (new (redisplay--hi=
ghlight-overlay-function<br></blockquote><div><br></div><div class=3D"gmail=
_default" style=3D"font-family:monospace">Eli, possible to apply the above =
soon?</div></div></div>

--000000000000f295d606339aa113--




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

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


Received: (at 77747) by debbugs.gnu.org; 13 Apr 2025 12:14:54 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Apr 13 08:14:53 2025
Received: from localhost ([127.0.0.1]:39981 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1u3wEd-0007Bm-3E
	for submit <at> debbugs.gnu.org; Sun, 13 Apr 2025 08:14:53 -0400
Received: from mail-ua1-x92c.google.com ([2607:f8b0:4864:20::92c]:60535)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <shipmints@HIDDEN>)
 id 1u3wEZ-0007A4-3l
 for 77747 <at> debbugs.gnu.org; Sun, 13 Apr 2025 08:14:48 -0400
Received: by mail-ua1-x92c.google.com with SMTP id
 a1e0cc1a2514c-86feb848764so1217936241.0
 for <77747 <at> debbugs.gnu.org>; Sun, 13 Apr 2025 05:14:47 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1744546481; x=1745151281; darn=debbugs.gnu.org;
 h=cc:to:subject:message-id:date:from:in-reply-to:references
 :mime-version:from:to:cc:subject:date:message-id:reply-to;
 bh=qTGyN1dX+ZMOAnkX1w3pcqqALMrzdAhY7UeXNBI7PGM=;
 b=Z59pOvRlKDjCT7UkL6JZZsmwh/TTG0CTvDJYq8Ve+lD23S9lD4E79gc4q8TW6dSEEb
 z6FWOgmQ0jj+MqNSk1VOFXFqs3ha4GWO9kBampkDzbDwQMx0awwoqbEpKAAPg+I2DZUf
 l/q4O5Be1rsuEEOtAqqxRg7WWQw67ylkJcEFqxyetzj8+d3s1wiORCj9hV8CpnvvTU4U
 pqTT866tfvPIsyUhDBcv5qQkadCILqJiHY1Pxjf3gK/cjrNv9kIUe+3y/lbcmLFOIPAa
 Ib9B9bDJkzTvNab+zddHeQOC4Csx3lRyUwsXx1Pf8zSNzdMDPKbwan7G/1y1zJke6mou
 pWhw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1744546481; x=1745151281;
 h=cc:to:subject:message-id:date:from:in-reply-to:references
 :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id
 :reply-to;
 bh=qTGyN1dX+ZMOAnkX1w3pcqqALMrzdAhY7UeXNBI7PGM=;
 b=JwxXbASTlooC7cwxNINoaKZplTClMnmWuy9sgIDuqli6Yi3/ghX3Oz0hmhf2uTYUtc
 hXbkfGX334fFLSfgdiIU4uzWpdwO0GkYfyG2jCUD8LW+FG+sN1PZu4cTfgsrYZZpVHGO
 4zVuXnaFQmnb5U4FiPOCPs0Aq4g2chE6bd6y/fEwAekKZAuc3M+LS463uJnyzu08kHzY
 ynmVEWFXeN5wgQWD5StywdCmFcY40TGYD1DTamp2bCQrCmD4YuJiQt9gJgE2p+MmzdbK
 gzV6g/Gd8D20wQgtg7Fsvz3vIoTO/At0fxaVXV4lW1YSNay1O8m95+xAO4Yz92LInkp3
 21gw==
X-Gm-Message-State: AOJu0YycXlMply0eXCfP2mHuKJ58xsT921oKDFoEGbEJcOBseBKLQF98
 uAa6oXidg3tgU9JfIBU5V87CE9yM7sXuQGBoNs//7Hg3dmtlXqeTU17Csd6NVShW+/1QSruOksB
 R8LVzV5Ihrysq4NUxr6t5PnjEjMQ=
X-Gm-Gg: ASbGncuJiz97FMY4z2S80o9zT5Ro3FqZKpoP+hBYpMMR1Wvi+LttI89f/zfE8FN7iuP
 K9hK/yuQr9UXpj48nKrbdoHPyK3FfYqmjCOjZVOuDxQ6Bhmq0XxowcY04402A4vQmPN+Re3I+++
 TvlzT7uOrcNksO3CeXuPA1Sg==
X-Google-Smtp-Source: AGHT+IEzK9/7IkQR0bSnWMXq7wfNQ9ng8+xFj5yGEPxjDOnbymx6TtnqzN6Bjrt9Kjyvf4xG8U4CcW9OZTVIRgFDdrc=
X-Received: by 2002:a05:6102:1498:b0:4c3:858:f07c with SMTP id
 ada2fe7eead31-4c9e4f223f8mr6023426137.14.1744546481000; Sun, 13 Apr 2025
 05:14:41 -0700 (PDT)
MIME-Version: 1.0
References: <CAN+1HbrcbGaR8atcJWL_VnPLMPaHEFB4-R4p97z4i=2=H+WKcg@HIDDEN>
 <86wmbojslo.fsf@HIDDEN>
 <CAN+1Hbqc-Qn15KAXkDKcefjZnJsntvXEPzpWEgMAnDFGtN_R4A@HIDDEN>
 <CAN+1HbpM2K0bv0w+PoMuhqK9EE3zRgr4vDyxiwdSq3v5vV_vzw@HIDDEN>
 <86cydgjmvh.fsf@HIDDEN>
In-Reply-To: <86cydgjmvh.fsf@HIDDEN>
From: Ship Mints <shipmints@HIDDEN>
Date: Sun, 13 Apr 2025 08:14:30 -0400
X-Gm-Features: ATxdqUFgkfV7aLToeeu3m9cnTqLRJ2a70Uwe9IttPM8e1p-tgZQPS1juISTXMKA
Message-ID: <CAN+1HboxiueQZJk9m8fq6_8+doV4TdoaUbs6iKqVQTE9ogK=Hg@HIDDEN>
Subject: Re: bug#77747: 'cursor-face-highlight-mode' signals
 'args-out-of-range' in narrowed buffer
To: Eli Zaretskii <eliz@HIDDEN>
Content-Type: multipart/alternative; boundary="0000000000004b59160632a7e1c8"
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 77747
Cc: 77747 <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 (-)

--0000000000004b59160632a7e1c8
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Sun, Apr 13, 2025 at 7:56=E2=80=AFAM Eli Zaretskii <eliz@HIDDEN> wrote:

> > From: Ship Mints <shipmints@HIDDEN>
> > Date: Sun, 13 Apr 2025 07:38:34 -0400
> > Cc: 77747 <at> debbugs.gnu.org
> >
> > Your recommendation doesn't work in the reproducer and it signals as
> before.
>
> <Shrug> Granted, it did work for me.
>

<Shrug> here, too.  It seems my changes to simple.el weren't
properly picked up.  I recompiled and it does indeed work in both the
reproducer and in a larger context.

Thank you for taking your time with this.  I'll run with this locally.

-Stephane

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

<div dir=3D"ltr"><div dir=3D"ltr"><div class=3D"gmail_default" style=3D"fon=
t-family:monospace"><span style=3D"font-family:Arial,Helvetica,sans-serif">=
On Sun, Apr 13, 2025 at 7:56=E2=80=AFAM Eli Zaretskii &lt;<a href=3D"mailto=
:eliz@HIDDEN">eliz@HIDDEN</a>&gt; wrote:</span></div></div><div class=3D"=
gmail_quote gmail_quote_container"><blockquote class=3D"gmail_quote" style=
=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding=
-left:1ex">&gt; From: Ship Mints &lt;<a href=3D"mailto:shipmints@HIDDEN"=
 target=3D"_blank">shipmints@HIDDEN</a>&gt;<br>
&gt; Date: Sun, 13 Apr 2025 07:38:34 -0400<br>
&gt; Cc: <a href=3D"mailto:77747 <at> debbugs.gnu.org" target=3D"_blank">77747@d=
ebbugs.gnu.org</a><br>
&gt; <br>
&gt; Your recommendation doesn&#39;t work in the reproducer and it signals =
as before.<br>
<br>
&lt;Shrug&gt; Granted, it did work for me.<br></blockquote><div><br></div><=
div class=3D"gmail_default" style=3D"font-family:monospace">&lt;Shrug&gt; h=
ere, too.=C2=A0 It seems my changes to simple.el weren&#39;t properly=C2=A0=
picked up.=C2=A0 I recompiled and it does indeed work in both the reproduce=
r and in a larger context.</div><div class=3D"gmail_default" style=3D"font-=
family:monospace"><br></div><div class=3D"gmail_default" style=3D"font-fami=
ly:monospace">Thank you for taking your time with this.=C2=A0 I&#39;ll run =
with this locally.</div><div class=3D"gmail_default" style=3D"font-family:m=
onospace"><br></div><div class=3D"gmail_default" style=3D"font-family:monos=
pace">-Stephane</div></div></div>

--0000000000004b59160632a7e1c8--




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

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


Received: (at 77747) by debbugs.gnu.org; 13 Apr 2025 11:56:49 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Apr 13 07:56:48 2025
Received: from localhost ([127.0.0.1]:39955 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1u3vx8-0003j0-Ff
	for submit <at> debbugs.gnu.org; Sun, 13 Apr 2025 07:56:48 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:36586)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1u3vx4-0003hF-BG
 for 77747 <at> debbugs.gnu.org; Sun, 13 Apr 2025 07:56:43 -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 1u3vwy-0006i6-Vd; Sun, 13 Apr 2025 07:56:36 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=aZeQE/UuwYbj4Npov2Mke7cMe410FIwXhdxTxLQTIs4=; b=WkxQ1xmcWhVt
 +MFuDQ7SNMMpiXUyFwDFMwKw4QU3Hs/7sbISB1ueViie5eYi4zXLF3Ov75hzpAxCCrA5En86n/mvO
 q56eASY3Sk456mUVlnh8PqlVWvnCWuM2pcTxnTJwS4yPOUHx64J6hvf0NFlcPS71/sEe0vSumdyF2
 otrCpSiWtwYyKNst9II2ahJo+RQ/gkY19+Zyryf2zU5tUXbBMhFeKYl0Nh0VHxWDSRSj5Du3I+PZq
 HTu3/IDhTO8TGSyvmLcJ2gMGqEAZ8JGuaxOqOkcHw/tB0tcQvEe5hrqHHZVlmggU6b6kON258m0LK
 5yWIrkXWvl5/0eHYfwWG/w==;
Date: Sun, 13 Apr 2025 14:56:34 +0300
Message-Id: <86cydgjmvh.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Ship Mints <shipmints@HIDDEN>
In-Reply-To: <CAN+1HbpM2K0bv0w+PoMuhqK9EE3zRgr4vDyxiwdSq3v5vV_vzw@HIDDEN>
 (message from Ship Mints on Sun, 13 Apr 2025 07:38:34 -0400)
Subject: Re: bug#77747: 'cursor-face-highlight-mode' signals
 'args-out-of-range' in narrowed buffer
References: <CAN+1HbrcbGaR8atcJWL_VnPLMPaHEFB4-R4p97z4i=2=H+WKcg@HIDDEN>
 <86wmbojslo.fsf@HIDDEN>
 <CAN+1Hbqc-Qn15KAXkDKcefjZnJsntvXEPzpWEgMAnDFGtN_R4A@HIDDEN>
 <CAN+1HbpM2K0bv0w+PoMuhqK9EE3zRgr4vDyxiwdSq3v5vV_vzw@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 77747
Cc: 77747 <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: Ship Mints <shipmints@HIDDEN>
> Date: Sun, 13 Apr 2025 07:38:34 -0400
> Cc: 77747 <at> debbugs.gnu.org
> 
> Your recommendation doesn't work in the reproducer and it signals as before.

<Shrug> Granted, it did work for me.




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

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


Received: (at 77747) by debbugs.gnu.org; 13 Apr 2025 11:55:36 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Apr 13 07:55:35 2025
Received: from localhost ([127.0.0.1]:39950 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1u3vvy-0003VI-01
	for submit <at> debbugs.gnu.org; Sun, 13 Apr 2025 07:55:35 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:40832)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1u3vvv-0003Tf-2o
 for 77747 <at> debbugs.gnu.org; Sun, 13 Apr 2025 07:55:32 -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 1u3vvp-0006cX-Du; Sun, 13 Apr 2025 07:55:25 -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=sMmBpvVjNGX1G+ctY7tiZc9CvQ1lsYmkVsNeDhkeOZU=; b=aQ3YnEsMkBFB+4XjEfZ5
 dOV9VqsI3w/7892M5mgM1I3SWROyIDN66erK/9wYIktzko09nzfqMXeZtDcpqY6DZ3omcB8gcomFv
 kzbWOHFSANkTyRhbTEvaYrcPQC28X/dcFYr6sK8F3YMv09aE2JN73WnX+BSYvvygskQcB5IwPV6jf
 sfIclu5ApWOCRxEHxzybBHfmXsRQoRvZRhDEsw+5n4Uq/UcYiPRdARHLFGwUIRt/hbuSUaKMCnweV
 KG1Q52lUeOTtOIw6EGIQUTUlILKBgl4r3WVKNBPXT7cjv3GwlW6xUDmECP3M1+Rk8YG+iWxjFok+O
 nZmtSTbjtNRYYA==;
Date: Sun, 13 Apr 2025 14:55:20 +0300
Message-Id: <86ecxwjmxj.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Ship Mints <shipmints@HIDDEN>, spacibba@HIDDEN
In-Reply-To: <CAN+1Hbqc-Qn15KAXkDKcefjZnJsntvXEPzpWEgMAnDFGtN_R4A@HIDDEN>
 (message from Ship Mints on Sun, 13 Apr 2025 07:28:43 -0400)
Subject: Re: bug#77747: 'cursor-face-highlight-mode' signals
 'args-out-of-range' in narrowed buffer
References: <CAN+1HbrcbGaR8atcJWL_VnPLMPaHEFB4-R4p97z4i=2=H+WKcg@HIDDEN>
 <86wmbojslo.fsf@HIDDEN>
 <CAN+1Hbqc-Qn15KAXkDKcefjZnJsntvXEPzpWEgMAnDFGtN_R4A@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: 77747
Cc: 77747 <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: Ship Mints <shipmints@HIDDEN>
> Date: Sun, 13 Apr 2025 07:28:43 -0400
> Cc: 77747 <at> debbugs.gnu.org
> 
> On Sun, Apr 13, 2025 at 5:52 AM Eli Zaretskii <eliz@HIDDEN> wrote:
> 
>  > From: Ship Mints <shipmints@HIDDEN>
>  > Date: Fri, 11 Apr 2025 11:32:18 -0400
>  > 
>  > -Q reproducer
>  > 
>  > ;; The culprit appears to be `redisplay--update-cursor-face-highlight'
>  > (setq debug-on-error t)
>  > (cursor-face-highlight-mode)
>  > (save-excursion (insert (propertize "cursor face text\n"
>  >                                     'cursor-face 'region)))
>  > (narrow-to-region (pos-bol) (pos-eol))
>  > (setq unread-command-events (mapcar #'identity
>  >                                     (kbd "C-n")))
> 
>  Thanks, does the below fix it?
> 
>  diff --git a/lisp/simple.el b/lisp/simple.el
>  index ee09a6f..9e9dd15 100644
>  --- a/lisp/simple.el
>  +++ b/lisp/simple.el
>  @@ -7265,7 +7265,7 @@ redisplay--update-cursor-face-highlight
>                 (pt (window-point window))
>                 (cursor-face (get-text-property pt 'cursor-face)))
>           (let* ((start (previous-single-property-change
>  -                       (1+ pt) 'cursor-face nil (point-min)))
>  +                       (min (1+ pt) (point-min)) 'cursor-face nil (point-min)))
>                  (end (next-single-property-change
>                        pt 'cursor-face nil (point-max)))
>                  (new (redisplay--highlight-overlay-function
> 
> Not quite.  That winds up coalescing the highlight across lines rather than just the line with the cursor.
> 
> This works better but I'm not sure if this is in the true spirit of the intended use as the property change may
> not be floored to bol?

I guess it's up to the author (CC'ed), then.




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

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


Received: (at 77747) by debbugs.gnu.org; 13 Apr 2025 11:38:57 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Apr 13 07:38:57 2025
Received: from localhost ([127.0.0.1]:39924 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1u3vfs-0000Fs-55
	for submit <at> debbugs.gnu.org; Sun, 13 Apr 2025 07:38:57 -0400
Received: from mail-ua1-x929.google.com ([2607:f8b0:4864:20::929]:42048)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <shipmints@HIDDEN>)
 id 1u3vfn-0000Df-Ac
 for 77747 <at> debbugs.gnu.org; Sun, 13 Apr 2025 07:38:53 -0400
Received: by mail-ua1-x929.google.com with SMTP id
 a1e0cc1a2514c-86d30c329f2so3392249241.0
 for <77747 <at> debbugs.gnu.org>; Sun, 13 Apr 2025 04:38:51 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1744544325; x=1745149125; darn=debbugs.gnu.org;
 h=cc:to:subject:message-id:date:from:in-reply-to:references
 :mime-version:from:to:cc:subject:date:message-id:reply-to;
 bh=ax74uBecGW/bIyIwWDAvMJXP6h+gpHuNV8IItE7seqU=;
 b=ZCimNb8rg4X5csyBdW2pbwAIhsQD1lqoJ7xsxGIjOxbJ1KU6AcYD12qIXE1/M0FndF
 xoITBKFaYcC1X70kPty8cNYg4DhoYmXV7LcjMT+EPK3SHbtC9vUhD4Rz5GL5jPv+EOGi
 y2VcWCa/MHC2/qtJGGo43rgvs+k2mvjuWaaEaPcfIe4sTDvnk4dhmOyE4RfpMG7PCv4t
 0IZFysec9K6sVJOzL5JJ4rP/15lDQ2zCpRs0q6voggfEtFub/aCI5vQvbuHUKdb7LBDf
 wzZKE6MQk9RTJqULo5XIQKhaejZoni730FgNc5TpEWAVe0HdeqkCQQumF4YrBnFrFNFO
 gaew==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1744544325; x=1745149125;
 h=cc:to:subject:message-id:date:from:in-reply-to:references
 :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id
 :reply-to;
 bh=ax74uBecGW/bIyIwWDAvMJXP6h+gpHuNV8IItE7seqU=;
 b=rEDRpC1D5MVWq0QM6IAHMiRbPpSTpcpA3H692sRqGs44wCZ/8GjYcMx1GqG8rPrSd8
 Y/Kdf6W9FwWRG/gIj8E3YNOUqnjD81iY1fHjLkaytNvuFB1Pp4TF4z9BiR3kEGBkXzkE
 8nE2pqZivE8qFIYbdcKc9u4rVcjtnyGgv0y5bRpDKSG7Rvb+uJl+mfCPJh/zGXfb8E3o
 54dBlfa8Eh80oB10g7s8fWFXreo5GTSAautZPAjhnmmegzlbrd2Edn87dLzQsRxZ9poP
 G7QAGo/eJrdobGldbE4DUzQ2eCtv63Kc6UzzU1I6+Zvic6vIzQwAUFGfAi4++EXjAJXi
 xlQw==
X-Gm-Message-State: AOJu0YzRIw9Yzg7kF6Q8uVTpTmNoxMDt4j7S/nbLWMfIWLnQgs7f1ol0
 OeQCccADFAp7+O03bP2FvEeia9bSad1pUnk3xjGv57amVtH6sgsWHt7r1m00P7ykH8Ux/D2yTGp
 uojj/u4jVJBc6D3EGoawHnzkdthoaRQ==
X-Gm-Gg: ASbGnctG5liivS1dpTEtsqKHsxuJKXMPvqQ/Kwd+V41GYNQbHfdZd6AcyMIL50joZvT
 UUVJ/ilwkrSxMz6Tyk4k/ocJSNlBvr4h3iTlMh7QsHJqWVfPu4MR0Ksbn/Z0X6dmw3R4dylerZ4
 W1D8+q6SBnaXN8nkwLH+G94Q==
X-Google-Smtp-Source: AGHT+IH5crMaREmKeU/M1WcRJ8iV4Fc7mpn/H5h6H3kByBB+kxdB1gO7Sf0HVqBbtYQTa1awTSKaEM2L97E7kYQpoz0=
X-Received: by 2002:a05:6102:124b:b0:4c3:64c0:8b14 with SMTP id
 ada2fe7eead31-4c9d3e6863dmr8975453137.3.1744544325339; Sun, 13 Apr 2025
 04:38:45 -0700 (PDT)
MIME-Version: 1.0
References: <CAN+1HbrcbGaR8atcJWL_VnPLMPaHEFB4-R4p97z4i=2=H+WKcg@HIDDEN>
 <86wmbojslo.fsf@HIDDEN>
 <CAN+1Hbqc-Qn15KAXkDKcefjZnJsntvXEPzpWEgMAnDFGtN_R4A@HIDDEN>
In-Reply-To: <CAN+1Hbqc-Qn15KAXkDKcefjZnJsntvXEPzpWEgMAnDFGtN_R4A@HIDDEN>
From: Ship Mints <shipmints@HIDDEN>
Date: Sun, 13 Apr 2025 07:38:34 -0400
X-Gm-Features: ATxdqUH1YisMVRlRuYtE1iybatFGtkWxfMZQD0BGKkh4WMJ-XMUVX8SsbVuBZYw
Message-ID: <CAN+1HbpM2K0bv0w+PoMuhqK9EE3zRgr4vDyxiwdSq3v5vV_vzw@HIDDEN>
Subject: Re: bug#77747: 'cursor-face-highlight-mode' signals
 'args-out-of-range' in narrowed buffer
To: Eli Zaretskii <eliz@HIDDEN>
Content-Type: multipart/alternative; boundary="000000000000ce91550632a76092"
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 77747
Cc: 77747 <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 (-)

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

On Sun, Apr 13, 2025 at 7:28=E2=80=AFAM Ship Mints <shipmints@HIDDEN> wr=
ote:

> On Sun, Apr 13, 2025 at 5:52=E2=80=AFAM Eli Zaretskii <eliz@HIDDEN> wrot=
e:
>
>> > From: Ship Mints <shipmints@HIDDEN>
>> > Date: Fri, 11 Apr 2025 11:32:18 -0400
>> >
>> > -Q reproducer
>> >
>> > ;; The culprit appears to be `redisplay--update-cursor-face-highlight'
>> > (setq debug-on-error t)
>> > (cursor-face-highlight-mode)
>> > (save-excursion (insert (propertize "cursor face text\n"
>> >                                     'cursor-face 'region)))
>> > (narrow-to-region (pos-bol) (pos-eol))
>> > (setq unread-command-events (mapcar #'identity
>> >                                     (kbd "C-n")))
>>
>> Thanks, does the below fix it?
>>
>> diff --git a/lisp/simple.el b/lisp/simple.el
>> index ee09a6f..9e9dd15 100644
>> --- a/lisp/simple.el
>> +++ b/lisp/simple.el
>> @@ -7265,7 +7265,7 @@ redisplay--update-cursor-face-highlight
>>                (pt (window-point window))
>>                (cursor-face (get-text-property pt 'cursor-face)))
>>          (let* ((start (previous-single-property-change
>> -                       (1+ pt) 'cursor-face nil (point-min)))
>> +                       (min (1+ pt) (point-min)) 'cursor-face nil
>> (point-min)))
>>                 (end (next-single-property-change
>>                       pt 'cursor-face nil (point-max)))
>>                 (new (redisplay--highlight-overlay-function
>>
>
> Not quite.  That winds up coalescing the highlight across lines rather
> than just the line with the cursor.
>
> This works better but I'm not sure if this is in the true spirit of the
> intended use as the property change may not be floored to bol?
>
> diff --git a/lisp/simple.el b/lisp/simple.el
> index 7037158df8d..9ebe9a0ba34 100644
> --- a/lisp/simple.el
> +++ b/lisp/simple.el
> @@ -7259,7 +7259,7 @@ redisplay--update-cursor-face-highlight
>                (pt (window-point window))
>                (cursor-face (get-text-property pt 'cursor-face)))
>          (let* ((start (previous-single-property-change
> -                       (1+ pt) 'cursor-face nil (point-min)))
> +                       (min (1+ pt) (pos-bol)) 'cursor-face nil
> (point-min)))
>                 (end (next-single-property-change
>                       pt 'cursor-face nil (point-max)))
>                 (new (redisplay--highlight-overlay-function
>

I tested my experiment above in my own reproducer and it doesn't work
there, though it worked in a larger case with a lot more text, I didn't
look further.

Your recommendation doesn't work in the reproducer and it signals as before=
.

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

<div dir=3D"ltr"><div dir=3D"ltr"><div class=3D"gmail_default" style=3D"fon=
t-family:monospace"><span style=3D"font-family:Arial,Helvetica,sans-serif">=
On Sun, Apr 13, 2025 at 7:28=E2=80=AFAM Ship Mints &lt;<a href=3D"mailto:sh=
ipmints@HIDDEN">shipmints@HIDDEN</a>&gt; wrote:</span></div></div><di=
v class=3D"gmail_quote gmail_quote_container"><blockquote class=3D"gmail_qu=
ote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,20=
4);padding-left:1ex"><div dir=3D"ltr"><div dir=3D"ltr"><div style=3D"font-f=
amily:monospace"><span style=3D"font-family:Arial,Helvetica,sans-serif">On =
Sun, Apr 13, 2025 at 5:52=E2=80=AFAM Eli Zaretskii &lt;<a href=3D"mailto:el=
iz@HIDDEN" target=3D"_blank">eliz@HIDDEN</a>&gt; wrote:</span></div></div=
><div class=3D"gmail_quote"><blockquote class=3D"gmail_quote" style=3D"marg=
in:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1e=
x">&gt; From: Ship Mints &lt;<a href=3D"mailto:shipmints@HIDDEN" target=
=3D"_blank">shipmints@HIDDEN</a>&gt;<br>
&gt; Date: Fri, 11 Apr 2025 11:32:18 -0400<br>
&gt; <br>
&gt; -Q reproducer<br>
&gt; <br>
&gt; ;; The culprit appears to be `redisplay--update-cursor-face-highlight&=
#39;<br>
&gt; (setq debug-on-error t)<br>
&gt; (cursor-face-highlight-mode)<br>
&gt; (save-excursion (insert (propertize &quot;cursor face text\n&quot;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&#39;cursor-f=
ace &#39;region)))<br>
&gt; (narrow-to-region (pos-bol) (pos-eol))<br>
&gt; (setq unread-command-events (mapcar #&#39;identity<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(kbd &quot;C-=
n&quot;)))<br>
<br>
Thanks, does the below fix it?<br>
<br>
diff --git a/lisp/simple.el b/lisp/simple.el<br>
index ee09a6f..9e9dd15 100644<br>
--- a/lisp/simple.el<br>
+++ b/lisp/simple.el<br>
@@ -7265,7 +7265,7 @@ redisplay--update-cursor-face-highlight<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(pt (window-point wi=
ndow))<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(cursor-face (get-te=
xt-property pt &#39;cursor-face)))<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(let* ((start (previous-single-property-c=
hange<br>
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0(1+ pt) &#39;cursor-face nil (point-min)))<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0(min (1+ pt) (point-min)) &#39;cursor-face nil (point-min)))<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (end (next-single-p=
roperty-change<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 pt &#39;cursor-face nil (point-max)))<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (new (redisplay--hi=
ghlight-overlay-function<br></blockquote><div><br></div><div style=3D"font-=
family:monospace">Not quite.=C2=A0 That winds up coalescing the highlight a=
cross lines rather than just the line with the cursor.</div><div style=3D"f=
ont-family:monospace"><br></div><div style=3D"font-family:monospace">This w=
orks better but I&#39;m not sure if this is in the true spirit of the inten=
ded use as the property change=C2=A0may not be floored to bol?</div><div st=
yle=3D"font-family:monospace"><br></div><div style=3D"font-family:monospace=
">diff --git a/lisp/simple.el b/lisp/simple.el<br>index 7037158df8d..9ebe9a=
0ba34 100644<br>--- a/lisp/simple.el<br>+++ b/lisp/simple.el<br>@@ -7259,7 =
+7259,7 @@ redisplay--update-cursor-face-highlight<br>=C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(pt (window-point window))<br>=C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(cursor-face (get-text-propert=
y pt &#39;cursor-face)))<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(let* ((start=
 (previous-single-property-change<br>- =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (1+ pt) &#39;cursor-face nil (poi=
nt-min)))<br>+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 (min (1+ pt) (pos-bol)) &#39;cursor-face nil (point-min))=
)<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (end (next-sin=
gle-property-change<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 pt &#39;cursor-face nil (point-max)))<br>=C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (new (redisplay--highlight=
-overlay-function<br></div></div></div></blockquote><div><br></div><div cla=
ss=3D"gmail_default" style=3D"font-family:monospace">I tested my experiment=
 above in my own reproducer and it doesn&#39;t work there, though it worked=
 in a larger case with a lot more text, I didn&#39;t look further.</div><di=
v class=3D"gmail_default" style=3D"font-family:monospace"><br></div><div cl=
ass=3D"gmail_default" style=3D"font-family:monospace">Your recommendation d=
oesn&#39;t work in the reproducer and it signals as before.</div></div></di=
v>

--000000000000ce91550632a76092--




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

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


Received: (at 77747) by debbugs.gnu.org; 13 Apr 2025 11:29:08 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Apr 13 07:29:08 2025
Received: from localhost ([127.0.0.1]:39905 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1u3vWJ-0003oY-Kv
	for submit <at> debbugs.gnu.org; Sun, 13 Apr 2025 07:29:07 -0400
Received: from mail-vk1-xa31.google.com ([2607:f8b0:4864:20::a31]:42305)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <shipmints@HIDDEN>)
 id 1u3vWG-0003mv-1T
 for 77747 <at> debbugs.gnu.org; Sun, 13 Apr 2025 07:29:01 -0400
Received: by mail-vk1-xa31.google.com with SMTP id
 71dfb90a1353d-5240a432462so3113936e0c.1
 for <77747 <at> debbugs.gnu.org>; Sun, 13 Apr 2025 04:29:00 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1744543734; x=1745148534; darn=debbugs.gnu.org;
 h=cc:to:subject:message-id:date:from:in-reply-to:references
 :mime-version:from:to:cc:subject:date:message-id:reply-to;
 bh=T+InOHkyi9UAdRxNf+7sL0pw91FSbdzmt4rmHYaLmgI=;
 b=Wg4n5AjawF+ksHA9CBaYqeWeU9Wou4RUFGd1fAqDKWPHs5+Jhy3vv4jQZ95ShXVPp7
 QFD7QxHGrEZD1IGpWiJRIPYRbvQNgJnShuU/fESw+cpFudCUDF5DSEf0TPDbMEQsradK
 xH2NA637iWBNsBR/PQIW+5IOTTO3JY6yDOYYXCSARmSUBsNyTsEwH3jrxamVTrN66k4c
 v/tozRBruVumaQwDOe/hcy+Geb15dGUxWRJyb1BYVwemH6jfCq2HuosWLY2TS72PnXJb
 +cVPrVBSOgew9Ls//KqIZWV5CsMvtPsFsDp0iVm6PM5H4uK1S2DTlUvL/r4J1HYJngxR
 WUHg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1744543734; x=1745148534;
 h=cc:to:subject:message-id:date:from:in-reply-to:references
 :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id
 :reply-to;
 bh=T+InOHkyi9UAdRxNf+7sL0pw91FSbdzmt4rmHYaLmgI=;
 b=Iu0kaPmO9tbkaG33kQpMG9KQLbFF3/dU9LGysBg3JiCilbQ/A3fRBMPGgvK/VZGn3d
 Y6BZWMN33elcR7liHcJvftdYvMiJQAzni+12L6+itkTUnoJr2etRqaMh7Mvly4o5Ky7M
 ocGMHEitQX1tOpp8H5HKwM0KsgBgwJm0tizt3tb7W/ti/dY2GZfnTaPn8oF6n8YgLK4g
 Z1tHKtEfXmfFndNo9P5ITI+NNCDj/xRJe/hnXLs4gVZbwIllYjkvxpv2dh3q/24ANsE7
 hypQc74B2ssiH00fZWINucyxkPRAHetwvUz0Fyf1HVUtO9/feGaJBITbVpSNmXbQDKeg
 8DzQ==
X-Gm-Message-State: AOJu0Ywsr2A+UX7xQhOd5YZeX/SXyirWgKHN8OYhgJGtotVv3e7ZiwQ5
 9OrGcEyOUOZauyC3jfUd/uVRdpWTIrVN470huOv4MlSdg5I6eqQKb6JuVFVrcn3wqngGJ5KIzsD
 AIdWqEf4nv6gA8AXzcbCXqtBB5Pk0p6DX
X-Gm-Gg: ASbGnctRTWkSs1s0sIAtfDMXwN0TA/EfMXjQEXEmgwTIFwuAEeVyz8EopNVGFf1ZPM+
 dzpvyWHJf0j/JtGT0n5+AhJ7L5NSmVpOlAjH8xwylqZhhULnnT3x5s7ij/6ehR+6f8LfiCBDX9w
 RNEtLXla3+T/GP0vgcLvUhnA==
X-Google-Smtp-Source: AGHT+IE/pk+vmbZefBQeJ2typHFUlckesmelaPCTOX4noXsfljquuCvWIEQmXu2QostMxqwbg04n10VpqKUkWs1qLWc=
X-Received: by 2002:a05:6122:da3:b0:51f:a02b:45d4 with SMTP id
 71dfb90a1353d-527c2e94963mr6739371e0c.1.1744543733985; Sun, 13 Apr 2025
 04:28:53 -0700 (PDT)
MIME-Version: 1.0
References: <CAN+1HbrcbGaR8atcJWL_VnPLMPaHEFB4-R4p97z4i=2=H+WKcg@HIDDEN>
 <86wmbojslo.fsf@HIDDEN>
In-Reply-To: <86wmbojslo.fsf@HIDDEN>
From: Ship Mints <shipmints@HIDDEN>
Date: Sun, 13 Apr 2025 07:28:43 -0400
X-Gm-Features: ATxdqUFsJHeIEi1wDn-UlL91kHDDtAH15qOzV9u3gIu655ivJAsfpbhLyxXEYUU
Message-ID: <CAN+1Hbqc-Qn15KAXkDKcefjZnJsntvXEPzpWEgMAnDFGtN_R4A@HIDDEN>
Subject: Re: bug#77747: 'cursor-face-highlight-mode' signals
 'args-out-of-range' in narrowed buffer
To: Eli Zaretskii <eliz@HIDDEN>
Content-Type: multipart/alternative; boundary="0000000000008f3ad40632a73dbb"
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 77747
Cc: 77747 <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 (-)

--0000000000008f3ad40632a73dbb
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Sun, Apr 13, 2025 at 5:52=E2=80=AFAM Eli Zaretskii <eliz@HIDDEN> wrote:

> > From: Ship Mints <shipmints@HIDDEN>
> > Date: Fri, 11 Apr 2025 11:32:18 -0400
> >
> > -Q reproducer
> >
> > ;; The culprit appears to be `redisplay--update-cursor-face-highlight'
> > (setq debug-on-error t)
> > (cursor-face-highlight-mode)
> > (save-excursion (insert (propertize "cursor face text\n"
> >                                     'cursor-face 'region)))
> > (narrow-to-region (pos-bol) (pos-eol))
> > (setq unread-command-events (mapcar #'identity
> >                                     (kbd "C-n")))
>
> Thanks, does the below fix it?
>
> diff --git a/lisp/simple.el b/lisp/simple.el
> index ee09a6f..9e9dd15 100644
> --- a/lisp/simple.el
> +++ b/lisp/simple.el
> @@ -7265,7 +7265,7 @@ redisplay--update-cursor-face-highlight
>                (pt (window-point window))
>                (cursor-face (get-text-property pt 'cursor-face)))
>          (let* ((start (previous-single-property-change
> -                       (1+ pt) 'cursor-face nil (point-min)))
> +                       (min (1+ pt) (point-min)) 'cursor-face nil
> (point-min)))
>                 (end (next-single-property-change
>                       pt 'cursor-face nil (point-max)))
>                 (new (redisplay--highlight-overlay-function
>

Not quite.  That winds up coalescing the highlight across lines rather than
just the line with the cursor.

This works better but I'm not sure if this is in the true spirit of the
intended use as the property change may not be floored to bol?

diff --git a/lisp/simple.el b/lisp/simple.el
index 7037158df8d..9ebe9a0ba34 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -7259,7 +7259,7 @@ redisplay--update-cursor-face-highlight
               (pt (window-point window))
               (cursor-face (get-text-property pt 'cursor-face)))
         (let* ((start (previous-single-property-change
-                       (1+ pt) 'cursor-face nil (point-min)))
+                       (min (1+ pt) (pos-bol)) 'cursor-face nil
(point-min)))
                (end (next-single-property-change
                      pt 'cursor-face nil (point-max)))
                (new (redisplay--highlight-overlay-function

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

<div dir=3D"ltr"><div dir=3D"ltr"><div class=3D"gmail_default" style=3D"fon=
t-family:monospace"><span style=3D"font-family:Arial,Helvetica,sans-serif">=
On Sun, Apr 13, 2025 at 5:52=E2=80=AFAM Eli Zaretskii &lt;<a href=3D"mailto=
:eliz@HIDDEN">eliz@HIDDEN</a>&gt; wrote:</span></div></div><div class=3D"=
gmail_quote gmail_quote_container"><blockquote class=3D"gmail_quote" style=
=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding=
-left:1ex">&gt; From: Ship Mints &lt;<a href=3D"mailto:shipmints@HIDDEN"=
 target=3D"_blank">shipmints@HIDDEN</a>&gt;<br>
&gt; Date: Fri, 11 Apr 2025 11:32:18 -0400<br>
&gt; <br>
&gt; -Q reproducer<br>
&gt; <br>
&gt; ;; The culprit appears to be `redisplay--update-cursor-face-highlight&=
#39;<br>
&gt; (setq debug-on-error t)<br>
&gt; (cursor-face-highlight-mode)<br>
&gt; (save-excursion (insert (propertize &quot;cursor face text\n&quot;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&#39;cursor-f=
ace &#39;region)))<br>
&gt; (narrow-to-region (pos-bol) (pos-eol))<br>
&gt; (setq unread-command-events (mapcar #&#39;identity<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(kbd &quot;C-=
n&quot;)))<br>
<br>
Thanks, does the below fix it?<br>
<br>
diff --git a/lisp/simple.el b/lisp/simple.el<br>
index ee09a6f..9e9dd15 100644<br>
--- a/lisp/simple.el<br>
+++ b/lisp/simple.el<br>
@@ -7265,7 +7265,7 @@ redisplay--update-cursor-face-highlight<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(pt (window-point wi=
ndow))<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(cursor-face (get-te=
xt-property pt &#39;cursor-face)))<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(let* ((start (previous-single-property-c=
hange<br>
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0(1+ pt) &#39;cursor-face nil (point-min)))<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0(min (1+ pt) (point-min)) &#39;cursor-face nil (point-min)))<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (end (next-single-p=
roperty-change<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 pt &#39;cursor-face nil (point-max)))<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (new (redisplay--hi=
ghlight-overlay-function<br></blockquote><div><br></div><div class=3D"gmail=
_default" style=3D"font-family:monospace">Not quite.=C2=A0 That winds up co=
alescing the highlight across lines rather than just the line with the curs=
or.</div><div class=3D"gmail_default" style=3D"font-family:monospace"><br><=
/div><div class=3D"gmail_default" style=3D"font-family:monospace">This work=
s better but I&#39;m not sure if this is in the true spirit of the intended=
 use as the property change=C2=A0may not be floored to bol?</div><div class=
=3D"gmail_default" style=3D"font-family:monospace"><br></div><div class=3D"=
gmail_default" style=3D"font-family:monospace">diff --git a/lisp/simple.el =
b/lisp/simple.el<br>index 7037158df8d..9ebe9a0ba34 100644<br>--- a/lisp/sim=
ple.el<br>+++ b/lisp/simple.el<br>@@ -7259,7 +7259,7 @@ redisplay--update-c=
ursor-face-highlight<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0(pt (window-point window))<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0(cursor-face (get-text-property pt &#39;cursor-face)))<br>=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(let* ((start (previous-single-property-c=
hange<br>- =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 (1+ pt) &#39;cursor-face nil (point-min)))<br>+ =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (min (1+ pt=
) (pos-bol)) &#39;cursor-face nil (point-min)))<br>=C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (end (next-single-property-change<br>=C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 pt &=
#39;cursor-face nil (point-max)))<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 (new (redisplay--highlight-overlay-function<br></div></di=
v></div>

--0000000000008f3ad40632a73dbb--




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

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


Received: (at 77747) by debbugs.gnu.org; 13 Apr 2025 09:53:04 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Apr 13 05:53:04 2025
Received: from localhost ([127.0.0.1]:39374 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1u3u1P-0003WI-V0
	for submit <at> debbugs.gnu.org; Sun, 13 Apr 2025 05:53:04 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:50138)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1u3u1N-0003Uw-DF
 for 77747 <at> debbugs.gnu.org; Sun, 13 Apr 2025 05:53:02 -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 1u3u1H-0006n5-Gy; Sun, 13 Apr 2025 05:52:55 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=txy+ZBA8yLUqNs1h5O0F3dNIYitY2BQkZwVRAGuGdI8=; b=ArIb7kUo7ziO
 9cDwdfkVr1a69Lt06DuTJnin626hlclpeImhK6MXj42Vn23C548reKdDXXdJ6+ts3b06KfyCzB05S
 S7KhqraQmRF32lXkVxApJyB4h5c7/rTVn04iRZzg2lzXuUu0jWeLVyUD1NgU7XLF1VHXNvdv9gH23
 Ql9wXh1ZF9S1HuBnuqniy7Py30hFkhM0+aOTw3LBJxABaWi8immf76IF4i71+io+HYCWXkrMFg/Ff
 xkaGEbLFzc0tPzc/cFqipo9zabqv/+nmmNIaEehfNRS4/GY4YhwH9W7tn1GJDA0kMekBd66/KHpNA
 05tnoIkj39HhgjGriFaubQ==;
Date: Sun, 13 Apr 2025 12:52:51 +0300
Message-Id: <86wmbojslo.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Ship Mints <shipmints@HIDDEN>
In-Reply-To: <CAN+1HbrcbGaR8atcJWL_VnPLMPaHEFB4-R4p97z4i=2=H+WKcg@HIDDEN>
 (message from Ship Mints on Fri, 11 Apr 2025 11:32:18 -0400)
Subject: Re: bug#77747: 'cursor-face-highlight-mode' signals
 'args-out-of-range' in narrowed buffer
References: <CAN+1HbrcbGaR8atcJWL_VnPLMPaHEFB4-R4p97z4i=2=H+WKcg@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 77747
Cc: 77747 <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: Ship Mints <shipmints@HIDDEN>
> Date: Fri, 11 Apr 2025 11:32:18 -0400
> 
> -Q reproducer
> 
> ;; The culprit appears to be `redisplay--update-cursor-face-highlight'
> (setq debug-on-error t)
> (cursor-face-highlight-mode)
> (save-excursion (insert (propertize "cursor face text\n"
>                                     'cursor-face 'region)))
> (narrow-to-region (pos-bol) (pos-eol))
> (setq unread-command-events (mapcar #'identity
>                                     (kbd "C-n")))

Thanks, does the below fix it?

diff --git a/lisp/simple.el b/lisp/simple.el
index ee09a6f..9e9dd15 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -7265,7 +7265,7 @@ redisplay--update-cursor-face-highlight
               (pt (window-point window))
               (cursor-face (get-text-property pt 'cursor-face)))
         (let* ((start (previous-single-property-change
-                       (1+ pt) 'cursor-face nil (point-min)))
+                       (min (1+ pt) (point-min)) 'cursor-face nil (point-min)))
                (end (next-single-property-change
                      pt 'cursor-face nil (point-max)))
                (new (redisplay--highlight-overlay-function




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

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


Received: (at submit) by debbugs.gnu.org; 11 Apr 2025 15:32:43 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Apr 11 11:32:43 2025
Received: from localhost ([127.0.0.1]:51336 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1u3GN1-0006p2-2i
	for submit <at> debbugs.gnu.org; Fri, 11 Apr 2025 11:32:43 -0400
Received: from lists.gnu.org ([2001:470:142::17]:47404)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <shipmints@HIDDEN>)
 id 1u3GMy-0006om-0H
 for submit <at> debbugs.gnu.org; Fri, 11 Apr 2025 11:32:40 -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 <shipmints@HIDDEN>)
 id 1u3GMr-0007lq-VL
 for bug-gnu-emacs@HIDDEN; Fri, 11 Apr 2025 11:32:34 -0400
Received: from mail-vk1-xa2f.google.com ([2607:f8b0:4864:20::a2f])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <shipmints@HIDDEN>)
 id 1u3GMq-0002S7-9F
 for bug-gnu-emacs@HIDDEN; Fri, 11 Apr 2025 11:32:33 -0400
Received: by mail-vk1-xa2f.google.com with SMTP id
 71dfb90a1353d-523fa0df55dso2891681e0c.1
 for <bug-gnu-emacs@HIDDEN>; Fri, 11 Apr 2025 08:32:31 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1744385550; x=1744990350; darn=gnu.org;
 h=to:subject:message-id:date:from:mime-version:from:to:cc:subject
 :date:message-id:reply-to;
 bh=rwKED2nwUnzacdVH40lzvwcUf2Uj55yJ90Tq6vUX34c=;
 b=U5TygLTHa+iVQLlkJX8jb9gsWcRhhhQXWVkroc1Tt4mQLvK1jbf88Ew12cRspF+pzO
 FVIbLL2ln9CFSzRMlAVjrQ12VsO8HSzTsDAF8gL1gHWhuzLiuUfZE/eCayYvYsyBoVmT
 saV0yz0s/C4F7BnDhvbrQ6+866B5ZP0/fDQaNg0IymGYU/L/uNdOb4z1c0767seSPW2Q
 u1Z0Xd65Md4zl+4Hgy9MlcxadHpZ+IhHj7FYiUQYvfj9bKZ46cX2aQTB4UEKCQ0RoILP
 K+of2GSU+V9pZ1dOMuS6NN7GcjFIT8aJlYAVbPnZ4o/D0X+Rr2Q3SLjPKCXPdtRTtRHg
 txFw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1744385550; x=1744990350;
 h=to:subject:message-id:date:from:mime-version:x-gm-message-state
 :from:to:cc:subject:date:message-id:reply-to;
 bh=rwKED2nwUnzacdVH40lzvwcUf2Uj55yJ90Tq6vUX34c=;
 b=qzpFMQfbsMmGg+icaagJhwe5naktCITvFJlFnL8xr1r7aWiTPRoy6ZNRU4A9ZomrIA
 so2bhe5j9O4vr/ZIIwPXI/UOR7FUo7fFLfJUILSp8sHpwSOigCFxe+IM/ZV+Hz6W8M00
 GCXCP+uqhUDP5qrp0jdWgvKjVGr+V/ZBc2QxaM+ymdLe0SpGv7ZFtgmC/S9lV2pLK6gW
 /WNcCJZPe/rwEUriggp8iFsAJbjYwUV7olI41u6rEuJkMDbMgyAvI4m/QB0DBEfhI49Z
 oVwJrZuj0gZW1k8ozc4lYGciYf0vkpm+9gNyS0WkdRuUEJLT+S7CTBk6UER9TbXB6amj
 nzGA==
X-Gm-Message-State: AOJu0YzD5MAyGohaNTXY1ThakXRyIX3yJ1JQnC9nV3cjlWioxzelC+KF
 y7mKGCQF9DZehFS+cRK3U57PvRDCn40GApQiUlk/foGTGxHKmwq9/Lec0Obfe50ytY4wGrrvlqG
 5jQ7ZQTO4/zMeIhhsAxWyCQYUyjqLSn7J
X-Gm-Gg: ASbGncuNAiL+RktZbfTkHrssCrOoP/aIIwQX3CvcG+chE310GLkDBiLV6BccM43M1K3
 jzBaVqsXB42xGcoz7oClChm3oeV/6LPrSGkH4WdY0pnCvXnXNecM2RlAZT8u+0KzJX5FuNiLsh7
 4s0iJ6oIvV3XetLV7TePvp1A==
X-Google-Smtp-Source: AGHT+IETBsMZzl0NCgoz07gDgctWs1e4Twb6hPNBqSi0ngKsYcHX8fhYAXvHNPqQRKlv9e2vwSstyLMlbHmYVFXmqKI=
X-Received: by 2002:a05:6122:2202:b0:524:2fe0:3898 with SMTP id
 71dfb90a1353d-527b5ecab7cmr6152955e0c.5.1744385550537; Fri, 11 Apr 2025
 08:32:30 -0700 (PDT)
MIME-Version: 1.0
From: Ship Mints <shipmints@HIDDEN>
Date: Fri, 11 Apr 2025 11:32:18 -0400
X-Gm-Features: ATxdqUHMRRAm361vyadGTXnT60-T6cN9pOoU-4zaluSVF1u3EDOFYYAFrCUhVDU
Message-ID: <CAN+1HbrcbGaR8atcJWL_VnPLMPaHEFB4-R4p97z4i=2=H+WKcg@HIDDEN>
Subject: 'cursor-face-highlight-mode' signals 'args-out-of-range' in narrowed
 buffer
To: bug-gnu-emacs@HIDDEN
Content-Type: multipart/alternative; boundary="000000000000175f53063282692b"
Received-SPF: pass client-ip=2607:f8b0:4864:20::a2f;
 envelope-from=shipmints@HIDDEN; helo=mail-vk1-xa2f.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, TVD_SPACE_RATIO=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 (/)

--000000000000175f53063282692b
Content-Type: text/plain; charset="UTF-8"

-Q reproducer

;; The culprit appears to be `redisplay--update-cursor-face-highlight'
(setq debug-on-error t)
(cursor-face-highlight-mode)
(save-excursion (insert (propertize "cursor face text\n"
                                    'cursor-face 'region)))
(narrow-to-region (pos-bol) (pos-eol))
(setq unread-command-events (mapcar #'identity
                                    (kbd "C-n")))

-Stephane

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

<div dir=3D"ltr"><div class=3D"gmail_default" style=3D"font-family:monospac=
e">-Q reproducer</div><div class=3D"gmail_default" style=3D"font-family:mon=
ospace"><br></div><div class=3D"gmail_default" style=3D"font-family:monospa=
ce">;; The culprit appears to be `redisplay--update-cursor-face-highlight&#=
39;</div><div class=3D"gmail_default" style=3D"font-family:monospace">(setq=
 debug-on-error t)<br>(cursor-face-highlight-mode)<br>(save-excursion (inse=
rt (propertize &quot;cursor face text\n&quot;<br>=C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 &#39;cursor-face &#39;region)))<br>(narrow-to-r=
egion (pos-bol) (pos-eol))<br>(setq unread-command-events (mapcar #&#39;ide=
ntity<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (kbd &quot;C-n&=
quot;)))<br></div><div class=3D"gmail_default" style=3D"font-family:monospa=
ce"><br></div><div class=3D"gmail_default" style=3D"font-family:monospace">=
-Stephane</div></div>

--000000000000175f53063282692b--




Acknowledgement sent to Ship Mints <shipmints@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#77747; 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: Fri, 25 Apr 2025 14:00:05 UTC

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