From unknown Sat Sep 20 11:29:52 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#77747 <77747@debbugs.gnu.org> To: bug#77747 <77747@debbugs.gnu.org> Subject: Status: 'cursor-face-highlight-mode' signals 'args-out-of-range' in narrowed buffer Reply-To: bug#77747 <77747@debbugs.gnu.org> Date: Sat, 20 Sep 2025 18:29:52 +0000 retitle 77747 'cursor-face-highlight-mode' signals 'args-out-of-range' in n= arrowed buffer reassign 77747 emacs submitter 77747 Ship Mints severity 77747 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Fri Apr 11 11:32:43 2025 Received: (at submit) by debbugs.gnu.org; 11 Apr 2025 15:32:43 +0000 Received: from localhost ([127.0.0.1]:51336 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u3GN1-0006p2-2i for submit@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 ) id 1u3GMy-0006om-0H for submit@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 ) id 1u3GMr-0007lq-VL for bug-gnu-emacs@gnu.org; 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 ) id 1u3GMq-0002S7-9F for bug-gnu-emacs@gnu.org; Fri, 11 Apr 2025 11:32:33 -0400 Received: by mail-vk1-xa2f.google.com with SMTP id 71dfb90a1353d-523fa0df55dso2891681e0c.1 for ; 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 Date: Fri, 11 Apr 2025 11:32:18 -0400 X-Gm-Features: ATxdqUHMRRAm361vyadGTXnT60-T6cN9pOoU-4zaluSVF1u3EDOFYYAFrCUhVDU Message-ID: Subject: 'cursor-face-highlight-mode' signals 'args-out-of-range' in narrowed buffer To: bug-gnu-emacs@gnu.org Content-Type: multipart/alternative; boundary="000000000000175f53063282692b" Received-SPF: pass client-ip=2607:f8b0:4864:20::a2f; envelope-from=shipmints@gmail.com; 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@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" 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
-Q reproducer

;; The culprit appears to be `redisplay--update-cursor-face-highlight&#= 39;
(setq= debug-on-error t)
(cursor-face-highlight-mode)
(save-excursion (inse= rt (propertize "cursor face text\n"
=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 'cursor-face 'region)))
(narrow-to-r= egion (pos-bol) (pos-eol))
(setq unread-command-events (mapcar #'ide= ntity
=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 "C-n&= quot;)))

= -Stephane
--000000000000175f53063282692b-- From debbugs-submit-bounces@debbugs.gnu.org Sun Apr 13 05:53:04 2025 Received: (at 77747) by debbugs.gnu.org; 13 Apr 2025 09:53:04 +0000 Received: from localhost ([127.0.0.1]:39374 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u3u1P-0003WI-V0 for submit@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 ) id 1u3u1N-0003Uw-DF for 77747@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 ) 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@gnu.org> From: Eli Zaretskii To: Ship Mints In-Reply-To: (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: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 77747 Cc: 77747@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Ship Mints > 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 From debbugs-submit-bounces@debbugs.gnu.org Sun Apr 13 07:29:08 2025 Received: (at 77747) by debbugs.gnu.org; 13 Apr 2025 11:29:08 +0000 Received: from localhost ([127.0.0.1]:39905 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u3vWJ-0003oY-Kv for submit@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 ) id 1u3vWG-0003mv-1T for 77747@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@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: <86wmbojslo.fsf@gnu.org> In-Reply-To: <86wmbojslo.fsf@gnu.org> From: Ship Mints Date: Sun, 13 Apr 2025 07:28:43 -0400 X-Gm-Features: ATxdqUFsJHeIEi1wDn-UlL91kHDDtAH15qOzV9u3gIu655ivJAsfpbhLyxXEYUU Message-ID: Subject: Re: bug#77747: 'cursor-face-highlight-mode' signals 'args-out-of-range' in narrowed buffer To: Eli Zaretskii Content-Type: multipart/alternative; boundary="0000000000008f3ad40632a73dbb" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 77747 Cc: 77747@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" 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 wrote: > > From: Ship Mints > > 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
= On Sun, Apr 13, 2025 at 5:52=E2=80=AFAM Eli Zaretskii <eliz@gnu.org> wrote:
> From: Ship Mints <shipmints@gmail.com>
> Date: Fri, 11 Apr 2025 11:32:18 -0400
>
> -Q reproducer
>
> ;; The culprit appears to be `redisplay--update-cursor-face-highlight&= #39;
> (setq debug-on-error t)
> (cursor-face-highlight-mode)
> (save-excursion (insert (propertize "cursor face text\n"
>=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'cursor-f= ace 'region)))
> (narrow-to-region (pos-bol) (pos-eol))
> (setq unread-command-events (mapcar #'identity
>=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 "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
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(pt (window-point wi= ndow))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(cursor-face (get-te= xt-property pt 'cursor-face)))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(let* ((start (previous-single-property-c= hange
-=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) 'cursor-face nil (point-min)))
+=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)) 'cursor-face nil (point-min)))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (end (next-single-p= roperty-change
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 pt 'cursor-face nil (point-max)))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (new (redisplay--hi= ghlight-overlay-function

Not quite.=C2=A0 That winds up co= alescing the highlight across lines rather than just the line with the curs= or.

<= /div>
This work= s better but I'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?

diff --git a/lisp/simple.el = b/lisp/simple.el
index 7037158df8d..9ebe9a0ba34 100644
--- a/lisp/sim= ple.el
+++ b/lisp/simple.el
@@ -7259,7 +7259,7 @@ redisplay--update-c= ursor-face-highlight
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0(pt (window-point window))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0(cursor-face (get-text-property pt 'cursor-face)))
= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(let* ((start (previous-single-property-c= hange
- =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 (1+ pt) 'cursor-face nil (point-min)))
+ =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)) 'cursor-face nil (point-min)))
=C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (end (next-single-property-change
=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)))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 (new (redisplay--highlight-overlay-function
--0000000000008f3ad40632a73dbb-- From debbugs-submit-bounces@debbugs.gnu.org Sun Apr 13 07:38:57 2025 Received: (at 77747) by debbugs.gnu.org; 13 Apr 2025 11:38:57 +0000 Received: from localhost ([127.0.0.1]:39924 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u3vfs-0000Fs-55 for submit@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 ) id 1u3vfn-0000Df-Ac for 77747@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@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: <86wmbojslo.fsf@gnu.org> In-Reply-To: From: Ship Mints Date: Sun, 13 Apr 2025 07:38:34 -0400 X-Gm-Features: ATxdqUH1YisMVRlRuYtE1iybatFGtkWxfMZQD0BGKkh4WMJ-XMUVX8SsbVuBZYw Message-ID: Subject: Re: bug#77747: 'cursor-face-highlight-mode' signals 'args-out-of-range' in narrowed buffer To: Eli Zaretskii Content-Type: multipart/alternative; boundary="000000000000ce91550632a76092" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 77747 Cc: 77747@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" 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 wr= ote: > On Sun, Apr 13, 2025 at 5:52=E2=80=AFAM Eli Zaretskii wrot= e: > >> > From: Ship Mints >> > 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
= On Sun, Apr 13, 2025 at 7:28=E2=80=AFAM Ship Mints <shipmints@gmail.com> wrote:
On = Sun, Apr 13, 2025 at 5:52=E2=80=AFAM Eli Zaretskii <eliz@gnu.org> wrote:
> From: Ship Mints <shipmints@gmail.com>
> Date: Fri, 11 Apr 2025 11:32:18 -0400
>
> -Q reproducer
>
> ;; The culprit appears to be `redisplay--update-cursor-face-highlight&= #39;
> (setq debug-on-error t)
> (cursor-face-highlight-mode)
> (save-excursion (insert (propertize "cursor face text\n"
>=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'cursor-f= ace 'region)))
> (narrow-to-region (pos-bol) (pos-eol))
> (setq unread-command-events (mapcar #'identity
>=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 "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
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(pt (window-point wi= ndow))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(cursor-face (get-te= xt-property pt 'cursor-face)))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(let* ((start (previous-single-property-c= hange
-=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) 'cursor-face nil (point-min)))
+=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)) 'cursor-face nil (point-min)))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (end (next-single-p= roperty-change
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 pt 'cursor-face nil (point-max)))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (new (redisplay--hi= ghlight-overlay-function

Not quite.=C2=A0 That winds up coalescing the highlight a= cross lines rather than just the line with the cursor.

This w= orks better but I'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?

diff --git a/lisp/simple.el b/lisp/simple.el
index 7037158df8d..9ebe9a= 0ba34 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -7259,7 = +7259,7 @@ redisplay--update-cursor-face-highlight
=C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(pt (window-point window))
=C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(cursor-face (get-text-propert= y pt 'cursor-face)))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(let* ((start= (previous-single-property-change
- =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (1+ pt) 'cursor-face nil (poi= nt-min)))
+ =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)) 'cursor-face nil (point-min))= )
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (end (next-sin= gle-property-change
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 pt 'cursor-face nil (point-max)))
=C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (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 d= oesn't work in the reproducer and it signals as before.
--000000000000ce91550632a76092-- From debbugs-submit-bounces@debbugs.gnu.org Sun Apr 13 07:55:35 2025 Received: (at 77747) by debbugs.gnu.org; 13 Apr 2025 11:55:36 +0000 Received: from localhost ([127.0.0.1]:39950 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u3vvy-0003VI-01 for submit@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 ) id 1u3vvv-0003Tf-2o for 77747@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 ) 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@gnu.org> From: Eli Zaretskii To: Ship Mints , spacibba@aol.com In-Reply-To: (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: <86wmbojslo.fsf@gnu.org> 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@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Ship Mints > Date: Sun, 13 Apr 2025 07:28:43 -0400 > Cc: 77747@debbugs.gnu.org > > On Sun, Apr 13, 2025 at 5:52 AM Eli Zaretskii wrote: > > > From: Ship Mints > > 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. From debbugs-submit-bounces@debbugs.gnu.org Sun Apr 13 07:56:48 2025 Received: (at 77747) by debbugs.gnu.org; 13 Apr 2025 11:56:49 +0000 Received: from localhost ([127.0.0.1]:39955 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u3vx8-0003j0-Ff for submit@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 ) id 1u3vx4-0003hF-BG for 77747@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 ) 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@gnu.org> From: Eli Zaretskii To: Ship Mints In-Reply-To: (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: <86wmbojslo.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 77747 Cc: 77747@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Ship Mints > Date: Sun, 13 Apr 2025 07:38:34 -0400 > Cc: 77747@debbugs.gnu.org > > Your recommendation doesn't work in the reproducer and it signals as before. Granted, it did work for me. From debbugs-submit-bounces@debbugs.gnu.org Sun Apr 13 08:14:53 2025 Received: (at 77747) by debbugs.gnu.org; 13 Apr 2025 12:14:54 +0000 Received: from localhost ([127.0.0.1]:39981 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u3wEd-0007Bm-3E for submit@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 ) id 1u3wEZ-0007A4-3l for 77747@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@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: <86wmbojslo.fsf@gnu.org> <86cydgjmvh.fsf@gnu.org> In-Reply-To: <86cydgjmvh.fsf@gnu.org> From: Ship Mints Date: Sun, 13 Apr 2025 08:14:30 -0400 X-Gm-Features: ATxdqUFgkfV7aLToeeu3m9cnTqLRJ2a70Uwe9IttPM8e1p-tgZQPS1juISTXMKA Message-ID: Subject: Re: bug#77747: 'cursor-face-highlight-mode' signals 'args-out-of-range' in narrowed buffer To: Eli Zaretskii Content-Type: multipart/alternative; boundary="0000000000004b59160632a7e1c8" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 77747 Cc: 77747@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" 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 wrote: > > From: Ship Mints > > Date: Sun, 13 Apr 2025 07:38:34 -0400 > > Cc: 77747@debbugs.gnu.org > > > > Your recommendation doesn't work in the reproducer and it signals as > before. > > Granted, it did work for me. > 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
= On Sun, Apr 13, 2025 at 7:56=E2=80=AFAM Eli Zaretskii <eliz@gnu.org> wrote:
> From: Ship Mints <shipmints@gmail.com>
> Date: Sun, 13 Apr 2025 07:38:34 -0400
> Cc: 77747@d= ebbugs.gnu.org
>
> Your recommendation doesn't work in the reproducer and it signals = as before.

<Shrug> Granted, it did work for me.

<= div class=3D"gmail_default" style=3D"font-family:monospace"><Shrug> h= ere, too.=C2=A0 It seems my changes to simple.el weren'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.

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

-Stephane
--0000000000004b59160632a7e1c8-- From debbugs-submit-bounces@debbugs.gnu.org Fri Apr 25 09:51:44 2025 Received: (at 77747) by debbugs.gnu.org; 25 Apr 2025 13:51:44 +0000 Received: from localhost ([127.0.0.1]:49050 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u8JSx-0005aN-6c for submit@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 ) id 1u8JSv-0005a2-2d for 77747@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@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: <86wmbojslo.fsf@gnu.org> In-Reply-To: <86wmbojslo.fsf@gnu.org> From: Ship Mints Date: Fri, 25 Apr 2025 09:51:22 -0400 X-Gm-Features: ATxdqUF2H2Ft-MrrxQVyOadYbtGE_my_3YCVdcWLhuzTjyrlDw9GH5iCPaEM2bg Message-ID: Subject: Re: bug#77747: 'cursor-face-highlight-mode' signals 'args-out-of-range' in narrowed buffer To: Eli Zaretskii Content-Type: multipart/alternative; boundary="000000000000f295d606339aa113" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 77747 Cc: 77747@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" 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 wrote: > > From: Ship Mints > > 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
= On Sun, Apr 13, 2025 at 5:52=E2=80=AFAM Eli Zaretskii <eliz@gnu.org> wrote:
> From: Ship Mints <shipmints@gmail.com>
> Date: Fri, 11 Apr 2025 11:32:18 -0400
>
> -Q reproducer
>
> ;; The culprit appears to be `redisplay--update-cursor-face-highlight&= #39;
> (setq debug-on-error t)
> (cursor-face-highlight-mode)
> (save-excursion (insert (propertize "cursor face text\n"
>=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'cursor-f= ace 'region)))
> (narrow-to-region (pos-bol) (pos-eol))
> (setq unread-command-events (mapcar #'identity
>=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 "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
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(pt (window-point wi= ndow))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(cursor-face (get-te= xt-property pt 'cursor-face)))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(let* ((start (previous-single-property-c= hange
-=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) 'cursor-face nil (point-min)))
+=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)) 'cursor-face nil (point-min)))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (end (next-single-p= roperty-change
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 pt 'cursor-face nil (point-max)))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (new (redisplay--hi= ghlight-overlay-function

Eli, possible to apply the above = soon?
--000000000000f295d606339aa113-- From debbugs-submit-bounces@debbugs.gnu.org Fri Apr 25 10:59:03 2025 Received: (at 77747) by debbugs.gnu.org; 25 Apr 2025 14:59:03 +0000 Received: from localhost ([127.0.0.1]:51299 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u8KW7-0006Ee-B9 for submit@debbugs.gnu.org; Fri, 25 Apr 2025 10:59:03 -0400 Received: from mail-ua1-x92a.google.com ([2607:f8b0:4864:20::92a]:57486) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1u8KW4-0006Dx-9d for 77747@debbugs.gnu.org; Fri, 25 Apr 2025 10:59:01 -0400 Received: by mail-ua1-x92a.google.com with SMTP id a1e0cc1a2514c-86ba07fe7a4so2173274241.2 for <77747@debbugs.gnu.org>; Fri, 25 Apr 2025 07:59:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1745593134; x=1746197934; 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=uCmEuidmIBhWKo/pfCHIrSBtBPjQlAhKaPWkzA2nz28=; b=Mfil2+bxI08wz87ZW4D/cw3PIsLq/fqNnrzBm9gZraeVgqSBp+MgyIcBaeDGexAL34 BRnXpxlMH5I6mYTUo4GRME3PEhjADJXNCLHQxSDDCLS2Ymc+50AVumhXlmM68c0HUq0g fVXCy5NvIal5RRdTPO/1ybo1EoA2cHbUKLuD6M/La15AR+l/ck580cQAwYTNmsmJW/8j dKEOM4bPhE1xzMGlDNqZ4ftTfnzq1VidaSTmyBAO9E3xiXnCSFb4fxEqdcS8c63nbDat W9eMT+fOy0Bp9BN2vWjBgTUZBIGYyO62/Crc3FPMMMZmRW5ibpnV7JinGEnFHVfn9sw8 lB5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1745593134; x=1746197934; 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=uCmEuidmIBhWKo/pfCHIrSBtBPjQlAhKaPWkzA2nz28=; b=OKRBWo7pIkgcU4PTCyTahw9EJa3/bH1a/ExkjngsMLVN8Ni6A4PI+rh8TbPWhzantd DwtF3QE8ZW1YMFa3nGY1J3jjudIfX+lxEKZILGFtyhIi/a2GMdlKp5Gq1LJ3CEWl/J8a 3dluECwUXIa88JqgJ9Nb94hDe9UTYzEU5Q7gFP5G7w9UWtraT1lTthZL7UhAPCP1F3aY lxHosqtWewZchvc/3Hv5Vwfqixlg+aLMVkHRztfd9CRD2hCcasTKWvFvqQfzVgwxHBry IIvdwUrToVTFZj32ZTaiJc6AHPij5Nw1eMpyWI/9PpRoXecV7iXiC3gAvh8euFUiuttf KeZQ== X-Gm-Message-State: AOJu0YyJoKrdU/pdK8lKaxs+zZAp6IXCfqBasGZx2yP2+P8f33YVWzYS 7VMXjckr01U6rzDBZcvfc2LkY3aA6crjLxEM5SfEjNbOEPfUStr9Wh4NINcHk53RsvCFqBbHkjL +bKW6QkUBioGHV8+HlaFk7cpxYXw= X-Gm-Gg: ASbGncv6vQB1ukSMxzNMJoRwvUyPwRkojt5y714e5ebmmez/XxLu4CyJQZt09AVEetH Ea4O3VIYhQEDiQlx+GHDYBBRsm/ctysu/vDq3/mt1pmWUFWOTlsKFnD2TSggp0Wa6SabxRV5zas h7t/j8qOWxlFgTmqdwmLaEIQ== X-Google-Smtp-Source: AGHT+IHW/Tm46mbSIp948t7MVTRjXOexJJHF5jsoQekbqOYB+lUqiWk1tXJUgL0wVetXsqn1K/v8EqlXhQ84cDZBqWw= X-Received: by 2002:a05:6102:801b:b0:4bb:c24b:b658 with SMTP id ada2fe7eead31-4d54536915emr1546322137.18.1745593134438; Fri, 25 Apr 2025 07:58:54 -0700 (PDT) MIME-Version: 1.0 References: <86wmbojslo.fsf@gnu.org> In-Reply-To: From: Ship Mints Date: Fri, 25 Apr 2025 10:58:43 -0400 X-Gm-Features: ATxdqUFtBp8YWV4qFCk-un0k89SGvJk4AQyZPMgAeQvoHKEh8MdGlnxvaBQCelM Message-ID: Subject: Re: bug#77747: 'cursor-face-highlight-mode' signals 'args-out-of-range' in narrowed buffer To: Eli Zaretskii Content-Type: multipart/alternative; boundary="000000000000b3609b06339b9272" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 77747 Cc: 77747@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --000000000000b3609b06339b9272 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, Apr 25, 2025 at 9:51=E2=80=AFAM Ship Mints wr= ote: > On Sun, Apr 13, 2025 at 5:52=E2=80=AFAM Eli Zaretskii wrot= e: > >> > From: Ship Mints >> > 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? > Actually, I'm back to thinking this is better or the effect is that the whole buffer can wind up being unexpectedly highlighted: (min (1+ pt) (pos-bol)) 'cursor-face nil (point-min))) --000000000000b3609b06339b9272 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
= On Fri, Apr 25, 2025 at 9:51=E2=80=AFAM Ship Mints <shipmints@gmail.com> wrote:
On = Sun, Apr 13, 2025 at 5:52=E2=80=AFAM Eli Zaretskii <eliz@gnu.org> wrote:
> From: Ship Mints <shipmints@gmail.com>
> Date: Fri, 11 Apr 2025 11:32:18 -0400
>
> -Q reproducer
>
> ;; The culprit appears to be `redisplay--update-cursor-face-highlight&= #39;
> (setq debug-on-error t)
> (cursor-face-highlight-mode)
> (save-excursion (insert (propertize "cursor face text\n"
>=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'cursor-f= ace 'region)))
> (narrow-to-region (pos-bol) (pos-eol))
> (setq unread-command-events (mapcar #'identity
>=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 "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
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(pt (window-point wi= ndow))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(cursor-face (get-te= xt-property pt 'cursor-face)))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(let* ((start (previous-single-property-c= hange
-=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) 'cursor-face nil (point-min)))
+=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)) 'cursor-face nil (point-min)))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (end (next-single-p= roperty-change
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 pt 'cursor-face nil (point-max)))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (new (redisplay--hi= ghlight-overlay-function

Eli, possible to apply the above soon?
<= /blockquote>

Actually, I'm back to thinking this is better or the effec= t is that the whole buffer can wind up being unexpectedly highlighted:

=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) (pos-bol)) 'cursor-face nil (point-min)))
--000000000000b3609b06339b9272-- From debbugs-submit-bounces@debbugs.gnu.org Fri Apr 25 12:22:01 2025 Received: (at 77747) by debbugs.gnu.org; 25 Apr 2025 16:22:01 +0000 Received: from localhost ([127.0.0.1]:51905 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u8LoO-00048U-So for submit@debbugs.gnu.org; Fri, 25 Apr 2025 12:22:01 -0400 Received: from mail-qt1-x829.google.com ([2607:f8b0:4864:20::829]:50585) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1u8LoM-000482-Hp for 77747@debbugs.gnu.org; Fri, 25 Apr 2025 12:21:59 -0400 Received: by mail-qt1-x829.google.com with SMTP id d75a77b69052e-4775ce8a4b0so46764911cf.1 for <77747@debbugs.gnu.org>; Fri, 25 Apr 2025 09:21:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1745598112; x=1746202912; 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=sXSvUdX/qeNFzpvccyC1UOiGzKTVofc0VT+PSeeBKa4=; b=eorBZ4j6H7tWmhm0AGOnyMrA68XCOnpgWF2FF5PCLLD8BKVq5SU/tghvjoHRBElhki rb/8LwMcjjjS2bd8YAYjUAGx2eO93PMN2kd10g0f9O0bJn6vWzf4TYFsXHaEC3N+Msxj z9hnHPrqPk/267mjWF0gDs7sQLScax4aLl/Z/TgpUdaVFteRWjbfKjdTckkKGZRbfgZ4 V+DMOQ+ZMntFSEWLYJuf6YKnCR4H8snfP44em8sFFrcZYh4OfhogonYtGapdDbdN5IkP DAVZlJq5ueMm0zv0GMD7OkiaQaIqzO2ig9POclSZ/mGAmgjOTQ4+NydqZ3UvXf9k91hA yxdg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1745598112; x=1746202912; 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=sXSvUdX/qeNFzpvccyC1UOiGzKTVofc0VT+PSeeBKa4=; b=dlRO6UFclnFW5gBp1ot0+GGMjHQASd4CBqBBXXtIypUZa/q64n5PLmnrva3RV0BkQh OrLEVj5ay5Kqv9x9dRwwcH3xK1LvDjsh6eWOHZiY48Kpm8UXZdmSIkQ1Gdd6WVgmko9C 9/nEovOM9I5gHUyUz3ZIQxf7z9davtvzjcaAWt4yoaSKm8SiJnwpDJ1VN8owuB/4O2wY tmCgYxUNwEpeeZY4WQ/LFTBNAA4iOPMCLo76qdPbaEdLq6yQQ8yUHR2UvIyXyjURKPBv 3HrMKxicPww9nkTo5MDd5TUQ6PJiCUvD1Q+wqlGOX2wAVlw14dUDWCOcAf9e4VeZRn9G pEpw== X-Gm-Message-State: AOJu0YxoFzzzC0aiCJQ3MbHknWYSL2xBYQnIQDtCJZlS2XKqiFoVuttd ixZFwAD/7dtu40YzZbMNE1KC9FIPZlzolMe1kREpNVUz9p/RVBfSW4iwGklCVIsquOzTjsSLjDJ sJ7U1ulYfLITTEEcw4lRVaPWn4PMi6aA1 X-Gm-Gg: ASbGncvxiB7+0JeGk/jLpzH2qu7oC2Ymv80vwJbRPGq2gxB3/ikwm/DxhyGMa90h06x K3lOP8auv6ktQl8gug85DU4H6ZUk/RQh5GYBcW8ASFzhO7XOmeQaN8P/VDpscGAKidCbcrCLxrH 1slBPVuV0qnJyjlBw2zapgvtyYtAuaEq1B X-Google-Smtp-Source: AGHT+IH927ZnLk+Hj0xxZh0PUPMRbVjTHKMdRt9Qpyaz8qvZ5olkUkhafzTHwVmHiGEWoYdPaNCNT+Fv2FYiZ/1oaSg= X-Received: by 2002:a05:622a:58c3:b0:476:a713:f792 with SMTP id d75a77b69052e-4801ecce1e3mr58808141cf.49.1745598111774; Fri, 25 Apr 2025 09:21:51 -0700 (PDT) MIME-Version: 1.0 References: <86wmbojslo.fsf@gnu.org> In-Reply-To: From: Ship Mints Date: Fri, 25 Apr 2025 12:21:40 -0400 X-Gm-Features: ATxdqUHKNj6ZO1aPHDgEJUqJk06nK-ZN2LqulUozQCYKDmDisKbC93kFgGasJBk Message-ID: Subject: Re: bug#77747: 'cursor-face-highlight-mode' signals 'args-out-of-range' in narrowed buffer To: Eli Zaretskii Content-Type: multipart/alternative; boundary="0000000000005f7b2b06339cbb40" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 77747 Cc: 77747@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --0000000000005f7b2b06339cbb40 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, Apr 25, 2025 at 10:58=E2=80=AFAM Ship Mints w= rote: > On Fri, Apr 25, 2025 at 9:51=E2=80=AFAM Ship Mints = wrote: > >> On Sun, Apr 13, 2025 at 5:52=E2=80=AFAM Eli Zaretskii wro= te: >> >>> > From: Ship Mints >>> > 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? >> > > Actually, I'm back to thinking this is better or the effect is that the > whole buffer can wind up being unexpectedly highlighted: > > (min (1+ pt) (pos-bol)) 'cursor-face nil > (point-min))) > To be clearer: The original condition (1+ pt) 'cursor-face nil (point-min))) works fine in a wide buffer. The condition (min (1+ pt) (point-min)) 'cursor-face nil (point-min))) in a wide buffer winds up highlighting all the way to point-min in a buffer where every line has 'cursor-face which is undesirable. I've experimented and tried to have 'cursor-face span only bol to eol-2 and that is confirmed visually, yet the entire buffer before the current line is highlighted in the cursor face. mouse-face highlighting on the same lines (the text properties are applied all together) works properly whether the buffer is narrowed or wide. I suppose it's technically doing the correct thing if every single line in a buffer has a cursor-face property? How does one differentiate one line from another, if so, and why does mouse-face work differently? --0000000000005f7b2b06339cbb40 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
= On Fri, Apr 25, 2025 at 10:58=E2=80=AFAM Ship Mints <shipmints@gmail.com> wrote:
On= Fri, Apr 25, 2025 at 9:51=E2=80=AFAM Ship Mints <shipmints@gmail.com> wrote:
On Sun, A= pr 13, 2025 at 5:52=E2=80=AFAM Eli Zaretskii <eliz@gnu.org> wrote:
>= ; From: Ship Mints <shipmints@gmail.com>
> Date: Fri, 11 Apr 2025 11:32:18 -0400
>
> -Q reproducer
>
> ;; The culprit appears to be `redisplay--update-cursor-face-highlight&= #39;
> (setq debug-on-error t)
> (cursor-face-highlight-mode)
> (save-excursion (insert (propertize "cursor face text\n"
>=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'cursor-f= ace 'region)))
> (narrow-to-region (pos-bol) (pos-eol))
> (setq unread-command-events (mapcar #'identity
>=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 "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
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(pt (window-point wi= ndow))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(cursor-face (get-te= xt-property pt 'cursor-face)))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(let* ((start (previous-single-property-c= hange
-=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) 'cursor-face nil (point-min)))
+=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)) 'cursor-face nil (point-min)))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (end (next-single-p= roperty-change
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 pt 'cursor-face nil (point-max)))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (new (redisplay--hi= ghlight-overlay-function

Eli, possible to apply the above soon?
<= /blockquote>

Actually, I= 'm back to thinking this is better or the effect is that the whole buff= er can wind up being unexpectedly highlighted:

=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) (pos-bol)) 'cursor-face nil (point-min)))
<= /blockquote>

To be clearer:

The original condition=C2=A0(1+ pt) 'cursor-face nil (po= int-min))) works fine in a wide buffer.

The condition=C2=A0(min (1+ pt) (point-min)) = 9;cursor-face nil (point-min))) in a wide buffer winds up highlighting all = the way to point-min in a buffer where every line has 'cursor-face whic= h is undesirable.

I've experimented and tried to have 'cursor-face span only bol= to eol-2 and that is confirmed visually, yet the entire buffer before the = current line is highlighted in the cursor face.

mouse-face highlighting on the same line= s (the text properties are applied all together) works properly whether the= buffer is narrowed or wide.

I suppose it's technically doing the correct thing if e= very single line in a buffer has a cursor-face property?=C2=A0 How does one= differentiate one line from another, if so, and why does mouse-face work d= ifferently?
--0000000000005f7b2b06339cbb40-- From debbugs-submit-bounces@debbugs.gnu.org Fri Apr 25 14:37:53 2025 Received: (at 77747) by debbugs.gnu.org; 25 Apr 2025 18:37:53 +0000 Received: from localhost ([127.0.0.1]:52878 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u8Nvs-0006A3-TI for submit@debbugs.gnu.org; Fri, 25 Apr 2025 14:37:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57616) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1u8Nvq-00069Z-Bg for 77747@debbugs.gnu.org; Fri, 25 Apr 2025 14:37:50 -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 ) id 1u8Nvl-0006Cz-0D; Fri, 25 Apr 2025 14:37:45 -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=+wuZOpLMdW5vH41eV+5RxH8vOgDodPqm+FSiH5cmUdA=; b=A+0LxrB32oawuyAU1Zoz qTz6KClmpd/m/XyP32ZQSVsxSAG/9S2BlUpho7YtyQlAwBY/y3ZgIoVyG5kCjQHx0RVZusTLq7HCh imhpiB7rwUbrD5qSCgBCMGuYhArJTisgG+lmuCwqEB4elvCdhzqLSHyw5pDvnuzULMnsLt0hd6psR a076F+mMIxBM9Kx0Xgz/C9QXomEBxTHlJl3sLrC+ze+x88L772sij9uHWu2+CsNiRyH2FfzKnEiUm 0BTfwlgKDf0Nc3JGpSNzOdoi0l33C3WincqlVJHVg3gS1JfKw20/fBJ0FkYUwBMWB+WWQ0aZ2Fz2+ kh/owLwDj36xkw==; Date: Fri, 25 Apr 2025 21:37:42 +0300 Message-Id: <86o6wkw0i1.fsf@gnu.org> From: Eli Zaretskii To: Ship Mints In-Reply-To: (message from Ship Mints on Fri, 25 Apr 2025 12:21:40 -0400) Subject: Re: bug#77747: 'cursor-face-highlight-mode' signals 'args-out-of-range' in narrowed buffer References: <86wmbojslo.fsf@gnu.org> 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@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Ship Mints > Date: Fri, 25 Apr 2025 12:21:40 -0400 > Cc: 77747@debbugs.gnu.org > > On Fri, Apr 25, 2025 at 10:58 AM Ship Mints wrote: > > On Fri, Apr 25, 2025 at 9:51 AM Ship Mints wrote: > > On Sun, Apr 13, 2025 at 5:52 AM Eli Zaretskii wrote: > > > From: Ship Mints > > 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? > > Actually, I'm back to thinking this is better or the effect is that the whole buffer can wind up being > unexpectedly highlighted: > > (min (1+ pt) (pos-bol)) 'cursor-face nil (point-min))) > > To be clearer: > > The original condition (1+ pt) 'cursor-face nil (point-min))) works fine in a wide buffer. > > The condition (min (1+ pt) (point-min)) 'cursor-face nil (point-min))) in a wide buffer winds up highlighting all > the way to point-min in a buffer where every line has 'cursor-face which is undesirable. It should obviously be point-max, not point-min. From debbugs-submit-bounces@debbugs.gnu.org Fri Apr 25 15:24:23 2025 Received: (at 77747) by debbugs.gnu.org; 25 Apr 2025 19:24:23 +0000 Received: from localhost ([127.0.0.1]:53245 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u8Oes-0001D8-NB for submit@debbugs.gnu.org; Fri, 25 Apr 2025 15:24:23 -0400 Received: from mail-vk1-xa30.google.com ([2607:f8b0:4864:20::a30]:43492) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1u8Oeq-0001Cp-08 for 77747@debbugs.gnu.org; Fri, 25 Apr 2025 15:24:20 -0400 Received: by mail-vk1-xa30.google.com with SMTP id 71dfb90a1353d-5290be1aedcso3901964e0c.1 for <77747@debbugs.gnu.org>; Fri, 25 Apr 2025 12:24:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1745609054; x=1746213854; 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=MVu5Op4cetCAPoF9jf6D1RR2AtHpExaCXzrE3GxKzSI=; b=etm1sGbrimatLKGDySlyZE5p71Q7eKiE3cy8gXHf6sz5USf4OFl61KyKwBkqfv9SgR ykfY/hvGFh6Er/QnvUu2nQatff2Jj/38ctcB066Hfq559OVvckwP7pgkEhre9LcNbity Yxo49HQUeFb4rvCFDiZnNgThnI+5CMMzdFe/BAaBrmIXMEIraLVpFPTAH6p//APxKjdw DACI3PyWmgR0+ZSOhDtnKcZHJ8lNTy4c3YrTegdPbuLUTzY6fprJfXJBhBV2YC2mUTAb D3xWz6SD3Dc20ZYP8oW2qv3CNN7Wklqfb8K3c9OdszmfBQtJJzsBPI7vfnVQc+k4qEoY 6NMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1745609054; x=1746213854; 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=MVu5Op4cetCAPoF9jf6D1RR2AtHpExaCXzrE3GxKzSI=; b=WCiiloiZZ1bBfudsijW0ZLL+gJnvIruZB6rpJHo6ljeBxVsfFtkQQzSkRNoISkbXe/ BmAWsTJdlAcSwi5DjJmymx76AQDMYenjk/lxvh8RLFF8CqF+bpgjS/r2lTtw5YHRPNBu etn+lYxNaRDfJGo25SkE3MYRNR8IyQLaCzKtI/5FWmgtauXpstax9KB1gS0RgPmhmn9r TTjxMtNodKScyiuFzqsXayM0H8IiNr6RMZZ4xaLG+onrjIE0q49CKz5AdOnJKcoFlSC4 AIrdzNRGBItw7dDqxwjqXJix/GX7Wh4Mxu9/FD537dbso8Rdja2ihJRkOAnN4Pe0bDfg Ev4Q== X-Gm-Message-State: AOJu0YyUMmwMwkXPupH9Z5dCIsux2t+JP5IM4sifnbTfMeLFZOXo6YSd SB8uAriviwab+GsmELcGuOeUZrRt8m6PpHd5AE6cd+LO9zu9HjO+b0d5LU9tkCrhE4evGeBF1K+ mC+Z4ViWeEzxTiP9B6TQrKpBqWbY= X-Gm-Gg: ASbGncvJBAJGo6232nuiMsVcO03edoym98UUjhEr40q6oF5qXLJMIPP0nhO31mjg78K LL17zoWVi5B6ePStvae7sgZZnhAZJ25of6Caek2bcSOi/X7ODf7csp4r9UkNzGGsNXK8lwC+h8d cvOk2hRLOUQvWRrXadbNVp9A== X-Google-Smtp-Source: AGHT+IGWHp925eGtwXXHVloSHRy8eWhXGWy8KGw4LjUTM11NUFcA8TtDRDSREgGpFZScuIEAujW1FL68vdVIBwXxSvk= X-Received: by 2002:a05:6122:d89:b0:520:4fff:4c85 with SMTP id 71dfb90a1353d-52a8a62d83fmr3027914e0c.2.1745609053924; Fri, 25 Apr 2025 12:24:13 -0700 (PDT) MIME-Version: 1.0 References: <86wmbojslo.fsf@gnu.org> <86o6wkw0i1.fsf@gnu.org> In-Reply-To: <86o6wkw0i1.fsf@gnu.org> From: Ship Mints Date: Fri, 25 Apr 2025 15:24:02 -0400 X-Gm-Features: ATxdqUGUZdE1nWeJ0PFboTBcuRdQyxuugnUDli8ztJ-G_zERhOtJviMTId9JZz0 Message-ID: Subject: Re: bug#77747: 'cursor-face-highlight-mode' signals 'args-out-of-range' in narrowed buffer To: Eli Zaretskii Content-Type: multipart/alternative; boundary="0000000000009375d706339f474a" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 77747 Cc: 77747@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --0000000000009375d706339f474a Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, Apr 25, 2025 at 2:37=E2=80=AFPM Eli Zaretskii wrote: > > From: Ship Mints > > Date: Fri, 25 Apr 2025 12:21:40 -0400 > > Cc: 77747@debbugs.gnu.org > > > > On Fri, Apr 25, 2025 at 10:58=E2=80=AFAM Ship Mints wrote: > > > > On Fri, Apr 25, 2025 at 9:51=E2=80=AFAM Ship Mints wrote: > > > > On Sun, Apr 13, 2025 at 5:52=E2=80=AFAM Eli Zaretskii w= rote: > > > > > From: Ship Mints > > > Date: Fri, 11 Apr 2025 11:32:18 -0400 > > > > > > -Q reproducer > > > > > > ;; The culprit appears to be `redisplay--update-cursor-face-highligh= t' > > > (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? > > > > Actually, I'm back to thinking this is better or the effect is that th= e > whole buffer can wind up being > > unexpectedly highlighted: > > > > (min (1+ pt) (pos-bol)) 'cursor-face nil > (point-min))) > > > > To be clearer: > > > > The original condition (1+ pt) 'cursor-face nil (point-min))) works fin= e > in a wide buffer. > > > > The condition (min (1+ pt) (point-min)) 'cursor-face nil (point-min))) > in a wide buffer winds up highlighting all > > the way to point-min in a buffer where every line has 'cursor-face whic= h > is undesirable. > > It should obviously be point-max, not point-min. > Yeah. Of course. Feel free to apply AFAIC. --0000000000009375d706339f474a Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
= On Fri, Apr 25, 2025 at 2:37=E2=80=AFPM Eli Zaretskii <eliz@gnu.org> wrote:
> From: Ship Mints <shipmints@gmail.com>
> Date: Fri, 25 Apr 2025 12:21:40 -0400
> Cc: 77747@d= ebbugs.gnu.org
>
> On Fri, Apr 25, 2025 at 10:58=E2=80=AFAM Ship Mints <shipmints@gmail.com> wrot= e:
>
>=C2=A0 On Fri, Apr 25, 2025 at 9:51=E2=80=AFAM Ship Mints <shipmints@gmail.com&g= t; wrote:
>
>=C2=A0 On Sun, Apr 13, 2025 at 5:52=E2=80=AFAM Eli Zaretskii <eliz@gnu.org> wrote:
>
>=C2=A0 > From: Ship Mints <shipmints@gmail.com>
>=C2=A0 > Date: Fri, 11 Apr 2025 11:32:18 -0400
>=C2=A0 >
>=C2=A0 > -Q reproducer
>=C2=A0 >
>=C2=A0 > ;; The culprit appears to be `redisplay--update-cursor-face= -highlight'
>=C2=A0 > (setq debug-on-error t)
>=C2=A0 > (cursor-face-highlight-mode)
>=C2=A0 > (save-excursion (insert (propertize "cursor face text\= n"
>=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 =C2=A0&#= 39;cursor-face 'region)))
>=C2=A0 > (narrow-to-region (pos-bol) (pos-eol))
>=C2=A0 > (setq unread-command-events (mapcar #'identity
>=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 =C2=A0(k= bd "C-n")))
>
>=C2=A0 Thanks, does the below fix it?
>
>=C2=A0 diff --git a/lisp/simple.el b/lisp/simple.el
>=C2=A0 index ee09a6f..9e9dd15 100644
>=C2=A0 --- a/lisp/simple.el
>=C2=A0 +++ b/lisp/simple.el
>=C2=A0 @@ -7265,7 +7265,7 @@ redisplay--update-cursor-face-highlight >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(pt (wind= ow-point window))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(cursor-f= ace (get-text-property pt 'cursor-face)))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(let* ((start (previous-single= -property-change
>=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(1+ pt) 'cursor-face nil (point-min)))
>=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(min (1+ pt) (point-min)) 'cursor-face nil (point-m= in)))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (end (ne= xt-single-property-change
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 pt 'cursor-face nil (point-max)))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (new (re= display--highlight-overlay-function
>
>=C2=A0 Eli, possible to apply the above soon?
>
>=C2=A0 Actually, I'm back to thinking this is better or the effect = is that the whole buffer can wind up being
>=C2=A0 unexpectedly highlighted:
>
>=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(min (1+ pt) (pos-bol)) 'cursor-face nil (point-min= )))
>
> To be clearer:
>
> The original condition (1+ pt) 'cursor-face nil (point-min))) work= s fine in a wide buffer.
>
> The condition (min (1+ pt) (point-min)) 'cursor-face nil (point-mi= n))) in a wide buffer winds up highlighting all
> the way to point-min in a buffer where every line has 'cursor-face= which is undesirable.

It should obviously be point-max, not point-min.

<= /div>
Yeah.=C2= =A0 Of course.=C2=A0 Feel free to apply AFAIC.
--0000000000009375d706339f474a-- From debbugs-submit-bounces@debbugs.gnu.org Sat Apr 26 10:21:40 2025 Received: (at 77747-done) by debbugs.gnu.org; 26 Apr 2025 14:21:40 +0000 Received: from localhost ([127.0.0.1]:33789 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u8gPU-0005BT-52 for submit@debbugs.gnu.org; Sat, 26 Apr 2025 10:21:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54662) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1u8gPQ-0005BD-M1 for 77747-done@debbugs.gnu.org; Sat, 26 Apr 2025 10:21:37 -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 ) id 1u8gPL-0003Tl-4y; Sat, 26 Apr 2025 10:21:31 -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=GpOqDCLXDTrtNpH1mNJp5QW4X9BfNe+kqSGOAtngpFc=; b=aHdty7zN88vczG1Cltr9 5Dn3ch6H1Q29hd3RAGd/HVicMD7CiJwuCiszvRGnKXuK1RO7yqB+z2PybE7UjMaRN48Hkk7Ocq9jL iN/9JFKsTJ9DFs2+reN41Lng0TyWoFldYzt+iwPAQ8g+kyRvrzL29iZ1KnZj8VjK+sfHmQfSrrJUM ub+XE+UN2EwbIYcfVAlkvNKa5JccTxBSp3ndh6ZhJlS5puFmQIrDg1wgFQAw/96LU4xhOnpa4cHK/ mNEUrZyOHKLEvMDLnwir9ff38zn6h9f+S+A+aY6Bhz7nFpIHVh8aY+AeubKGOvTLRA21/80xX1XFh TmX4kMAwVVnvdQ==; Date: Sat, 26 Apr 2025 17:21:26 +0300 Message-Id: <867c37t34p.fsf@gnu.org> From: Eli Zaretskii To: Ship Mints In-Reply-To: (message from Ship Mints on Fri, 25 Apr 2025 15:24:02 -0400) Subject: Re: bug#77747: 'cursor-face-highlight-mode' signals 'args-out-of-range' in narrowed buffer References: <86wmbojslo.fsf@gnu.org> <86o6wkw0i1.fsf@gnu.org> 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-done Cc: 77747-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Ship Mints > Date: Fri, 25 Apr 2025 15:24:02 -0400 > Cc: 77747@debbugs.gnu.org > > On Fri, Apr 25, 2025 at 2:37 PM Eli Zaretskii wrote: > > > From: Ship Mints > > Date: Fri, 25 Apr 2025 12:21:40 -0400 > > Cc: 77747@debbugs.gnu.org > > > > On Fri, Apr 25, 2025 at 10:58 AM Ship Mints wrote: > > > > On Fri, Apr 25, 2025 at 9:51 AM Ship Mints wrote: > > > > On Sun, Apr 13, 2025 at 5:52 AM Eli Zaretskii wrote: > > > > > From: Ship Mints > > > 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? > > > > Actually, I'm back to thinking this is better or the effect is that the whole buffer can wind up being > > unexpectedly highlighted: > > > > (min (1+ pt) (pos-bol)) 'cursor-face nil (point-min))) > > > > To be clearer: > > > > The original condition (1+ pt) 'cursor-face nil (point-min))) works fine in a wide buffer. > > > > The condition (min (1+ pt) (point-min)) 'cursor-face nil (point-min))) in a wide buffer winds up > highlighting all > > the way to point-min in a buffer where every line has 'cursor-face which is undesirable. > > It should obviously be point-max, not point-min. > > Yeah. Of course. Feel free to apply AFAIC. Done. From unknown Sat Sep 20 11:29:52 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sun, 25 May 2025 11:24:19 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator