GNU bug report logs - #77224
[PATCH] New minor mode 'cursor-indicators-mode'

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: Elijah Gabe Pérez <eg642616@HIDDEN>; Keywords: patch; dated Sun, 23 Mar 2025 22:59:03 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

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


Received: (at 77224) by debbugs.gnu.org; 29 Mar 2025 12:15:58 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Mar 29 08:15:58 2025
Received: from localhost ([127.0.0.1]:57413 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tyV6T-0001vk-HF
	for submit <at> debbugs.gnu.org; Sat, 29 Mar 2025 08:15:58 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:56730)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1tyV6R-0001gj-1i
 for 77224 <at> debbugs.gnu.org; Sat, 29 Mar 2025 08:15:56 -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 1tyV6J-0001qp-7A; Sat, 29 Mar 2025 08:15:47 -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=xVbUbxcBQ54hrUUqq5sNwyJ07yGyCSDE+hHVWKHl1gg=; b=hFTTREnbPmZy
 N0WzsvnlJiupextQt+7zBH00DpuemYg86LqzfwMZZOok7jLAo+x+QMlnNYRyneF3CIrJzMfsSvaW8
 GouR/MdVE7u/cGrRMCoaFgTVEpi5u1kZQ0YmYM4LgjZ5nJwhHnA9IRbOF4UaERGsglbH+dRoZa50Y
 eqfYtt7/0G7kAxEjYdM41WyTScoMADlpUtmqV2RVltw3OC0vRagmRY2vEMuy7GzmFriluz/Lm8KRn
 8Gh7CHOfYUxgXwb7FKyjN2u6whRyZSisUoJ9anfiQHhyRlnEOklQETsdTlqsh01eWxLqvT4spatHI
 NyyuI+ViiWPTXIykcVOf9A==;
Date: Sat, 29 Mar 2025 15:15:41 +0300
Message-Id: <86friw6niq.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Daniel Mendler <mail@HIDDEN>
In-Reply-To: <87cye09ouq.fsf@HIDDEN> (message from Daniel Mendler
 on Sat, 29 Mar 2025 10:18:37 +0100)
Subject: Re: bug#77224: [PATCH] New minor mode 'cursor-indicators-mode'
References: <87iknzxski.fsf@HIDDEN> <8634f0dkhq.fsf@HIDDEN>
 <875xjvcn4o.fsf@HIDDEN> <877c4b81nk.fsf@HIDDEN>
 <86ecyidg2d.fsf@HIDDEN> <87h63ekdxe.fsf@HIDDEN>
 <86cye2d8t6.fsf@HIDDEN> <87a596a29y.fsf@HIDDEN>
 <86tt7ebfnc.fsf@HIDDEN> <877c4aa0m8.fsf@HIDDEN>
 <86pli2befe.fsf@HIDDEN> <878qoq5iui.fsf@HIDDEN>
 <86bjtlbqge.fsf@HIDDEN> <87msd5rwnm.fsf@HIDDEN>
 <86frix9kv0.fsf@HIDDEN> <87frixaymv.fsf@HIDDEN>
 <86ecyg9v51.fsf@HIDDEN> <87friwxoie.fsf@HIDDEN>
 <861pug9rol.fsf@HIDDEN> <87bjtkz186.fsf@HIDDEN>
 <86wmc88bl3.fsf@HIDDEN> <87cye09ouq.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 77224
Cc: 77224 <at> debbugs.gnu.org, eg642616@HIDDEN, juri@HIDDEN
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: Daniel Mendler <mail@HIDDEN>
> Cc: eg642616@HIDDEN,  77224 <at> debbugs.gnu.org,  juri@HIDDEN
> Date: Sat, 29 Mar 2025 10:18:37 +0100
> 
> Eli Zaretskii <eliz@HIDDEN> writes:
> 
> >> From: Daniel Mendler <mail@HIDDEN>
> >> Cc: eg642616@HIDDEN,  77224 <at> debbugs.gnu.org,  juri@HIDDEN
> >> Date: Sat, 29 Mar 2025 09:32:09 +0100
> >> 
> >> Eli Zaretskii <eliz@HIDDEN> writes:
> >> 
> >> >> From: Daniel Mendler <mail@HIDDEN>
> >> >> Cc: eg642616@HIDDEN,  77224 <at> debbugs.gnu.org,  juri@HIDDEN
> >> >> Date: Sat, 29 Mar 2025 08:52:09 +0100
> >> >> 
> >> >> The `hl-line-highlight' moves the line highlight overlay, such that it
> >> >> moves immediately with the cursor and does not lag behind.
> >> >
> >> > You may not be aware, but moving and changing overlays disables some
> >> > redisplay optimizations, and in many cases can trigger an additional
> >> > immediate redisplay cycle.  So doing that after every command exits
> >> > in practice means every redisplay cycle is adversely affected.
> >> 
> >> I am aware. What do you suggest as an alternative? It would look odd if
> >> the `hl-line-overlay' would not move directly with the cursor and would
> >> lag behind.
> >
> > I could suggest one or two alternatives, but is it worth our time?  is
> > someone actually considering any such changes?
> 
> Please do. I would like to understand your ideas.

One idea is to use an idle timer.  Another is to reimplement this in
the display engine (which tracks the cursor position as part of its
job).

> > My point was and remains the same: adding more and more features to
> > post-command-hook is something to be avoided.
> 
> Your argument from above does not matter in the case of `cursor-type'.
> Since most commands do not trigger a modification of the `cursor-type',
> the only cost that gets added to the `post-command-hooks' is the
> inexpensive check of a few variables or conditions, which will not
> affect redisplay.
> 
> I still do not understand why you are so strongly against a
> `post-command-hook' in this case. I see that you are out of principle
> against `post-command-hooks'. This makes sense given that these hooks
> can be abused easily.
> 
> However in certain scenarios, after careful consideration, they might be
> acceptable. As Juri mentioned, a `post-command-hook' allows us to
> reliably change the `cursor-type' based on arbitrary conditions. In
> contrast, if we use multiple hooks, which are registered in multiple
> different subsystems, it is easy to miss relevant state changes.

I think I already said everything I could, and repetition will not
help.  So I will respectfully bow out of this discussion.




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

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


Received: (at 77224) by debbugs.gnu.org; 29 Mar 2025 10:07:32 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Mar 29 06:07:32 2025
Received: from localhost ([127.0.0.1]:56990 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tyT6B-0006qZ-VD
	for submit <at> debbugs.gnu.org; Sat, 29 Mar 2025 06:07:32 -0400
Received: from mail-pl1-x642.google.com ([2607:f8b0:4864:20::642]:53263)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <visuweshm@HIDDEN>)
 id 1tyT68-0006qJ-VZ
 for 77224 <at> debbugs.gnu.org; Sat, 29 Mar 2025 06:07:29 -0400
Received: by mail-pl1-x642.google.com with SMTP id
 d9443c01a7336-2239c066347so69537595ad.2
 for <77224 <at> debbugs.gnu.org>; Sat, 29 Mar 2025 03:07:28 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1743242843; x=1743847643; darn=debbugs.gnu.org;
 h=content-transfer-encoding:mime-version:message-id:references
 :in-reply-to:user-agent:subject:cc:to:from:date:from:to:cc:subject
 :date:message-id:reply-to;
 bh=2tQ91IV7NpHHPG5KQkMB5+xv9SvIQzlVw9LARGq16vI=;
 b=H1GTrE/YMXOKoGltbMCwUGlBYa5XbNO463Ing0ugFTb9CenVLS101cX0S3pv+14a2M
 FWVLKoneOOyzBhOfFPxTsn6gPjMRo33P3xsjM+y4NAuVw0za4f9Ih/DhZpO1GSvm04EK
 BotOjX/6Cwpg84l/w/hPYPLvEbgAPbwmvPx650o3vfPb8DU8XLPF8F5+IEooBmFmeiHb
 TQDlVVLr8Pgwi21TFLvNgwp5Z9Krm3TCriB5Q2bs1yU9ufXuMdPKekLxrQg2H1eew/P7
 bDIny5Wx/kuFeYfM8pQ9oTijJ2BPxcmsyqTNrYpuV5PxFmZRoHLbkcFxRx0hnQQ3RCHh
 Zc9g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1743242843; x=1743847643;
 h=content-transfer-encoding:mime-version:message-id:references
 :in-reply-to:user-agent:subject:cc:to:from:date:x-gm-message-state
 :from:to:cc:subject:date:message-id:reply-to;
 bh=2tQ91IV7NpHHPG5KQkMB5+xv9SvIQzlVw9LARGq16vI=;
 b=gruqvTKre3k2KxWgJnKP8xto3hjj6Ngh9Jhz1oUz74d6VI/RnLcZDDnYj9VzYwdQbG
 C4wjZJpmChuiC1AjaeyuxE/FA5Dwfp43KEkILWykKrrs4tvxzK12645ttJSzBSjbIg52
 B8C9EVLAICeLEH4bpumOuDiE6BSjnG69n+yX1f4UlwmeOi+7SYaA/9AIwckkf24wNTrf
 H9Rg2PGXKWMNRsV8bIJpB1dBo5kxTAgb0QcrQqcXMtgEbaV0ZraruL4ssZeULLZ1Ntj3
 Qhwyu1QA67B/XzvP+ZBoYylVJJgZMVv8++pufp9X9N7V22QTSBY5lHIaHdYxi7Ng2qIA
 1Vbw==
X-Forwarded-Encrypted: i=1;
 AJvYcCVi6URa9OVCWSVrwf6WLYwa3QgbAtuBlRZWlcqBTVKRpW1zgaZQJIrQ364agxuu/3i29X9b1A==@debbugs.gnu.org
X-Gm-Message-State: AOJu0Yz5KqUhZChgmFSaz44eoK+5Fuw+AaGG0UYeT7/abwXwjbeJxUhQ
 U49YKtArwnxbycJcWHdNpetyp27PBEoiwFCR2vzIym8FzggB0oCf
X-Gm-Gg: ASbGnct8attUeNawo2/vTlFyxD2RmrT6351ea20nBcLwfb+l7I3TIKfcEK3jFtvFLCL
 dh74jrWpIeAUtCs/jIkGJogmxiCEjtfio16P+QuSD0bxvzyH+1ghVfPyIIiMDK0BDdaeR8kkCiY
 uufpOemU3AavnRFUj/1FB2pNQPzwApigeWXUncYYh+IN6TnPM6fwVVOQx92agKMy+mZZ2qOsKnk
 od24F4V3iZhotY42q7BDmVVJlI7KK3LcQvMeJWkjyH4L2HGqGe0Wg+KqbYbRca6wpz22J3jT4iM
 MCpR7buUG8nnsrj5/xgd0PFYpEIGrHyu0z9kCv6J91GHlA==
X-Google-Smtp-Source: AGHT+IELd00OOzu6wwzRRO335j7Q/vPJ+f0u5ueuMPm5YXv4IJ9kATWQxWJElkNkuiuEnzMW7r58/A==
X-Received: by 2002:a17:903:1c5:b0:225:adf8:8634 with SMTP id
 d9443c01a7336-2292fa0f1bdmr29734935ad.51.1743242842924; 
 Sat, 29 Mar 2025 03:07:22 -0700 (PDT)
Received: from ?IPv6:::1? ([2401:4900:120e:c4da:d85a:dbff:fe3a:41b6])
 by smtp.gmail.com with ESMTPSA id
 41be03b00d2f7-af93b67e754sm2979708a12.6.2025.03.29.03.07.21
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Sat, 29 Mar 2025 03:07:22 -0700 (PDT)
Date: Sat, 29 Mar 2025 15:37:13 +0530
From: Visuwesh <visuweshm@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#77224: [PATCH] New minor mode 'cursor-indicators-mode'
User-Agent: K-9 Mail for Android
In-Reply-To: <8634ew9sgp.fsf@HIDDEN>
References: <87iknzxski.fsf@HIDDEN> <87o6xq6fud.fsf@HIDDEN>
 <875xjymh93.fsf@HIDDEN> <87ikny2rio.fsf@HIDDEN>
 <86o6xpe2cx.fsf@HIDDEN> <87o6xobdcc.fsf@HIDDEN>
 <875xjwyzvt.fsf@HIDDEN> <8634f0dkhq.fsf@HIDDEN>
 <875xjvcn4o.fsf@HIDDEN> <877c4b81nk.fsf@HIDDEN>
 <86ecyidg2d.fsf@HIDDEN> <87h63ekdxe.fsf@HIDDEN>
 <86cye2d8t6.fsf@HIDDEN> <87a596a29y.fsf@HIDDEN>
 <86tt7ebfnc.fsf@HIDDEN> <877c4aa0m8.fsf@HIDDEN>
 <86pli2befe.fsf@HIDDEN> <878qoq5iui.fsf@HIDDEN>
 <86bjtlbqge.fsf@HIDDEN> <87wmc8k0o6.fsf@HIDDEN> <8634ew9sgp.fsf@HIDDEN>
Message-ID: <348B3268-0379-4265-BA5D-300A3E16010F@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain;
 charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 1.0 (+)
X-Debbugs-Envelope-To: 77224
Cc: mail@HIDDEN, eg642616@HIDDEN, juri@HIDDEN,
 77224 <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 (-)



On 29 March 2025 13:30:38 GMT+05:30, Eli Zaretskii <eliz@gnu=2Eorg> wrote:
>> From: Visuwesh <visuweshm@gmail=2Ecom>
>> Cc: Daniel Mendler <mail@daniel-mendler=2Ede>,  77224@debbugs=2Egnu=2Eo=
rg,
>>   eg642616@gmail=2Ecom,  juri@linkov=2Enet
>> Date: Sat, 29 Mar 2025 08:23:13 +0530
>>=20
>> Global value:
>>=20
>> (transient--post-command-hook repeat-post-hook)
>>=20
>> I have no idea why transient--post-command-hook is in there=2E  I don't
>> use transient at all=2E
>
>Maybe you used some feature that loads transient, like emoji-insert?

No, I never did=2E  I essentially never use any transient based command si=
nce it is far too complex for my simpleminded brain=2E




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

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


Received: (at 77224) by debbugs.gnu.org; 29 Mar 2025 09:18:49 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Mar 29 05:18:49 2025
Received: from localhost ([127.0.0.1]:56797 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tySL3-0004J2-3V
	for submit <at> debbugs.gnu.org; Sat, 29 Mar 2025 05:18:49 -0400
Received: from server.qxqx.de ([2a01:4f8:c012:9177::1]:57149 helo=mail.qxqx.de)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <mail@HIDDEN>)
 id 1tySKz-0004Ih-Oj
 for 77224 <at> debbugs.gnu.org; Sat, 29 Mar 2025 05:18:46 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
 d=daniel-mendler.de; s=key; h=Content-Type:MIME-Version:Message-ID:Date:
 References:In-Reply-To:Subject:Cc:To:From:Sender:Reply-To:
 Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date:
 Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:
 List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=Dm4OBKetEG1z6BF47WuEKpE8r/DQ8lDx1rYr7cXMf7M=; b=RD1wSA+CgwGHpxJv9yOcGxxgZN
 AWuAD0xReBq4d9tATEe1+0s6reD7Y7RZfv54/lznjLvrkADOMSORs/buMkqU0L27ZM1a6w5oG7tIB
 Y8mnv0Uua+1htNkVNejrOpwKuXoro7s7C+H0vDVony51cZzeeRygzk+T/jDJBLvlaQx4=;
From: Daniel Mendler <mail@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#77224: [PATCH] New minor mode 'cursor-indicators-mode'
In-Reply-To: <86wmc88bl3.fsf@HIDDEN> (Eli Zaretskii's message of "Sat, 29 Mar
 2025 11:50:32 +0300")
References: <87iknzxski.fsf@HIDDEN> <8634f0dkhq.fsf@HIDDEN>
 <875xjvcn4o.fsf@HIDDEN> <877c4b81nk.fsf@HIDDEN>
 <86ecyidg2d.fsf@HIDDEN> <87h63ekdxe.fsf@HIDDEN>
 <86cye2d8t6.fsf@HIDDEN> <87a596a29y.fsf@HIDDEN>
 <86tt7ebfnc.fsf@HIDDEN> <877c4aa0m8.fsf@HIDDEN>
 <86pli2befe.fsf@HIDDEN> <878qoq5iui.fsf@HIDDEN>
 <86bjtlbqge.fsf@HIDDEN> <87msd5rwnm.fsf@HIDDEN>
 <86frix9kv0.fsf@HIDDEN> <87frixaymv.fsf@HIDDEN>
 <86ecyg9v51.fsf@HIDDEN> <87friwxoie.fsf@HIDDEN>
 <861pug9rol.fsf@HIDDEN> <87bjtkz186.fsf@HIDDEN>
 <86wmc88bl3.fsf@HIDDEN>
Date: Sat, 29 Mar 2025 10:18:37 +0100
Message-ID: <87cye09ouq.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 77224
Cc: 77224 <at> debbugs.gnu.org, eg642616@HIDDEN, juri@HIDDEN
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.7 (-)

Eli Zaretskii <eliz@HIDDEN> writes:

>> From: Daniel Mendler <mail@HIDDEN>
>> Cc: eg642616@HIDDEN,  77224 <at> debbugs.gnu.org,  juri@HIDDEN
>> Date: Sat, 29 Mar 2025 09:32:09 +0100
>> 
>> Eli Zaretskii <eliz@HIDDEN> writes:
>> 
>> >> From: Daniel Mendler <mail@HIDDEN>
>> >> Cc: eg642616@HIDDEN,  77224 <at> debbugs.gnu.org,  juri@HIDDEN
>> >> Date: Sat, 29 Mar 2025 08:52:09 +0100
>> >> 
>> >> The `hl-line-highlight' moves the line highlight overlay, such that it
>> >> moves immediately with the cursor and does not lag behind.
>> >
>> > You may not be aware, but moving and changing overlays disables some
>> > redisplay optimizations, and in many cases can trigger an additional
>> > immediate redisplay cycle.  So doing that after every command exits
>> > in practice means every redisplay cycle is adversely affected.
>> 
>> I am aware. What do you suggest as an alternative? It would look odd if
>> the `hl-line-overlay' would not move directly with the cursor and would
>> lag behind.
>
> I could suggest one or two alternatives, but is it worth our time?  is
> someone actually considering any such changes?

Please do. I would like to understand your ideas.

> My point was and remains the same: adding more and more features to
> post-command-hook is something to be avoided.

Your argument from above does not matter in the case of `cursor-type'.
Since most commands do not trigger a modification of the `cursor-type',
the only cost that gets added to the `post-command-hooks' is the
inexpensive check of a few variables or conditions, which will not
affect redisplay.

I still do not understand why you are so strongly against a
`post-command-hook' in this case. I see that you are out of principle
against `post-command-hooks'. This makes sense given that these hooks
can be abused easily.

However in certain scenarios, after careful consideration, they might be
acceptable. As Juri mentioned, a `post-command-hook' allows us to
reliably change the `cursor-type' based on arbitrary conditions. In
contrast, if we use multiple hooks, which are registered in multiple
different subsystems, it is easy to miss relevant state changes.

Daniel




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

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


Received: (at 77224) by debbugs.gnu.org; 29 Mar 2025 08:51:26 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Mar 29 04:51:26 2025
Received: from localhost ([127.0.0.1]:56752 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tyRuX-0002Q1-NL
	for submit <at> debbugs.gnu.org; Sat, 29 Mar 2025 04:51:26 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:44588)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1tyRuU-0002Oh-Bw
 for 77224 <at> debbugs.gnu.org; Sat, 29 Mar 2025 04:51:24 -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 1tyRuM-0002cr-1B; Sat, 29 Mar 2025 04:51:14 -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=i3mkfwgPv3RB/5fVaqUZLKOIToltYjnF1DnZU6z1olk=; b=OpNbOa3h2vJk
 xsqv9FJlbU4UnYmHJPfbGumPiD4kPvfpF3/qyPMc7krAVo8mZ79AF3AkDep78pR2wKVz5NLuu0N/A
 XwFVHSRrBDGBXBPLkBneDMUzxB0QYZqb+ZGFvgso6JMsDbTDetuGLuq9ogXsboLsuUEoGMoIOHWoX
 /EB5kAvSsWtyyyBLc6AURxGwONolPolWuDjuNb4XtkvWKjVWgZRzpQFiY/dR3ELmyE2cCT8HJzKH3
 VcTSiulGJ0weczloIplyYW7lGvRbqoc1XZL+Xe1IdmD6L8gbllGGTfUWbKDX0xcTYfc0zUiNG5/s4
 m9rwoKhRq5euWT45iBrP9Q==;
Date: Sat, 29 Mar 2025 11:50:32 +0300
Message-Id: <86wmc88bl3.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Daniel Mendler <mail@HIDDEN>
In-Reply-To: <87bjtkz186.fsf@HIDDEN> (message from Daniel Mendler
 on Sat, 29 Mar 2025 09:32:09 +0100)
Subject: Re: bug#77224: [PATCH] New minor mode 'cursor-indicators-mode'
References: <87iknzxski.fsf@HIDDEN> <87o6xobdcc.fsf@HIDDEN>
 <875xjwyzvt.fsf@HIDDEN> <8634f0dkhq.fsf@HIDDEN>
 <875xjvcn4o.fsf@HIDDEN> <877c4b81nk.fsf@HIDDEN>
 <86ecyidg2d.fsf@HIDDEN> <87h63ekdxe.fsf@HIDDEN>
 <86cye2d8t6.fsf@HIDDEN> <87a596a29y.fsf@HIDDEN>
 <86tt7ebfnc.fsf@HIDDEN> <877c4aa0m8.fsf@HIDDEN>
 <86pli2befe.fsf@HIDDEN> <878qoq5iui.fsf@HIDDEN>
 <86bjtlbqge.fsf@HIDDEN> <87msd5rwnm.fsf@HIDDEN>
 <86frix9kv0.fsf@HIDDEN> <87frixaymv.fsf@HIDDEN>
 <86ecyg9v51.fsf@HIDDEN> <87friwxoie.fsf@HIDDEN>
 <861pug9rol.fsf@HIDDEN> <87bjtkz186.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 77224
Cc: 77224 <at> debbugs.gnu.org, eg642616@HIDDEN, juri@HIDDEN
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: Daniel Mendler <mail@HIDDEN>
> Cc: eg642616@HIDDEN,  77224 <at> debbugs.gnu.org,  juri@HIDDEN
> Date: Sat, 29 Mar 2025 09:32:09 +0100
> 
> Eli Zaretskii <eliz@HIDDEN> writes:
> 
> >> From: Daniel Mendler <mail@HIDDEN>
> >> Cc: eg642616@HIDDEN,  77224 <at> debbugs.gnu.org,  juri@HIDDEN
> >> Date: Sat, 29 Mar 2025 08:52:09 +0100
> >> 
> >> The `hl-line-highlight' moves the line highlight overlay, such that it
> >> moves immediately with the cursor and does not lag behind.
> >
> > You may not be aware, but moving and changing overlays disables some
> > redisplay optimizations, and in many cases can trigger an additional
> > immediate redisplay cycle.  So doing that after every command exits
> > in practice means every redisplay cycle is adversely affected.
> 
> I am aware. What do you suggest as an alternative? It would look odd if
> the `hl-line-overlay' would not move directly with the cursor and would
> lag behind.

I could suggest one or two alternatives, but is it worth our time?  is
someone actually considering any such changes?

My point was and remains the same: adding more and more features to
post-command-hook is something to be avoided.




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

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


Received: (at 77224) by debbugs.gnu.org; 29 Mar 2025 08:32:22 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Mar 29 04:32:22 2025
Received: from localhost ([127.0.0.1]:56699 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tyRc5-0001Kf-W9
	for submit <at> debbugs.gnu.org; Sat, 29 Mar 2025 04:32:22 -0400
Received: from server.qxqx.de ([2a01:4f8:c012:9177::1]:59979 helo=mail.qxqx.de)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <mail@HIDDEN>)
 id 1tyRc2-0001KN-SJ
 for 77224 <at> debbugs.gnu.org; Sat, 29 Mar 2025 04:32:19 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
 d=daniel-mendler.de; s=key; h=Content-Type:MIME-Version:Message-ID:Date:
 References:In-Reply-To:Subject:Cc:To:From:Sender:Reply-To:
 Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date:
 Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:
 List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=peqIGjzBAPFIEbTEdODnuE5BupgQz073mmrWKiXV61Q=; b=h5QtuwBsGkgIxUnoTWyBQ3c4RI
 1aYC6ac5PTOsAYTJBeekMJ8YckF3xydG5GPIokGcbAfyjfT2tFMOXZy/lMtfRPkOPyb8/bvMnL72H
 ExtGwWLwTY4MJ/+1PmTAZXoZ8ZzdtrZLlUjpul6QhKfz+rGIR67ApXJjFN4Uq6qPIN1U=;
From: Daniel Mendler <mail@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#77224: [PATCH] New minor mode 'cursor-indicators-mode'
In-Reply-To: <861pug9rol.fsf@HIDDEN> (Eli Zaretskii's message of "Sat, 29 Mar
 2025 11:17:30 +0300")
References: <87iknzxski.fsf@HIDDEN> <87o6xobdcc.fsf@HIDDEN>
 <875xjwyzvt.fsf@HIDDEN> <8634f0dkhq.fsf@HIDDEN>
 <875xjvcn4o.fsf@HIDDEN> <877c4b81nk.fsf@HIDDEN>
 <86ecyidg2d.fsf@HIDDEN> <87h63ekdxe.fsf@HIDDEN>
 <86cye2d8t6.fsf@HIDDEN> <87a596a29y.fsf@HIDDEN>
 <86tt7ebfnc.fsf@HIDDEN> <877c4aa0m8.fsf@HIDDEN>
 <86pli2befe.fsf@HIDDEN> <878qoq5iui.fsf@HIDDEN>
 <86bjtlbqge.fsf@HIDDEN> <87msd5rwnm.fsf@HIDDEN>
 <86frix9kv0.fsf@HIDDEN> <87frixaymv.fsf@HIDDEN>
 <86ecyg9v51.fsf@HIDDEN> <87friwxoie.fsf@HIDDEN>
 <861pug9rol.fsf@HIDDEN>
Date: Sat, 29 Mar 2025 09:32:09 +0100
Message-ID: <87bjtkz186.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 77224
Cc: 77224 <at> debbugs.gnu.org, eg642616@HIDDEN, juri@HIDDEN
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.7 (-)

Eli Zaretskii <eliz@HIDDEN> writes:

>> From: Daniel Mendler <mail@HIDDEN>
>> Cc: eg642616@HIDDEN,  77224 <at> debbugs.gnu.org,  juri@HIDDEN
>> Date: Sat, 29 Mar 2025 08:52:09 +0100
>> 
>> The `hl-line-highlight' moves the line highlight overlay, such that it
>> moves immediately with the cursor and does not lag behind.
>
> You may not be aware, but moving and changing overlays disables some
> redisplay optimizations, and in many cases can trigger an additional
> immediate redisplay cycle.  So doing that after every command exits
> in practice means every redisplay cycle is adversely affected.

I am aware. What do you suggest as an alternative? It would look odd if
the `hl-line-overlay' would not move directly with the cursor and would
lag behind.

Some specialized code could handle this overlay such that it is treated
more efficiently together with the cursor itself. But in practice not
much would be won given that the `hl-line-overlay' has never caused
noticeable problems. Maybe it has for others and likely in files with
very long lines? For files with long lines I still use `so-long-mode'.

Daniel




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

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


Received: (at 77224) by debbugs.gnu.org; 29 Mar 2025 08:17:43 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Mar 29 04:17:43 2025
Received: from localhost ([127.0.0.1]:56666 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tyRNv-0000Zh-AD
	for submit <at> debbugs.gnu.org; Sat, 29 Mar 2025 04:17:43 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:57956)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1tyRNs-0000ZP-22
 for 77224 <at> debbugs.gnu.org; Sat, 29 Mar 2025 04:17:40 -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 1tyRNk-0007Fb-Ua; Sat, 29 Mar 2025 04:17:32 -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=xilsB6UBOgw5uwMnmBAsldjeHXn/Radb1Vqvo3lZmB4=; b=r0Kx9kEeP8/g
 lrBY2CIk29MXJm6j21moAhzgIvVV9/A82D0yY/T2H5tU4AZmbYbWaj4I5AHlVp6IkewcTUt0UjDjr
 jQVPHo7Nbm9JEdepie2DmORbSkiEdQm0YF+5VTmLGIf0khH5feyIEqw5x7LNM1AFrLoEgZG/ZjBpI
 XPnn+GJouXQ1r++lTzaW7zwhwzM8cpRr6yHutWdWWztEgr1H1ERrGy9BwjVGdVYj9JdfPtucRS4/+
 pQYYiAPqjKXTB++H6Stqo1kcvN/JBRP+vZbSBN5MHLB7W/F9o92syKc08oZ31GU6AxenewTL/dpTn
 pxnNTcZI7AZu/iS73YCw/Q==;
Date: Sat, 29 Mar 2025 11:17:30 +0300
Message-Id: <861pug9rol.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Daniel Mendler <mail@HIDDEN>
In-Reply-To: <87friwxoie.fsf@HIDDEN> (message from Daniel Mendler
 on Sat, 29 Mar 2025 08:52:09 +0100)
Subject: Re: bug#77224: [PATCH] New minor mode 'cursor-indicators-mode'
References: <87iknzxski.fsf@HIDDEN> <87ikny2rio.fsf@HIDDEN>
 <86o6xpe2cx.fsf@HIDDEN> <87o6xobdcc.fsf@HIDDEN>
 <875xjwyzvt.fsf@HIDDEN> <8634f0dkhq.fsf@HIDDEN>
 <875xjvcn4o.fsf@HIDDEN> <877c4b81nk.fsf@HIDDEN>
 <86ecyidg2d.fsf@HIDDEN> <87h63ekdxe.fsf@HIDDEN>
 <86cye2d8t6.fsf@HIDDEN> <87a596a29y.fsf@HIDDEN>
 <86tt7ebfnc.fsf@HIDDEN> <877c4aa0m8.fsf@HIDDEN>
 <86pli2befe.fsf@HIDDEN> <878qoq5iui.fsf@HIDDEN>
 <86bjtlbqge.fsf@HIDDEN> <87msd5rwnm.fsf@HIDDEN>
 <86frix9kv0.fsf@HIDDEN> <87frixaymv.fsf@HIDDEN>
 <86ecyg9v51.fsf@HIDDEN> <87friwxoie.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 77224
Cc: 77224 <at> debbugs.gnu.org, eg642616@HIDDEN, juri@HIDDEN
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: Daniel Mendler <mail@HIDDEN>
> Cc: eg642616@HIDDEN,  77224 <at> debbugs.gnu.org,  juri@HIDDEN
> Date: Sat, 29 Mar 2025 08:52:09 +0100
> 
> The `hl-line-highlight' moves the line highlight overlay, such that it
> moves immediately with the cursor and does not lag behind.

You may not be aware, but moving and changing overlays disables some
redisplay optimizations, and in many cases can trigger an additional
immediate redisplay cycle.  So doing that after every command exits
in practice means every redisplay cycle is adversely affected.

> The only seemingly problematic hook is `whitespace-post-command'. I
> haven't checked it in detail. It looks complex but it mostly seems to
> modify some overlays and trigger fontification. Potentially some of the
> work there could be deferred.




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

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


Received: (at 77224) by debbugs.gnu.org; 29 Mar 2025 08:00:55 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Mar 29 04:00:55 2025
Received: from localhost ([127.0.0.1]:56629 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tyR7e-0008DH-Os
	for submit <at> debbugs.gnu.org; Sat, 29 Mar 2025 04:00:55 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:53456)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1tyR7c-0008D1-4p
 for 77224 <at> debbugs.gnu.org; Sat, 29 Mar 2025 04:00:53 -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 1tyR7T-0005G7-74; Sat, 29 Mar 2025 04:00:45 -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=1y4cWuyV0JU6Q8QGNOKCgJtBeHjFJxnmLHMSaFASYlA=; b=Mn86QPCWh8qS
 xJ2blavh7z12+PSV8wkjJ1Jzw9E6LTi3wEWbzcxlBH/B2VVZ0YFFx7MQB8cCvmGdWu0y2HA71b4Hh
 oi+Fbx0IltPpiADzyCetnNLbUrNa5LknZRwKTaD8B5Qf8jBc2+6sAkG9dM0IJKnAG0I1l4g+kniTS
 rI/twDQwQ3ZyigIerHBem+4aB8PcOFwseC1EZkUrJhYN2a3ZClROvEz1VBRoBlyJKsk5+/9s6LbGM
 eQVsLcP0qTcnLuOP5xv9eBq83GCzSlh2KrsZ8ID/AFHoyFAsmIsxyonAdbLhIsPbfXTxsPWdWlmXP
 verzAO2BquPsB7h8D97Fkg==;
Date: Sat, 29 Mar 2025 11:00:38 +0300
Message-Id: <8634ew9sgp.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Visuwesh <visuweshm@HIDDEN>
In-Reply-To: <87wmc8k0o6.fsf@HIDDEN> (message from Visuwesh on Sat, 29 Mar
 2025 08:23:13 +0530)
Subject: Re: bug#77224: [PATCH] New minor mode 'cursor-indicators-mode'
References: <87iknzxski.fsf@HIDDEN> <87o6xq6fud.fsf@HIDDEN>
 <875xjymh93.fsf@HIDDEN> <87ikny2rio.fsf@HIDDEN>
 <86o6xpe2cx.fsf@HIDDEN> <87o6xobdcc.fsf@HIDDEN>
 <875xjwyzvt.fsf@HIDDEN> <8634f0dkhq.fsf@HIDDEN>
 <875xjvcn4o.fsf@HIDDEN> <877c4b81nk.fsf@HIDDEN>
 <86ecyidg2d.fsf@HIDDEN> <87h63ekdxe.fsf@HIDDEN>
 <86cye2d8t6.fsf@HIDDEN> <87a596a29y.fsf@HIDDEN>
 <86tt7ebfnc.fsf@HIDDEN> <877c4aa0m8.fsf@HIDDEN>
 <86pli2befe.fsf@HIDDEN> <878qoq5iui.fsf@HIDDEN>
 <86bjtlbqge.fsf@HIDDEN> <87wmc8k0o6.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 77224
Cc: mail@HIDDEN, eg642616@HIDDEN, juri@HIDDEN,
 77224 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Visuwesh <visuweshm@HIDDEN>
> Cc: Daniel Mendler <mail@HIDDEN>,  77224 <at> debbugs.gnu.org,
>   eg642616@HIDDEN,  juri@HIDDEN
> Date: Sat, 29 Mar 2025 08:23:13 +0530
> 
> Global value:
> 
> (transient--post-command-hook repeat-post-hook)
> 
> I have no idea why transient--post-command-hook is in there.  I don't
> use transient at all.

Maybe you used some feature that loads transient, like emoji-insert?




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

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


Received: (at 77224) by debbugs.gnu.org; 29 Mar 2025 07:52:34 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Mar 29 03:52:34 2025
Received: from localhost ([127.0.0.1]:56613 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tyQza-0007li-4g
	for submit <at> debbugs.gnu.org; Sat, 29 Mar 2025 03:52:34 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:35362)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1tyQzP-0007l7-K8
 for 77224 <at> debbugs.gnu.org; Sat, 29 Mar 2025 03:52:24 -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 1tyQzI-0004P3-7V; Sat, 29 Mar 2025 03:52:16 -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=XMOW9yHaApX3S5FlZ2lyXSj5UL/d+zRK8Ww8KVdQvZs=; b=e4XWu9dfhvHv
 iDypZz9HOIRt3p6xyRAXHrP/3AbGgI7yc9EGa3i+hrRxxdKkIZa7FpKChhL3d0kioCl3jeLDwWqEF
 8H6AAYcyYtDP1NZCuA/YKOfHvKsjUHXxlzc/05/6fAp9wnFg4CRcxUfyotCJ7/4ojGfrII90peDir
 cl5a16LC/4H3TeFu+UYSsQCTf53kz0SJxXX0tpS45De6ncSjIMOSQIq9EPqfRZb4j1SIuaiUBBntJ
 JulHTM/V6NV8raTwDwYvDoIU1cD5r/p54ktNGBOnrcBqUQTxvQiIoug6QXvowlziJSY9X7K3bxiA7
 614XVDDxRd8f4tuHIh2Jrw==;
Date: Sat, 29 Mar 2025 10:52:12 +0300
Message-Id: <865xjs9sur.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Daniel Colascione <dancol@HIDDEN>
In-Reply-To: <B9B7761F-BEB5-423E-A44E-D63E466924F9@HIDDEN> (message from
 Daniel Colascione on Fri, 28 Mar 2025 21:03:10 -0400)
Subject: Re: bug#77224: [PATCH] New minor mode 'cursor-indicators-mode'
References: <87iknzxski.fsf@HIDDEN> <87o6xq6fud.fsf@HIDDEN>
 <875xjymh93.fsf@HIDDEN> <87ikny2rio.fsf@HIDDEN>
 <86o6xpe2cx.fsf@HIDDEN> <87o6xobdcc.fsf@HIDDEN>
 <875xjwyzvt.fsf@HIDDEN> <8634f0dkhq.fsf@HIDDEN>
 <875xjvcn4o.fsf@HIDDEN> <877c4b81nk.fsf@HIDDEN>
 <86ecyidg2d.fsf@HIDDEN> <87h63ekdxe.fsf@HIDDEN>
 <86cye2d8t6.fsf@HIDDEN> <87a596a29y.fsf@HIDDEN>
 <86tt7ebfnc.fsf@HIDDEN> <44319BF5-31B5-4ECD-95AB-591A216D0072@HIDDEN>
 <868qopbp40.fsf@HIDDEN> <m1o6xlfcvu.fsf@HIDDEN>
 <877c48654r.fsf@HIDDEN> <B9B7761F-BEB5-423E-A44E-D63E466924F9@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 77224
Cc: mail@HIDDEN, eg642616@HIDDEN, 77224 <at> debbugs.gnu.org,
 juri@HIDDEN
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 (---)

> Date: Fri, 28 Mar 2025 21:03:10 -0400
> From: Daniel Colascione <dancol@HIDDEN>
> CC: Eli Zaretskii <eliz@HIDDEN>, mail@HIDDEN, juri@HIDDEN,
>  77224 <at> debbugs.gnu.org
> 
> >Can your proposal also handle whether user moves cursor?
> >
> >Another reason why post-command-hook is used is mostly for run code
> >when user moves cursor position.
> 
> I don't see why not? You could put (point) on your change list or something. I'm imagining that we just recognize forms in this list specially and add the appropriate low level hooks internally.
> 
> >post-command-hook would run code even if user/cursor is idle and even
> >for every /(unrelated)/ function in background, which can lead to high
> >resource consumption.
> 
> Yeah. Tragedy of the commons. Too many sheep grazing on the communal Emacs event loop.

Yes, for this kind of feature to work in Emacs, there should be some
mechanism that would scan all the important changes (whose name is a
legion), and signal the relevant changes to potential clients.  That
sounds like one giant end probably quite expensive post-command-hook,
doesn't it?




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

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


Received: (at 77224) by debbugs.gnu.org; 29 Mar 2025 07:52:21 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Mar 29 03:52:21 2025
Received: from localhost ([127.0.0.1]:56609 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tyQzM-0007lA-HX
	for submit <at> debbugs.gnu.org; Sat, 29 Mar 2025 03:52:21 -0400
Received: from server.qxqx.de ([2a01:4f8:c012:9177::1]:34567 helo=mail.qxqx.de)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <mail@HIDDEN>)
 id 1tyQzI-0007kr-3p
 for 77224 <at> debbugs.gnu.org; Sat, 29 Mar 2025 03:52:17 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
 d=daniel-mendler.de; s=key; h=Content-Type:MIME-Version:Message-ID:Date:
 References:In-Reply-To:Subject:Cc:To:From:Sender:Reply-To:
 Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date:
 Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:
 List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=eRsl79X+ot/gZ+E2idrTtwff1NsMi6Bi6TIzenV7W7A=; b=RdQTEWNCs7NSaRYb0PoNpfNKr1
 cSTMfY4k8JJDRx+aTH9qLRMKHlprnzikgje3w9oOyp+urj4S2cOA2GqAdddeF9Lr6pKr1CxUSxd9R
 oOnBV3rdvYHaZpGivC8ZXnGklETf7vEGGFETIdLxLRjRlN0mi+Wc0nh3OC6HTka0hhks=;
From: Daniel Mendler <mail@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#77224: [PATCH] New minor mode 'cursor-indicators-mode'
In-Reply-To: <86ecyg9v51.fsf@HIDDEN> (Eli Zaretskii's message of "Sat, 29 Mar
 2025 10:02:50 +0300")
References: <87iknzxski.fsf@HIDDEN> <87ikny2rio.fsf@HIDDEN>
 <86o6xpe2cx.fsf@HIDDEN> <87o6xobdcc.fsf@HIDDEN>
 <875xjwyzvt.fsf@HIDDEN> <8634f0dkhq.fsf@HIDDEN>
 <875xjvcn4o.fsf@HIDDEN> <877c4b81nk.fsf@HIDDEN>
 <86ecyidg2d.fsf@HIDDEN> <87h63ekdxe.fsf@HIDDEN>
 <86cye2d8t6.fsf@HIDDEN> <87a596a29y.fsf@HIDDEN>
 <86tt7ebfnc.fsf@HIDDEN> <877c4aa0m8.fsf@HIDDEN>
 <86pli2befe.fsf@HIDDEN> <878qoq5iui.fsf@HIDDEN>
 <86bjtlbqge.fsf@HIDDEN> <87msd5rwnm.fsf@HIDDEN>
 <86frix9kv0.fsf@HIDDEN> <87frixaymv.fsf@HIDDEN>
 <86ecyg9v51.fsf@HIDDEN>
Date: Sat, 29 Mar 2025 08:52:09 +0100
Message-ID: <87friwxoie.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 77224
Cc: 77224 <at> debbugs.gnu.org, eg642616@HIDDEN, juri@HIDDEN
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.7 (-)

Eli Zaretskii <eliz@HIDDEN> writes:

>> From: Daniel Mendler <mail@HIDDEN>
>> Cc: eg642616@HIDDEN,  77224 <at> debbugs.gnu.org,  juri@HIDDEN
>> Date: Fri, 28 Mar 2025 17:49:44 +0100
>> 
>> Eli Zaretskii <eliz@HIDDEN> writes:
>> 
>> >> From: Daniel Mendler <mail@HIDDEN>
>> >> Cc: eg642616@HIDDEN,  77224 <at> debbugs.gnu.org,  juri@HIDDEN
>> >> Date: Fri, 28 Mar 2025 16:40:29 +0100
>> >> 
>> >> Eli Zaretskii <eliz@HIDDEN> writes:
>> >> 
>> >> My `post-command-hook' list looks like this:
>> >> 
>> >> Buffer-local:
>> >> (jit-lock--antiblink-post-command eldoc-schedule-timer
>> >>  corfu--auto-post-command jinx--reschedule
>> >>  whitespace-post-command-hook hl-line-highlight t)
>> >
>> > And in Org buffers?
>> 
>> The first list was from the *scratch* buffer. This one is from an Org
>> buffer:
>> 
>> (eldoc-schedule-timer corfu--auto-post-command jinx--reschedule
>>  whitespace-post-command-hook hl-line-highlight t)
>
> That's already problematic, IMO.  And then some people might enable
> flyspell-mode on top of all that.

In my experience, there is no problem, neither in Org nor in Elisp
buffers. I wrote in my other mail:

>> I don't have any problems with these hooks, since they are either
>> cheap or only schedule some timers for more expensive operations. At
>> least I don't notice any sluggishness and the PCHs don't appear in
>> profiles.

Enabling Flyspell on top is not a realistic scenario since
`jinx--reschedule' comes from the Jinx spell checker, which is an
alternative to Flyspell. The spell checking takes place later when Emacs
is idle. The functions `jinx--reschedule', `eldoc-schedule-timer' and
`corfu--auto-post-command' only schedule timers.

The `hl-line-highlight' moves the line highlight overlay, such that it
moves immediately with the cursor and does not lag behind. This is a
similar scenario to changing the `cursor-type', where the cursor type
should immediately reflect the editing state. Yes, we will check the
cursor conditions too often, and often unnecessarily, but this does not
cause slowdown as long as the check is sufficiently fast in comparison
to the executed command.

The only seemingly problematic hook is `whitespace-post-command'. I
haven't checked it in detail. It looks complex but it mostly seems to
modify some overlays and trigger fontification. Potentially some of the
work there could be deferred.

Daniel




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

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


Received: (at 77224) by debbugs.gnu.org; 29 Mar 2025 07:03:05 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Mar 29 03:03:05 2025
Received: from localhost ([127.0.0.1]:56500 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tyQDh-0005JK-02
	for submit <at> debbugs.gnu.org; Sat, 29 Mar 2025 03:03:05 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:44064)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1tyQDd-0005Ih-AW
 for 77224 <at> debbugs.gnu.org; Sat, 29 Mar 2025 03:03: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 1tyQDW-0006QX-4A; Sat, 29 Mar 2025 03:02:54 -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=zr4yMEVjVV8O/KWGNbF26f55qPyoL9cS56PevA2+Ty4=; b=Dm6pqc7IWZwk
 JrbCAu37fll6SsrDwj0FLyEoXOUtASZ+H8u2I0pGOXZcBGOh19BNAjSR9l6ybzx6+PWGS5Go2tzqN
 5bmJiXTSCu6ZlXD4Tyql6FS/tdlhrPDuqqedPDrXIDd7fjpOuS5VmdL/dgmvyJdxtdqw2u3C+lNfc
 cdquM8IX2Ys2nj9PUDFUSrSZKBLu+UlGqZ1iLGWLO+FGWd7Pwi7JXksSBcAU9SoLnboqMqdMJ2dG/
 dxOS2JdG5gxFKR55uAOvpbyYgzhvK6ugMVaRkKQNBEVvIFtGr+FOJSvlSRSl6KM7L+vIuKeBl/43i
 4/MMIICBM7JHWwoQDouljA==;
Date: Sat, 29 Mar 2025 10:02:50 +0300
Message-Id: <86ecyg9v51.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Daniel Mendler <mail@HIDDEN>
In-Reply-To: <87frixaymv.fsf@HIDDEN> (message from Daniel Mendler
 on Fri, 28 Mar 2025 17:49:44 +0100)
Subject: Re: bug#77224: [PATCH] New minor mode 'cursor-indicators-mode'
References: <87iknzxski.fsf@HIDDEN> <87o6xq6fud.fsf@HIDDEN>
 <875xjymh93.fsf@HIDDEN> <87ikny2rio.fsf@HIDDEN>
 <86o6xpe2cx.fsf@HIDDEN> <87o6xobdcc.fsf@HIDDEN>
 <875xjwyzvt.fsf@HIDDEN> <8634f0dkhq.fsf@HIDDEN>
 <875xjvcn4o.fsf@HIDDEN> <877c4b81nk.fsf@HIDDEN>
 <86ecyidg2d.fsf@HIDDEN> <87h63ekdxe.fsf@HIDDEN>
 <86cye2d8t6.fsf@HIDDEN> <87a596a29y.fsf@HIDDEN>
 <86tt7ebfnc.fsf@HIDDEN> <877c4aa0m8.fsf@HIDDEN>
 <86pli2befe.fsf@HIDDEN> <878qoq5iui.fsf@HIDDEN>
 <86bjtlbqge.fsf@HIDDEN> <87msd5rwnm.fsf@HIDDEN>
 <86frix9kv0.fsf@HIDDEN> <87frixaymv.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 77224
Cc: 77224 <at> debbugs.gnu.org, eg642616@HIDDEN, juri@HIDDEN
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: Daniel Mendler <mail@HIDDEN>
> Cc: eg642616@HIDDEN,  77224 <at> debbugs.gnu.org,  juri@HIDDEN
> Date: Fri, 28 Mar 2025 17:49:44 +0100
> 
> Eli Zaretskii <eliz@HIDDEN> writes:
> 
> >> From: Daniel Mendler <mail@HIDDEN>
> >> Cc: eg642616@HIDDEN,  77224 <at> debbugs.gnu.org,  juri@HIDDEN
> >> Date: Fri, 28 Mar 2025 16:40:29 +0100
> >> 
> >> Eli Zaretskii <eliz@HIDDEN> writes:
> >> 
> >> My `post-command-hook' list looks like this:
> >> 
> >> Buffer-local:
> >> (jit-lock--antiblink-post-command eldoc-schedule-timer
> >>  corfu--auto-post-command jinx--reschedule
> >>  whitespace-post-command-hook hl-line-highlight t)
> >
> > And in Org buffers?
> 
> The first list was from the *scratch* buffer. This one is from an Org
> buffer:
> 
> (eldoc-schedule-timer corfu--auto-post-command jinx--reschedule
>  whitespace-post-command-hook hl-line-highlight t)

That's already problematic, IMO.  And then some people might enable
flyspell-mode on top of all that.




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

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


Received: (at 77224) by debbugs.gnu.org; 29 Mar 2025 02:53:27 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Mar 28 22:53:27 2025
Received: from localhost ([127.0.0.1]:56172 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tyMK7-0001tH-4Q
	for submit <at> debbugs.gnu.org; Fri, 28 Mar 2025 22:53:27 -0400
Received: from mail-pl1-x644.google.com ([2607:f8b0:4864:20::644]:44272)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <visuweshm@HIDDEN>)
 id 1tyMK4-0001t3-0Z
 for 77224 <at> debbugs.gnu.org; Fri, 28 Mar 2025 22:53:24 -0400
Received: by mail-pl1-x644.google.com with SMTP id
 d9443c01a7336-2255003f4c6so56409445ad.0
 for <77224 <at> debbugs.gnu.org>; Fri, 28 Mar 2025 19:53:23 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1743216798; x=1743821598; darn=debbugs.gnu.org;
 h=content-transfer-encoding:mime-version:user-agent:message-id:date
 :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date
 :message-id:reply-to;
 bh=zbwPHPqqPRPuNHvob2RGYI5DEBxSZuuCwtGdF2nz3n0=;
 b=CDKMolHHzRjGT8pmickaf64c/eP3spumi1pKYZrynqNERNzeb9NBRNoEiZDPY8vztj
 BiFRb8nr8MaksHe5+F2s/BBx7kXV1IqUzjHTAHZfN0vrz1iYWjMMXdepbNM2H54mZ/pc
 L1Kf04K4BnWfxMqB1YTBiFMHsNuZQCx0unfudiCWciLb4m4pVd1I707NimQXQh2Ba9Ap
 f4E6MIkz6+EscCUMuLPVTwjQZhw4YTMiKRikpVkHA93Z+93ViSD7UA9HOahqgb+bDTgS
 CHJUOF3xZP04InUaMxpfi9KZL0eyFnv/2WMo7Nj7ng0tZTmPoKvr0aeWsf4D1jGH1jaP
 Vrag==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1743216798; x=1743821598;
 h=content-transfer-encoding:mime-version:user-agent:message-id:date
 :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from
 :to:cc:subject:date:message-id:reply-to;
 bh=zbwPHPqqPRPuNHvob2RGYI5DEBxSZuuCwtGdF2nz3n0=;
 b=NorsdWTlbDhmgcyItLPhKUjt4wzr43iiPxJKKXLDDdn+IZZblSt1bZdT+wyrNpb/Gh
 IdOyKnMp8R5yF/2UQw479hmsonoAFm5yUfT8y77yVRcDUYvSM2h3jj3Bx8uM8YBSWcNL
 T0WGio5ncmxi9e3+EhFL4KTSbt6B5PhN7oJ8y6ocj2YPbQbbUbgadUWhVfxnPKTP3Zrw
 OtaM10z6pGQuloSiLfJlUhzYPN+dLxcYa405HWns6laU3QJXHiZXgxDIu/ccJp8XIsPT
 d/TrLYzltktsXQzRcARzKadp0C4dsceoHGV7UHWccgd/Q6kuaotwUyjbA7i14gCCelBl
 /8CQ==
X-Forwarded-Encrypted: i=1;
 AJvYcCV2OmgngvE+iXWwLRleLdYdGWA2jPHqvBFB9BveqYOKDpGn8RhQJ/3DzZPA63zlV3zf1oB3xw==@debbugs.gnu.org
X-Gm-Message-State: AOJu0YzjM+djwum/Fjlox+oSL8BZfGrZ7h3Ul6L9fKewRze7LdLcqLZK
 JiYtKfxxwFwGHHMs9JlQfRySIybCZ+AkRovdn9cH25EVSdLyxrXW
X-Gm-Gg: ASbGnctq+4Tl0ISu2fYx3MXTLY7jkhWTvam0S+CDjS9ryepH9G2Jf/N+NgIP8CSjGB/
 kcmIGl25QahdUOVioB7gPv5DRdz42N6uQci7+3PdErJFNfC4ciEDWO38h/s+qiOs4cFrxqYkb+U
 nPrwX41QRCuSPlseQVWJyNlwCy9O4aAvpjLSdY6RgOxGOxuE+H5+FtKWbnNHXxqZvfIXO96oQh8
 heXNAhLSU0ID7iRr0fkcug0xsXtvgLVI8G3n1qX8VFm/HGAVH7dT3HkLyQVRyWIB0QkGJhQtPY8
 Sw/JLWaRJRGpgL3/99etrLSHnkSiZ3uUHE76HRuBAQ==
X-Google-Smtp-Source: AGHT+IHejS915gma/9VloUaWHaNs7QMOUEhURQnwHZGM5HnaT2uPDnXgMgMLzMjn5auslN+m7GRMfg==
X-Received: by 2002:a17:902:e550:b0:224:b60:3cd3 with SMTP id
 d9443c01a7336-2292f95f452mr24738415ad.19.1743216797773; 
 Fri, 28 Mar 2025 19:53:17 -0700 (PDT)
Received: from localhost ([115.240.90.130])
 by smtp.gmail.com with UTF8SMTPSA id
 d9443c01a7336-2291eee234esm26211025ad.96.2025.03.28.19.53.16
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 28 Mar 2025 19:53:17 -0700 (PDT)
From: Visuwesh <visuweshm@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#77224: [PATCH] New minor mode 'cursor-indicators-mode'
In-Reply-To: <86bjtlbqge.fsf@HIDDEN>
References: <87iknzxski.fsf@HIDDEN> <87o6xq6fud.fsf@HIDDEN>
 <875xjymh93.fsf@HIDDEN> <87ikny2rio.fsf@HIDDEN>
 <86o6xpe2cx.fsf@HIDDEN> <87o6xobdcc.fsf@HIDDEN>
 <875xjwyzvt.fsf@HIDDEN> <8634f0dkhq.fsf@HIDDEN>
 <875xjvcn4o.fsf@HIDDEN> <877c4b81nk.fsf@HIDDEN>
 <86ecyidg2d.fsf@HIDDEN> <87h63ekdxe.fsf@HIDDEN>
 <86cye2d8t6.fsf@HIDDEN> <87a596a29y.fsf@HIDDEN>
 <86tt7ebfnc.fsf@HIDDEN> <877c4aa0m8.fsf@HIDDEN>
 <86pli2befe.fsf@HIDDEN> <878qoq5iui.fsf@HIDDEN>
 <86bjtlbqge.fsf@HIDDEN>
Date: Sat, 29 Mar 2025 08:23:13 +0530
Message-ID: <87wmc8k0o6.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 77224
Cc: Daniel Mendler <mail@HIDDEN>, eg642616@HIDDEN,
 juri@HIDDEN, 77224 <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 (-)

[=E0=AE=B5=E0=AF=86=E0=AE=B3=E0=AF=8D=E0=AE=B3=E0=AE=BF =E0=AE=AE=E0=AE=BE=
=E0=AE=B0=E0=AF=8D=E0=AE=9A=E0=AF=8D 28, 2025] Eli Zaretskii wrote:

> How long is the post-command-hook list in your production sessions?
> Should we poll users to give their data?  Just yesterday someone
> complained on Reddit that Emacs is too slow, and I have no doubt that
> features that use post-command-hook are at least part of the reason if
> not _the_ reason.

CAVEAT: I am aware of the ill effects of having too many things in
post-command-hook and generally avoid it unless strictly necessary.

In the message-mode buffer I'm writing this from:

(t flyspell-post-command-hook)

In Org mode:

(prettify-symbols--post-command-hook t)

In f90-mode:

(jit-lock--antiblink-post-command eldoc-schedule-timer t)

In elisp-mode:

(jit-lock--antiblink-post-command eldoc-schedule-timer
reveal-post-command t)

Global value:

(transient--post-command-hook repeat-post-hook)

I have no idea why transient--post-command-hook is in there.  I don't
use transient at all.




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

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


Received: (at 77224) by debbugs.gnu.org; 29 Mar 2025 01:03:29 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Mar 28 21:03:28 2025
Received: from localhost ([127.0.0.1]:56026 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tyKbg-0005Kk-K8
	for submit <at> debbugs.gnu.org; Fri, 28 Mar 2025 21:03:28 -0400
Received: from dancol.org ([2600:3c01:e000:3d8::1]:50492)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <dancol@HIDDEN>) id 1tyKbd-0005KZ-HL
 for 77224 <at> debbugs.gnu.org; Fri, 28 Mar 2025 21:03:26 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=dancol.org; 
 s=x;
 h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID:
 References:In-Reply-To:Subject:CC:To:From:Date:Sender:Reply-To:Content-ID:
 Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc
 :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe:
 List-Post:List-Owner:List-Archive;
 bh=zGxBu3QI0cC0QyvyLo4uXdDXuf32YJTKW51qXk0jkfM=; b=p7nZY/5gD+WUKUN0fqBxsD05IL
 jjtC0QgRq6ef6xd0obmj1ruKjA1V12v4/Bevy/dmnT5Y1AHrthof1FRKV2LWdkf2jI6aFkR1oQW/w
 NIR8qaFfYFn9npW7u4KQYLT8PdY4NlKp5X8LVyrKZPCMCuk8irmrYG2te7eVb5lAwmbgQ+6hlFpMR
 GCV+RHLsHKmkxxhyFKQuUj9cKLZueJE4Xe3GWcKcVpYEchj1enGl4ri2kLowWIFhwToAh+w1PdJtu
 yMo81n2RxDSQcH3CuNWSvSbRqEIHfKDF1n2//qBgZEuOa+zNGmWAGFyd/aeqVK8V6Dt+02OBIqxLC
 +6zcexMg==;
Received: from 2603-9001-4203-1ab2-a595-5aa3-b7d5-1847.inf6.spectrum.com
 ([2603:9001:4203:1ab2:a595:5aa3:b7d5:1847]:35344 helo=[IPv6:::1])
 by dancol.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
 (Exim 4.96) (envelope-from <dancol@HIDDEN>) id 1tyKb4-004Mlv-2r;
 Fri, 28 Mar 2025 21:02:51 -0400
Date: Fri, 28 Mar 2025 21:03:10 -0400
From: Daniel Colascione <dancol@HIDDEN>
To: =?ISO-8859-1?Q?Elijah_Gabe_P=E9rez?= <eg642616@HIDDEN>
Subject: Re: bug#77224: [PATCH] New minor mode 'cursor-indicators-mode'
User-Agent: K-9 Mail for Android
In-Reply-To: <877c48654r.fsf@HIDDEN>
References: <87iknzxski.fsf@HIDDEN> <87o6xq6fud.fsf@HIDDEN>
 <875xjymh93.fsf@HIDDEN> <87ikny2rio.fsf@HIDDEN>
 <86o6xpe2cx.fsf@HIDDEN> <87o6xobdcc.fsf@HIDDEN>
 <875xjwyzvt.fsf@HIDDEN> <8634f0dkhq.fsf@HIDDEN>
 <875xjvcn4o.fsf@HIDDEN> <877c4b81nk.fsf@HIDDEN>
 <86ecyidg2d.fsf@HIDDEN> <87h63ekdxe.fsf@HIDDEN>
 <86cye2d8t6.fsf@HIDDEN> <87a596a29y.fsf@HIDDEN>
 <86tt7ebfnc.fsf@HIDDEN> <44319BF5-31B5-4ECD-95AB-591A216D0072@HIDDEN>
 <868qopbp40.fsf@HIDDEN> <m1o6xlfcvu.fsf@HIDDEN>
 <877c48654r.fsf@HIDDEN>
Message-ID: <B9B7761F-BEB5-423E-A44E-D63E466924F9@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain;
 charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 77224
Cc: mail@HIDDEN, Eli Zaretskii <eliz@HIDDEN>, 77224 <at> debbugs.gnu.org,
 juri@HIDDEN
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 (-)



On March 28, 2025 8:40:36 PM EDT, "Elijah Gabe P=C3=A9rez" <eg642616@gmail=
=2Ecom> wrote:
>Daniel Colascione <dancol@dancol=2Eorg> writes:
>
>> The feature I'm proposing is higher-level than that=2E  For example, fo=
r
>> my personal use, I have something that sits in pre-redisplay-function
>> and scans all the windows for applying highlights based on current
>> buffer and window selection=2E  I should have written this thing using =
the
>> appropriate window configuration change hooks, but didn't, because I'm
>> lazy and my approach is fast enough for me=2E
>
>>     ;; Don't do this=2E
>
>>     (defun window-highlight--pre-redisplay (_window)
>>       (window-highlight--rescan-windows))
>
>>     (add-function :after pre-redisplay-function
>>        #'window-highlight--pre-redisplay))
>
>> What I'd have wanted instead is something like this:
>
>>   (run-when-changed
>>       (list (selected-window) (selected-frame) (frame-focus-state))
>>     #'window-highlight--rescan-windows)
>
>> Here, we'd run window-highlight--rescan-windows only when one of its
>> dependent conditions (e=2Eg=2E selected frame) changed=2E  After any nu=
mber of
>> window and frame changes, we'd run window-highlight--rescan-windows
>> *once*, immediately before its effects would become user-visible
>> (e=2Eg=2E just before redisplay, or after commands), and we wouldn't re=
-run
>> it until one of its preconditions changed=2E
>
>Can your proposal also handle whether user moves cursor?
>
>Another reason why post-command-hook is used is mostly for run code
>when user moves cursor position=2E

I don't see why not? You could put (point) on your change list or somethin=
g=2E I'm imagining that we just recognize forms in this list specially and =
add the appropriate low level hooks internally=2E

>post-command-hook would run code even if user/cursor is idle and even
>for every /(unrelated)/ function in background, which can lead to high
>resource consumption=2E

Yeah=2E Tragedy of the commons=2E Too many sheep grazing on the communal E=
macs event loop=2E


>
>I think having alternatives like this for specific commands (or actions)
>could help reduce the use of post-command-hook=2E
>






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

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


Received: (at 77224) by debbugs.gnu.org; 29 Mar 2025 00:40:50 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Mar 28 20:40:50 2025
Received: from localhost ([127.0.0.1]:55999 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tyKFm-0004IS-78
	for submit <at> debbugs.gnu.org; Fri, 28 Mar 2025 20:40:50 -0400
Received: from mail-oa1-x41.google.com ([2001:4860:4864:20::41]:53462)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <eg642616@HIDDEN>)
 id 1tyKFh-0004IB-2A
 for 77224 <at> debbugs.gnu.org; Fri, 28 Mar 2025 20:40:47 -0400
Received: by mail-oa1-x41.google.com with SMTP id
 586e51a60fabf-2c7b2c14455so1597912fac.2
 for <77224 <at> debbugs.gnu.org>; Fri, 28 Mar 2025 17:40:45 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1743208839; x=1743813639; darn=debbugs.gnu.org;
 h=mime-version:user-agent:message-id:date:references:in-reply-to
 :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to;
 bh=00UvM0eoGvnoQKe8DtuKGmUpZqnhcBhld7sCsx2P11Y=;
 b=UmXCGyePmAywCQElkCpNve1tN+dhyJOO965ZSt+ZJqBoMLix9q48z9QSWMC49OcSrF
 hFT3ePtiz7/go5aTRCT2JGwrhU3k1v4JcwojKMzFR+RQx964jKIQN8IjjWRV5zK3SrDy
 z8HGPq9KNyR9o/BSnGSL4GfmzcT5Ml0byeZKUd+tQ9Bb5rK2BYLWdiDNCW2wPvlG28m+
 5V+NM0gxtC7r3goPAOYHVmONpwXFxht+aIED5gJ1yIpk5OLoU+n52P5iEckUWJ9NAn0c
 BkY+Irn1Nkm13SqS6RERCHfkFLNtir2M21k4SnaR2p4U4KRKdHop4Zu3C1ZrEc0ugRXW
 hyuQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1743208839; x=1743813639;
 h=mime-version:user-agent:message-id:date:references:in-reply-to
 :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date
 :message-id:reply-to;
 bh=00UvM0eoGvnoQKe8DtuKGmUpZqnhcBhld7sCsx2P11Y=;
 b=HlFwNYG01tLUZ6Q/htdpvUwVWk7fjjl3s5HSkw6xY3xaFIlOrL3HOjJeIKJyB3XBDg
 APiC4mECcPFJd9BGZZtfxStpp2TqOsV0SfQKMwCvjLFFN4PGpcYstuNiru/GHIFyT0qT
 b1Ft8kx4ZMK4Vr11CTXpI+GR30LMvxoaEs6p8ig+v26lemr9I5Vv2n40NGM785mkwmrg
 jjqdl7QeW1y+gvUoyoGMpZxGqqR6dIIEKQcNW2K4xuDyI8LCCu0EAaJH4D48brIAyonA
 mndsClHx+piDf2ZgsYJaLvOOkIcfderdKtN4c7fuY8CIAD645eiKKl19VXR3nLrGPU1r
 6i9Q==
X-Forwarded-Encrypted: i=1;
 AJvYcCUPra1PX9Bv6jYynkNczF3LGhIwvQVulF0EB/aZh5xds69n+PEd3NwexAcCud0TzVtFINW34Q==@debbugs.gnu.org
X-Gm-Message-State: AOJu0YxoLEst4tyhZ5QDigqEWCtkR3+ZCN0lVRX1ZHAkkioNWMfKLAnt
 6emgCq6mf1wI1DSVEVjuVxFc8ScVTHzBrOrK/cDljecasfOhQfIWLzqeqGk5
X-Gm-Gg: ASbGncucIao237lsuyFjjeTrD3XKMiZsfd80V18DxjVBy76s0DC+lRnMvyignHzBWAb
 /4CYwbtVhQn6bT5LfFNFe7b/bZ27PYFFRVqrqphWZvyuBiqw2ZMwEUhMQ4fImJ7ZH/rIZeCkp0a
 jphc5JQEmdAsF92SzCelJjrdvjBK8jnBi0zOW64jHqI0oCMsq2OfPAjI239yxxFblcvm4zunil/
 UxLOw3NFq/9Md4WDSVwmmSxouVdShQLN/pyHjjlUV2gddGW5a4RUTZqsZNwFiB7NiYtv32uHqgM
 h6zjo/stvTrO
X-Google-Smtp-Source: AGHT+IFGoeZmviP9oaPM1Ft4rpo0oWySH0IB7PQx+4VuX8UGceHwQPuOJErtl8QR2GHZpMoLl2sZJA==
X-Received: by 2002:a05:6870:14c7:b0:2c1:b58c:c0c with SMTP id
 586e51a60fabf-2cbcf816ce2mr740605fac.34.1743208838569; 
 Fri, 28 Mar 2025 17:40:38 -0700 (PDT)
Received: from fedora ([2806:10ae:e:5fce::1]) by smtp.gmail.com with ESMTPSA id
 586e51a60fabf-2c86a8f514asm666685fac.41.2025.03.28.17.40.37
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 28 Mar 2025 17:40:38 -0700 (PDT)
From: =?utf-8?Q?Elijah_Gabe_P=C3=A9rez?= <eg642616@HIDDEN>
To: Daniel Colascione <dancol@HIDDEN>
Subject: Re: bug#77224: [PATCH] New minor mode 'cursor-indicators-mode'
In-Reply-To: <m1o6xlfcvu.fsf@HIDDEN>
References: <87iknzxski.fsf@HIDDEN> <87o6xq6fud.fsf@HIDDEN>
 <875xjymh93.fsf@HIDDEN> <87ikny2rio.fsf@HIDDEN>
 <86o6xpe2cx.fsf@HIDDEN> <87o6xobdcc.fsf@HIDDEN>
 <875xjwyzvt.fsf@HIDDEN> <8634f0dkhq.fsf@HIDDEN>
 <875xjvcn4o.fsf@HIDDEN> <877c4b81nk.fsf@HIDDEN>
 <86ecyidg2d.fsf@HIDDEN> <87h63ekdxe.fsf@HIDDEN>
 <86cye2d8t6.fsf@HIDDEN> <87a596a29y.fsf@HIDDEN>
 <86tt7ebfnc.fsf@HIDDEN>
 <44319BF5-31B5-4ECD-95AB-591A216D0072@HIDDEN>
 <868qopbp40.fsf@HIDDEN> <m1o6xlfcvu.fsf@HIDDEN>
Date: Fri, 28 Mar 2025 18:40:36 -0600
Message-ID: <877c48654r.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/31.0.50
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-Spam-Score: 0.3 (/)
X-Debbugs-Envelope-To: 77224
Cc: mail@HIDDEN, Eli Zaretskii <eliz@HIDDEN>, 77224 <at> debbugs.gnu.org,
 juri@HIDDEN
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.7 (/)

--=-=-=
Content-Type: multipart/alternative; boundary="==-=-="

--==-=-=
Content-Type: text/plain

Daniel Colascione <dancol@HIDDEN> writes:

> The feature I'm proposing is higher-level than that.  For example, for
> my personal use, I have something that sits in pre-redisplay-function
> and scans all the windows for applying highlights based on current
> buffer and window selection.  I should have written this thing using the
> appropriate window configuration change hooks, but didn't, because I'm
> lazy and my approach is fast enough for me.

>     ;; Don't do this.

>     (defun window-highlight--pre-redisplay (_window)
>       (window-highlight--rescan-windows))

>     (add-function :after pre-redisplay-function
>        #'window-highlight--pre-redisplay))

> What I'd have wanted instead is something like this:

>   (run-when-changed
>       (list (selected-window) (selected-frame) (frame-focus-state))
>     #'window-highlight--rescan-windows)

> Here, we'd run window-highlight--rescan-windows only when one of its
> dependent conditions (e.g. selected frame) changed.  After any number of
> window and frame changes, we'd run window-highlight--rescan-windows
> *once*, immediately before its effects would become user-visible
> (e.g. just before redisplay, or after commands), and we wouldn't re-run
> it until one of its preconditions changed.

Can your proposal also handle whether user moves cursor?

Another reason why post-command-hook is used is mostly for run code
when user moves cursor position.

post-command-hook would run code even if user/cursor is idle and even
for every /(unrelated)/ function in background, which can lead to high
resource consumption.

I think having alternatives like this for specific commands (or actions)
could help reduce the use of post-command-hook.


--==-=-=
Content-Type: text/html

<p>
Daniel Colascione &lt;dancol@HIDDEN&gt; writes:<br />
</p>

<p>
<blockquote class="gmail_quote" style="border-left:#5555EE solid 0.2em;margin: 0em;padding-left: 0.85em;font-family: monospace;unicode-bidi: isolate;display: box;">

<div>The feature I'm proposing is higher-level than that.  For example, for<br />
my personal use, I have something that sits in pre-redisplay-function<br />
and scans all the windows for applying highlights based on current<br />
buffer and window selection.  I should have written this thing using the<br />
appropriate window configuration change hooks, but didn't, because I'm<br />
lazy and my approach is fast enough for me.<br />

</div></blockquote>
</p>

<p>
<blockquote class="gmail_quote" style="border-left:#5555EE solid 0.2em;margin: 0em;padding-left: 0.85em;font-family: monospace;unicode-bidi: isolate;display: box;">

<div>;; Don't do this.<br />

</div></blockquote>
</p>

<p>
<blockquote class="gmail_quote" style="border-left:#5555EE solid 0.2em;margin: 0em;padding-left: 0.85em;font-family: monospace;unicode-bidi: isolate;display: box;">

<div>(defun window-highlight&#x2013;pre-redisplay (<sub>window</sub>)<br />
(window-highlight&#x2013;rescan-windows))<br />

</div></blockquote>
</p>

<p>
<blockquote class="gmail_quote" style="border-left:#5555EE solid 0.2em;margin: 0em;padding-left: 0.85em;font-family: monospace;unicode-bidi: isolate;display: box;">

<div>(add-function :after pre-redisplay-function<br />
#'window-highlight&#x2013;pre-redisplay))<br />

</div></blockquote>
</p>

<p>
<blockquote class="gmail_quote" style="border-left:#5555EE solid 0.2em;margin: 0em;padding-left: 0.85em;font-family: monospace;unicode-bidi: isolate;display: box;">

<div>What I'd have wanted instead is something like this:<br />

</div></blockquote>
</p>

<p>
<blockquote class="gmail_quote" style="border-left:#5555EE solid 0.2em;margin: 0em;padding-left: 0.85em;font-family: monospace;unicode-bidi: isolate;display: box;">

<div>(run-when-changed<br />
(list (selected-window) (selected-frame) (frame-focus-state))<br />
#'window-highlight&#x2013;rescan-windows)<br />

</div></blockquote>
</p>

<p>
<blockquote class="gmail_quote" style="border-left:#5555EE solid 0.2em;margin: 0em;padding-left: 0.85em;font-family: monospace;unicode-bidi: isolate;display: box;">

<div>Here, we'd run window-highlight&#x2013;rescan-windows only when one of its<br />
dependent conditions (e.g. selected frame) changed.  After any number of<br />
window and frame changes, we'd run window-highlight&#x2013;rescan-windows<br />
<b>once</b>, immediately before its effects would become user-visible<br />
(e.g. just before redisplay, or after commands), and we wouldn't re-run<br />
it until one of its preconditions changed.<br />

</div></blockquote>
</p>

<p>
Can your proposal also handle whether user moves cursor?<br />
</p>

<p>
Another reason why post-command-hook is used is mostly for run code<br />
when user moves cursor position.<br />
</p>

<p>
post-command-hook would run code even if user/cursor is idle and even<br />
for every <i>(unrelated)</i> function in background, which can lead to high<br />
resource consumption.<br />
</p>

<p>
I think having alternatives like this for specific commands (or actions)<br />
could help reduce the use of post-command-hook.<br />
</p>

--==-=-=--

--=-=-=
Content-Type: text/plain



-- 
                                          - E.G via GNU Emacs and Org.

--=-=-=--




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

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


Received: (at 77224) by debbugs.gnu.org; 28 Mar 2025 21:13:21 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Mar 28 17:13:21 2025
Received: from localhost ([127.0.0.1]:55734 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tyH0y-000851-Ll
	for submit <at> debbugs.gnu.org; Fri, 28 Mar 2025 17:13:21 -0400
Received: from mail-qk1-x72f.google.com ([2607:f8b0:4864:20::72f]:54453)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <jdtsmith@HIDDEN>)
 id 1tyH0v-00084i-9M
 for 77224 <at> debbugs.gnu.org; Fri, 28 Mar 2025 17:13:18 -0400
Received: by mail-qk1-x72f.google.com with SMTP id
 af79cd13be357-7c5ba363f1aso373513685a.0
 for <77224 <at> debbugs.gnu.org>; Fri, 28 Mar 2025 14:13:17 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1743196391; x=1743801191; darn=debbugs.gnu.org;
 h=references:to:cc:in-reply-to:date:subject:mime-version:message-id
 :from:from:to:cc:subject:date:message-id:reply-to;
 bh=Bnd5VtHEHNl9ALhd5Hwq4F9CR0ohe3QzwBu/mk302lU=;
 b=BSCKQ9TvHtlrxCqZmcVe5A5OA1sMmtUC/b3xFmGeCRR/jr/2VxYL9ONgolgjvvGCNI
 xTz1nFUN4Yk3TB59IxATCe1nZ+uEEerzCqwEwsmVl9xggstxmiCMiVva6tSTs6YVj/UQ
 gmtTLBD+Ae75vTTyOu7GNVujSFGxN2X93vs9JSViix+pdM8SVYtK7bJ+B4Dt3XQ0tfyV
 9KjJM1tRpIri38hCIWGfNALfGVa79RzAAlBLeXCPNL37k2oojHulSRM+u7swTm48HD3q
 9x75b0Vs6dMzdmEJdVYYJEtXbtvzrKr8MJM6eqbubrmuKAZDyCCKyFDgnxlNRJ4Q4MtS
 upGQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1743196391; x=1743801191;
 h=references:to:cc:in-reply-to:date:subject:mime-version:message-id
 :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
 bh=Bnd5VtHEHNl9ALhd5Hwq4F9CR0ohe3QzwBu/mk302lU=;
 b=K+vps+0tfZlyFmnuUUxkoZ59T1w1eip6Y3foZyY2/l2XQJ4H43pzOBKQMps/j+zH5V
 ePoVk8Y6aqjTf565qTmE9xiy7BApWjb4zGcUTaY+Nq1USpyXByda8KAuhCB8RdhVq8y0
 CUMN0H6tpPtLs5liSefgh/pnMjx/bQeY/0d/yVwZWdKcPCHgOktS91i99rOr3utcvnAw
 MbFsVPE0nrKMT6CTtQ8QWDA+iu1zRjpMrwN9bUuQ92j3HtnAERpcEZ2gssV/y1VPZSTK
 PI27SfgJuUikMbZSoRxj22UnfaWhLPYNPWKMabCl6zlxsue5TzSqlbBAJOFuzl+Nw4On
 9zeQ==
X-Forwarded-Encrypted: i=1;
 AJvYcCUl4NEIwMHuZ5XthTYmD5zWJYCuUlVQ1Qr8NF/B3Yo0DrhfAxTpyhM621ti2GuONuhqHDYI8A==@debbugs.gnu.org
X-Gm-Message-State: AOJu0Yyuq/efQ8f1glJ+HK9Zq9Kx+cEdHTv+x3vd9mkfOSqlXt8zpcMj
 bJ3T8fjsAcXDrs5y0eZ+eh1pjsZkFMrcMfMsHPNzoq6Yjy1Ydtzb
X-Gm-Gg: ASbGncvRT8+i0q3a6CDEK8srZwE6feDpG9p5SDk2Q6k1KGIbY+8Gw4viokIVzJEBm53
 jNB6y4LxLTtIRpXw1hqBIf+75CEBWJL4QHBlcbEzgePcJd4MrnwPpueApEH+M2ryXYAU1Qk1ymE
 0bUtHJnLtKtjQbL4OoDJu/Tu+FdXCXH7L0pJVeJF+Iy0DJdM0SjLVEbzK1c/+DyPcEdwq6Nnqle
 LJcmzPDM2V6qTR6V2d/89yT4MoPiHedfhzZ8uNzVRCQDv3JR3zzctMip/+v5cF600ffpxEFKyRG
 zTYJoqYq5VQ3QOMSSs6enOMiW0NgmVAVLxeTM92Vatkfq5da8WMEdjA/WprjUhcbywTJxCW1YBc
 TgfkH
X-Google-Smtp-Source: AGHT+IF1FyiQWArFvwoWLBSRI9xP+bqBRunrKo1/SWhIfn9vzxroH4yySL47JLVfpf5z8lHt+nbIbw==
X-Received: by 2002:a05:620a:280d:b0:7c3:bdce:d1f7 with SMTP id
 af79cd13be357-7c690891588mr90037085a.58.1743196391240; 
 Fri, 28 Mar 2025 14:13:11 -0700 (PDT)
Received: from smtpclient.apple (bwi-cc2.slicewireless.net. [76.76.25.7])
 by smtp.gmail.com with ESMTPSA id
 af79cd13be357-7c5f7764e8dsm164701385a.88.2025.03.28.14.13.09
 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
 Fri, 28 Mar 2025 14:13:10 -0700 (PDT)
From: JD Smith <jdtsmith@HIDDEN>
Message-Id: <DF5A4B15-24CD-4748-B422-16B14081C076@HIDDEN>
Content-Type: multipart/alternative;
 boundary="Apple-Mail=_5AD74124-9F29-40F5-9C93-E462796AB6EF"
Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3826.400.131.1.6\))
Subject: Re: bug#77224: [PATCH] New minor mode 'cursor-indicators-mode'
Date: Fri, 28 Mar 2025 17:12:59 -0400
In-Reply-To: <87msd5r4z8.fsf@HIDDEN>
To: Juri Linkov <juri@HIDDEN>
References: <87iknzxski.fsf@HIDDEN> <87o6xq6fud.fsf@HIDDEN>
 <875xjymh93.fsf@HIDDEN> <87ikny2rio.fsf@HIDDEN>
 <86o6xpe2cx.fsf@HIDDEN> <87o6xobdcc.fsf@HIDDEN>
 <875xjwyzvt.fsf@HIDDEN> <8634f0dkhq.fsf@HIDDEN>
 <875xjvcn4o.fsf@HIDDEN> <877c4b81nk.fsf@HIDDEN>
 <86ecyidg2d.fsf@HIDDEN> <87h63ekdxe.fsf@HIDDEN>
 <86cye2d8t6.fsf@HIDDEN> <87a596a29y.fsf@HIDDEN>
 <86tt7ebfnc.fsf@HIDDEN> <44319BF5-31B5-4ECD-95AB-591A216D0072@HIDDEN>
 <87a595tyzt.fsf@HIDDEN> <87msd5r4z8.fsf@HIDDEN>
X-Mailer: Apple Mail (2.3826.400.131.1.6)
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 77224
Cc: 77224 <at> debbugs.gnu.org,
 =?utf-8?Q?Elijah_Gabe_P=C3=A9rez?= <eg642616@HIDDEN>,
 Daniel Colascione <dancol@HIDDEN>, Eli Zaretskii <eliz@HIDDEN>,
 mail@HIDDEN
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 (-)


--Apple-Mail=_5AD74124-9F29-40F5-9C93-E462796AB6EF
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=utf-8



> On Mar 28, 2025, at 3:30=E2=80=AFAM, Juri Linkov <juri@HIDDEN> =
wrote:
>=20
> Please note that this is insufficient for 'repeat-mode'.
> Currently it requires adding an advice to update the cursor
> on the repeat timer events:


I solved this problem by wrapping the `repeat-echo-function' and =
`after-focus-change-function'.


https://gist.github.com/jdtsmith/a169362879388bc1bdf2bbb977782d4f=EF=BF=BC=

Emacs: change cursor color during active repeat-mode commands
gist.github.com=

--Apple-Mail=_5AD74124-9F29-40F5-9C93-E462796AB6EF
Content-Type: multipart/related;
	type="text/html";
	boundary="Apple-Mail=_95FE29A4-2B04-4591-9268-BE4AE14C8FA0"


--Apple-Mail=_95FE29A4-2B04-4591-9268-BE4AE14C8FA0
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html;
	charset=utf-8

<html><head><meta http-equiv=3D"content-type" content=3D"text/html; =
charset=3Dutf-8"></head><body style=3D"overflow-wrap: break-word; =
-webkit-nbsp-mode: space; line-break: after-white-space;"><br =
id=3D"lineBreakAtBeginningOfMessage"><div><br><blockquote =
type=3D"cite"><div>On Mar 28, 2025, at 3:30=E2=80=AFAM, Juri Linkov =
&lt;juri@HIDDEN&gt; wrote:</div><br =
class=3D"Apple-interchange-newline"><div><span style=3D"caret-color: =
rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: =
normal; font-variant-caps: normal; font-weight: 400; letter-spacing: =
normal; text-align: start; text-indent: 0px; text-transform: none; =
white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; =
text-decoration: none; float: none; display: inline !important;">Please =
note that this is insufficient for 'repeat-mode'.</span><br =
style=3D"caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: =
12px; font-style: normal; font-variant-caps: normal; font-weight: 400; =
letter-spacing: normal; text-align: start; text-indent: 0px; =
text-transform: none; white-space: normal; word-spacing: 0px; =
-webkit-text-stroke-width: 0px; text-decoration: none;"><span =
style=3D"caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: =
12px; font-style: normal; font-variant-caps: normal; font-weight: 400; =
letter-spacing: normal; text-align: start; text-indent: 0px; =
text-transform: none; white-space: normal; word-spacing: 0px; =
-webkit-text-stroke-width: 0px; text-decoration: none; float: none; =
display: inline !important;">Currently it requires adding an advice to =
update the cursor</span><br style=3D"caret-color: rgb(0, 0, 0); =
font-family: Helvetica; font-size: 12px; font-style: normal; =
font-variant-caps: normal; font-weight: 400; letter-spacing: normal; =
text-align: start; text-indent: 0px; text-transform: none; white-space: =
normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; =
text-decoration: none;"><span style=3D"caret-color: rgb(0, 0, 0); =
font-family: Helvetica; font-size: 12px; font-style: normal; =
font-variant-caps: normal; font-weight: 400; letter-spacing: normal; =
text-align: start; text-indent: 0px; text-transform: none; white-space: =
normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; =
text-decoration: none; float: none; display: inline !important;">on the =
repeat timer events:</span></div></blockquote></div><div><br></div>I =
solved this problem by wrapping the `repeat-echo-function' and =
`after-focus-change-function<span style=3D"caret-color: rgb(5, 12, 20); =
color: rgb(5, 12, 20); font-family: ui-monospace, SFMono-Regular, =
&quot;SF Mono&quot;, Menlo, Consolas, &quot;Liberation Mono&quot;, =
monospace; white-space: pre; background-color: rgb(255, 255, =
255);">'</span>.<div><div><br><div><br></div><div><div style=3D"display: =
block;"><div style=3D"-webkit-user-select: all; -webkit-user-drag: =
element; display: inline-block;" class=3D"apple-rich-link" =
draggable=3D"true" role=3D"link" =
data-url=3D"https://gist.github.com/jdtsmith/a169362879388bc1bdf2bbb977782=
d4f"><a style=3D"border-radius:10px;font-family:-apple-system, =
Helvetica, Arial, =
sans-serif;display:block;-webkit-user-select:none;width:300px;user-select:=
none;-webkit-user-modify:read-only;user-modify:read-only;overflow:hidden;t=
ext-decoration:none;" class=3D"lp-rich-link" rel=3D"nofollow" =
href=3D"https://gist.github.com/jdtsmith/a169362879388bc1bdf2bbb977782d4f"=
 dir=3D"ltr" role=3D"button" draggable=3D"false" width=3D"300"><table =
style=3D"table-layout:fixed;border-collapse:collapse;width:300px;backgroun=
d-color:#30353E;font-family:-apple-system, Helvetica, Arial, =
sans-serif;" class=3D"lp-rich-link-emailBaseTable" cellpadding=3D"0" =
cellspacing=3D"0" border=3D"0" width=3D"300"><tbody><tr><td =
vertical-align=3D"center" align=3D"center"><img =
style=3D"width:300px;filter:brightness(0.97);height:150px;" width=3D"300" =
height=3D"150" draggable=3D"false" class=3D"lp-rich-link-mediaImage" =
alt=3D"gist-og-image-54fd7dc0713e.png" =
src=3D"cid:1688FF8E-02F2-46FD-BA32-69FEE48BD037"></td></tr><tr><td =
vertical-align=3D"center"><table bgcolor=3D"#30353E" cellpadding=3D"0" =
cellspacing=3D"0" width=3D"300" =
style=3D"table-layout:fixed;font-family:-apple-system, Helvetica, Arial, =
sans-serif;background-color:rgba(48, 53, 62, =
1);-apple-color-filter:initial;" =
class=3D"lp-rich-link-captionBar"><tbody><tr><td style=3D"padding:8px =
0px 8px 0px;" class=3D"lp-rich-link-captionBar-textStackItem"><div =
style=3D"max-width:100%;margin:0px 16px 0px 16px;overflow:hidden;" =
class=3D"lp-rich-link-captionBar-textStack"><div =
style=3D"word-wrap:break-word;font-weight:500;font-size:12px;overflow:hidd=
en;text-overflow:ellipsis;text-align:left;" =
class=3D"lp-rich-link-captionBar-textStack-topCaption-leading"><a =
rel=3D"nofollow" =
href=3D"https://gist.github.com/jdtsmith/a169362879388bc1bdf2bbb977782d4f"=
 style=3D"text-decoration: none" draggable=3D"false"><font =
color=3D"#FFFFFF" style=3D"color: rgba(255, 255, 255, 0.847059);">Emacs: =
change cursor color during active repeat-mode =
commands</font></a></div><div =
style=3D"word-wrap:break-word;font-weight:400;font-size:11px;overflow:hidd=
en;text-overflow:ellipsis;text-align:left;" =
class=3D"lp-rich-link-captionBar-textStack-bottomCaption-leading"><a =
rel=3D"nofollow" =
href=3D"https://gist.github.com/jdtsmith/a169362879388bc1bdf2bbb977782d4f"=
 style=3D"text-decoration: none" draggable=3D"false"><font =
color=3D"#FFFFFF" style=3D"color: rgba(255, 255, 255, =
0.54902);">gist.github.com</font></a></div></div></td></tr></tbody></table=
></td></tr></tbody></table></a></div></div></div></div></div></body></html=
>=

--Apple-Mail=_95FE29A4-2B04-4591-9268-BE4AE14C8FA0
Content-Transfer-Encoding: base64
Content-Disposition: inline;
	filename=gist-og-image-54fd7dc0713e.png
Content-Type: image/png;
	x-unix-mode=0666;
	name="gist-og-image-54fd7dc0713e.png"
Content-Id: <1688FF8E-02F2-46FD-BA32-69FEE48BD037>

iVBORw0KGgoAAAANSUhEUgAAAoAAAAFACAYAAAAszc0KAAAAAXNSR0IArs4c6QAAAERlWElmTU0A
KgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAACgKADAAQAAAAB
AAABQAAAAABvE1SKAAABzGlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPHg6eG1wbWV0YSB4bWxu
czp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iWE1QIENvcmUgNi4wLjAiPgogICA8cmRmOlJE
RiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMi
PgogICAgICA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIgogICAgICAgICAgICB4bWxuczpl
eGlmPSJodHRwOi8vbnMuYWRvYmUuY29tL2V4aWYvMS4wLyI+CiAgICAgICAgIDxleGlmOkNvbG9y
U3BhY2U+MTwvZXhpZjpDb2xvclNwYWNlPgogICAgICAgICA8ZXhpZjpQaXhlbFhEaW1lbnNpb24+
MTAyNDwvZXhpZjpQaXhlbFhEaW1lbnNpb24+CiAgICAgICAgIDxleGlmOlBpeGVsWURpbWVuc2lv
bj41MTI8L2V4aWY6UGl4ZWxZRGltZW5zaW9uPgogICAgICA8L3JkZjpEZXNjcmlwdGlvbj4KICA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AIk4DkCFAA91+SsMAmQAAmQAAmQgNcJ
UAD0+h3A+pMACZAACZAACXiOwP8D72BFj4OMbiwAAAAASUVORK5CYII=
--Apple-Mail=_95FE29A4-2B04-4591-9268-BE4AE14C8FA0--

--Apple-Mail=_5AD74124-9F29-40F5-9C93-E462796AB6EF--




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

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


Received: (at 77224) by debbugs.gnu.org; 28 Mar 2025 16:58:51 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Mar 28 12:58:51 2025
Received: from localhost ([127.0.0.1]:55372 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tyD2g-0004VU-Tj
	for submit <at> debbugs.gnu.org; Fri, 28 Mar 2025 12:58:51 -0400
Received: from mail-pj1-x1035.google.com ([2607:f8b0:4864:20::1035]:41988)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <karthikchikmagalur@HIDDEN>)
 id 1tyD2e-0004VC-9h
 for 77224 <at> debbugs.gnu.org; Fri, 28 Mar 2025 12:58:49 -0400
Received: by mail-pj1-x1035.google.com with SMTP id
 98e67ed59e1d1-30185d00446so3373111a91.0
 for <77224 <at> debbugs.gnu.org>; Fri, 28 Mar 2025 09:58:48 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1743181122; x=1743785922; darn=debbugs.gnu.org;
 h=mime-version:message-id:date:references:in-reply-to:subject:to:from
 :from:to:cc:subject:date:message-id:reply-to;
 bh=suLdeU+Qre03xN2jVaFzghuvZHM9i3XFgYAQdUMEYY8=;
 b=cQeQVns5geixko5P0jSI8kaqzP/lRgPClwLRTsw8tGqs4Uf6ZuCk7uvS5pe1aNN07Q
 CZxhUOYIuQKkjXB6YG/D+oe6niXNPjPheJKWquFpo3jmPbcc9oBelKPNM1pTVxOwWZAs
 X78ftHFeuRgHmO9kt4QB/zD+mmH4tI/+hWX6vBG9jk65dTwu+q5+IoSo1btYtGkLLq8Y
 7N5N7OUXxa+b/h2DTL9appCxnQLgsclS1rPJx0AYG46JYPykfARLGp5dF3i3U4iEj5V6
 usblxgfeGawLB+sFHHAXtqRqiXxaqlrKY/rT8s/xV4WEqkku4Oe7u4QYl5YH9SWHq65W
 UIzA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1743181122; x=1743785922;
 h=mime-version:message-id:date:references:in-reply-to:subject:to:from
 :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
 bh=suLdeU+Qre03xN2jVaFzghuvZHM9i3XFgYAQdUMEYY8=;
 b=VvZC6S+lffPAmg+uk8wTXWkS07ySrMPUMfxCXeo9DW2CfDbPb/nHZiMVrmTaQ3MZ9Z
 xmBcPbSo27KlLFRVjOXN21mRAVwCfPQTzdECAdLI0KqnKtf0tekBoLmsEshDL9YIwdqi
 XldC8JTSICXhTBVGdJYBwMuY9qVfbd6PieKR3uylVoAjfBAUndcecdpjeCDcNoXx2qtI
 RVWMiYGfFTvJIdDxSBrqGL6YYqnoKRTv0TozFHq4JT2yH9mR0T4Tmj57CfBSafTcxiUq
 7wI6W5x1QSAKTHeJhAXT3bo4orzyXI5wGqtZgRlMKoBPn84RRX9Z4qMvE3zt37zvnHEQ
 kVrQ==
X-Forwarded-Encrypted: i=1;
 AJvYcCVM1efhNh/dk28HmXO1bwAlMsdMng0l+1W+I80Gs+NF3Sll7Uuf3EHJfjj4/liDS1wCnEnDGA==@debbugs.gnu.org
X-Gm-Message-State: AOJu0YxB5I1E3jAD3mTGj0No3KbtO2RXqsOaIMr7tWWWzeUVKPy5PbsJ
 umdnfT6I/e3NqBMN3shBfvK58EDQkdmkLCqksWavIylZZvHUQPEH
X-Gm-Gg: ASbGncvdR7Lpthjq4Z9aUxYvEtRz8QxmMM3FcSgixvGkoQSKhxnxI5N/tpIRpsTp3tL
 r42Ev+r7Hp6T5XWU9Vf6pypNNoLV0AS69Ib3buEsyZsuDPtumSb5lAK/3Wrda/m5Y4MbGmvFNuy
 vszu+mck6N/JgmHbqGt4pehh1ItF+LFx0/5pMvIq+IsqGve9YMe19MHkroRYvoJAjbigABT4/tW
 JTUNaWv39Nl7+5n2zOqel9oJARB6PVN9DUWIEjcaBEVzROpCdrdGHd1xVPIjzx/wQ2RMM67nqA4
 YQS9X7EILARSMKEWnRNxCI5A2SiiC2FZDy4DhGa236DyvHnscMSQVA==
X-Google-Smtp-Source: AGHT+IGsS4HxiZ0Kr9dnoSdzDXG4fI1/W2fsEAw/MKz3nLODJX/BLShdzHfJa+b7BCVXO6GbU6Delw==
X-Received: by 2002:a17:90b:2dcc:b0:2ff:53d6:2b82 with SMTP id
 98e67ed59e1d1-3051c9519damr5908488a91.11.1743181121896; 
 Fri, 28 Mar 2025 09:58:41 -0700 (PDT)
Received: from localhost ([169.231.47.234]) by smtp.gmail.com with ESMTPSA id
 98e67ed59e1d1-30516d56344sm2133497a91.17.2025.03.28.09.58.40
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 28 Mar 2025 09:58:41 -0700 (PDT)
From: Karthik Chikmagalur <karthikchikmagalur@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>, Daniel Mendler <mail@HIDDEN>,
 77224 <at> debbugs.gnu.org,  eg642616@HIDDEN,  juri@HIDDEN
Subject: Re: bug#77224: [PATCH] New minor mode 'cursor-indicators-mode'
In-Reply-To: <86bjtlbqge.fsf@HIDDEN> (Eli Zaretskii's message of "Fri, 28 Mar
 2025 09:48:49 +0300")
References: <87iknzxski.fsf@HIDDEN> <87o6xq6fud.fsf@HIDDEN>
 <875xjymh93.fsf@HIDDEN> <87ikny2rio.fsf@HIDDEN>
 <86o6xpe2cx.fsf@HIDDEN> <87o6xobdcc.fsf@HIDDEN>
 <875xjwyzvt.fsf@HIDDEN> <8634f0dkhq.fsf@HIDDEN>
 <875xjvcn4o.fsf@HIDDEN> <877c4b81nk.fsf@HIDDEN>
 <86ecyidg2d.fsf@HIDDEN> <87h63ekdxe.fsf@HIDDEN>
 <86cye2d8t6.fsf@HIDDEN> <87a596a29y.fsf@HIDDEN>
 <86tt7ebfnc.fsf@HIDDEN> <877c4aa0m8.fsf@HIDDEN>
 <86pli2befe.fsf@HIDDEN> <878qoq5iui.fsf@HIDDEN>
 <86bjtlbqge.fsf@HIDDEN>
Date: Fri, 28 Mar 2025 09:58:39 -0700
Message-ID: <87pli1hz28.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 77224
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 (-)

> How long is the post-command-hook list in your production sessions?
> Should we poll users to give their data?  Just yesterday someone
> complained on Reddit that Emacs is too slow, and I have no doubt that
> features that use post-command-hook are at least part of the reason if
> not _the_ reason.

Here is my post-command-hook in an Org mode buffer in Emacs 29:

(yas--post-command-handler
org-latex-preview-auto--handle-post-cursor
visible-mark-move-overlays
dot-mode-loop
corfu--auto-post-command
t)

That's the buffer-local value.  In addition, the global value is:

(global-font-lock-mode-check-buffers
global-eldoc-mode-check-buffers
global-prettify-symbols-mode-check-buffers
magit-auto-revert-mode-check-buffers
c-post-command
repeat-post-hook
mode-local-post-major-mode-change)

-----

And here are the minor modes I'm using that are installing these hooks.

Modes from packages I've installed explicitly:

- org-latex-preview-auto-mode: Detects and previews LaTeX fragments in
  Org buffers as they are typed.  (I authored this mode, it is designed
  to be as nonintrusive as possible.)

- yas-minor-mode: for Yasnippets (template expansion)

- visible-mark-mode: Highlights the position of the usually invisible
  mark.

- dot-mode: Vim-style repeat operator for text insertion.

- corfu-mode: Autocompletion as you type.

The following modes are from built-in Emacs packages:

- font-lock-mode

- global-eldoc-mode

- global-prettify-symbols-mode

- repeat-mode

Of the remaining, I use Magit with its default settings, under which it
installs `magit-auto-revert-mode-check-buffers'.

I don't know why `c-post-command' is in the global post-command-hook.  I
haven't even edited any C files in this Emacs session.

I don't know why `mode-local-post-major-mode-change' is installed either.

------

Although my Emacs isn't so slow that I can't type comfortably, I can
definitely perceive some difference between Emacs' responsiveness with the
above settings and `emacs -q'.

I would very much like some of these to be moved into different hooks
that trigger only when required.  Daniel's idea for something like this:

(call-on-change (:buffer :window :focus) #'my-thing)

would be very useful.

> So I maintain that we should try to avoid post-command-hook for
> operations that should happen very rarely (this case is one such case:
> we only want to run this code when something is turned on or off).
> Even if the reaction to the change is a bit slower, it is worth our
> while to pay that price: users will be a tad happier with Emacs
> response times.  And if there are alternative methods of doing the
> same, like the respective mode hooks in this case, we should use them
> without thinking twice.  Ideally, post-command-hook should only be
> used for stuff that really must be done after almost every command;
> for any other cases we should look for other Emacs features to do the
> job.

For this reason I try quite hard to avoid using post-command-hook in my
packages.

Karthik




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

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


Received: (at 77224) by debbugs.gnu.org; 28 Mar 2025 16:49:54 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Mar 28 12:49:54 2025
Received: from localhost ([127.0.0.1]:55357 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tyCu2-000467-Gn
	for submit <at> debbugs.gnu.org; Fri, 28 Mar 2025 12:49:54 -0400
Received: from server.qxqx.de ([2a01:4f8:c012:9177::1]:60087 helo=mail.qxqx.de)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <mail@HIDDEN>)
 id 1tyCtz-00045s-GA
 for 77224 <at> debbugs.gnu.org; Fri, 28 Mar 2025 12:49:52 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
 d=daniel-mendler.de; s=key; h=Content-Type:MIME-Version:Message-ID:Date:
 References:In-Reply-To:Subject:Cc:To:From:Sender:Reply-To:
 Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date:
 Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:
 List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=QfCGtxS40BoaHNjg/bAr7VuG0/emh7rGgoS4VgUASkY=; b=unipgFxhI3A11glY+hJed1TmE0
 MgU7mc2J7cxUBiFSysgZnXIFfcROrq6OdW6tQWVM6QUSPnJLjNFDg+ZrHl7QtEaJRokSs3sj7n6JL
 gSv4UXoxf0iSr1aJYKaEG7WQ2P90a+CvZ+kcuWhSNGEn3ERqAsKmDUsO+4ZBpqcDxFgY=;
From: Daniel Mendler <mail@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#77224: [PATCH] New minor mode 'cursor-indicators-mode'
In-Reply-To: <86frix9kv0.fsf@HIDDEN> (Eli Zaretskii's message of "Fri, 28 Mar
 2025 19:32:35 +0300")
References: <87iknzxski.fsf@HIDDEN> <87o6xq6fud.fsf@HIDDEN>
 <875xjymh93.fsf@HIDDEN> <87ikny2rio.fsf@HIDDEN>
 <86o6xpe2cx.fsf@HIDDEN> <87o6xobdcc.fsf@HIDDEN>
 <875xjwyzvt.fsf@HIDDEN> <8634f0dkhq.fsf@HIDDEN>
 <875xjvcn4o.fsf@HIDDEN> <877c4b81nk.fsf@HIDDEN>
 <86ecyidg2d.fsf@HIDDEN> <87h63ekdxe.fsf@HIDDEN>
 <86cye2d8t6.fsf@HIDDEN> <87a596a29y.fsf@HIDDEN>
 <86tt7ebfnc.fsf@HIDDEN> <877c4aa0m8.fsf@HIDDEN>
 <86pli2befe.fsf@HIDDEN> <878qoq5iui.fsf@HIDDEN>
 <86bjtlbqge.fsf@HIDDEN> <87msd5rwnm.fsf@HIDDEN>
 <86frix9kv0.fsf@HIDDEN>
Date: Fri, 28 Mar 2025 17:49:44 +0100
Message-ID: <87frixaymv.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 77224
Cc: 77224 <at> debbugs.gnu.org, eg642616@HIDDEN, juri@HIDDEN
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.7 (-)

Eli Zaretskii <eliz@HIDDEN> writes:

>> From: Daniel Mendler <mail@HIDDEN>
>> Cc: eg642616@HIDDEN,  77224 <at> debbugs.gnu.org,  juri@HIDDEN
>> Date: Fri, 28 Mar 2025 16:40:29 +0100
>> 
>> Eli Zaretskii <eliz@HIDDEN> writes:
>> 
>> My `post-command-hook' list looks like this:
>> 
>> Buffer-local:
>> (jit-lock--antiblink-post-command eldoc-schedule-timer
>>  corfu--auto-post-command jinx--reschedule
>>  whitespace-post-command-hook hl-line-highlight t)
>
> And in Org buffers?

The first list was from the *scratch* buffer. This one is from an Org
buffer:

(eldoc-schedule-timer corfu--auto-post-command jinx--reschedule
 whitespace-post-command-hook hl-line-highlight t)

Daniel




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

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


Received: (at 77224) by debbugs.gnu.org; 28 Mar 2025 16:32:48 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Mar 28 12:32:48 2025
Received: from localhost ([127.0.0.1]:55333 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tyCdT-0003N0-Mn
	for submit <at> debbugs.gnu.org; Fri, 28 Mar 2025 12:32:48 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:55338)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1tyCdR-0003Mk-H5
 for 77224 <at> debbugs.gnu.org; Fri, 28 Mar 2025 12:32:46 -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 1tyCdJ-0007j0-UU; Fri, 28 Mar 2025 12:32:37 -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=CjL2ybXZG+QdowPfIYO9CCBP50aVxlxYh/4flI6wfIc=; b=P2LhZiolUlIB
 An7l1JjOicE7K9FcwnSb91g/vRJgTCGGj/PB5hDKdsJmPd5IR4Fsqic1hMUQQBVhcxd7n/YP5L/ND
 o94hI/BLIC86Tkz444VWgkXDY+Z+Lill5nupoVUoY5uLQ5EYRoNJZzhyO0S0mAj/wRqX/w9UEqcGy
 lN5AFSR9d15f6Qm476I7JyJ3AMLC14udDYfUlCf4/LmO5XgCrdDHbwaqS9ueRAJhq8ar8E9iQlL7J
 1HugZPy0xUp2Db7weIVEdKG9Y0DMssPuwdB9bijtNa8Ua5RftStkBvYT2zNn1GtW4EeLG4F1J/v4R
 zJR5Yq5163laWfq2Ink+dw==;
Date: Fri, 28 Mar 2025 19:32:35 +0300
Message-Id: <86frix9kv0.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Daniel Mendler <mail@HIDDEN>
In-Reply-To: <87msd5rwnm.fsf@HIDDEN> (message from Daniel Mendler
 on Fri, 28 Mar 2025 16:40:29 +0100)
Subject: Re: bug#77224: [PATCH] New minor mode 'cursor-indicators-mode'
References: <87iknzxski.fsf@HIDDEN> <87o6xq6fud.fsf@HIDDEN>
 <875xjymh93.fsf@HIDDEN> <87ikny2rio.fsf@HIDDEN>
 <86o6xpe2cx.fsf@HIDDEN> <87o6xobdcc.fsf@HIDDEN>
 <875xjwyzvt.fsf@HIDDEN> <8634f0dkhq.fsf@HIDDEN>
 <875xjvcn4o.fsf@HIDDEN> <877c4b81nk.fsf@HIDDEN>
 <86ecyidg2d.fsf@HIDDEN> <87h63ekdxe.fsf@HIDDEN>
 <86cye2d8t6.fsf@HIDDEN> <87a596a29y.fsf@HIDDEN>
 <86tt7ebfnc.fsf@HIDDEN> <877c4aa0m8.fsf@HIDDEN>
 <86pli2befe.fsf@HIDDEN> <878qoq5iui.fsf@HIDDEN>
 <86bjtlbqge.fsf@HIDDEN> <87msd5rwnm.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 77224
Cc: 77224 <at> debbugs.gnu.org, eg642616@HIDDEN, juri@HIDDEN
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: Daniel Mendler <mail@HIDDEN>
> Cc: eg642616@HIDDEN,  77224 <at> debbugs.gnu.org,  juri@HIDDEN
> Date: Fri, 28 Mar 2025 16:40:29 +0100
> 
> Eli Zaretskii <eliz@HIDDEN> writes:
> 
> My `post-command-hook' list looks like this:
> 
> Buffer-local:
> (jit-lock--antiblink-post-command eldoc-schedule-timer
>  corfu--auto-post-command jinx--reschedule
>  whitespace-post-command-hook hl-line-highlight t)

And in Org buffers?




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

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


Received: (at 77224) by debbugs.gnu.org; 28 Mar 2025 16:02:35 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Mar 28 12:02:35 2025
Received: from localhost ([127.0.0.1]:55279 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tyCAE-00021U-Pm
	for submit <at> debbugs.gnu.org; Fri, 28 Mar 2025 12:02:35 -0400
Received: from mail-qk1-x735.google.com ([2607:f8b0:4864:20::735]:57771)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <shipmints@HIDDEN>)
 id 1tyCA9-000211-68
 for 77224 <at> debbugs.gnu.org; Fri, 28 Mar 2025 12:02:32 -0400
Received: by mail-qk1-x735.google.com with SMTP id
 af79cd13be357-7c55b53a459so239309185a.3
 for <77224 <at> debbugs.gnu.org>; Fri, 28 Mar 2025 09:02:29 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1743177743; x=1743782543; 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=LiKQ6OhYd6nShG+nQ9B5Xxjr4M0Mf6i9mYrCm8H5lE8=;
 b=CxfbTdSg7J9KG4oLE/3O+rubj/VAEWb0pwbdSYrXCXSnkIWvaIcOnV7u+bQgXbmdbH
 8apmYwLGzw0/f2QbZ8iUxs0OUfOyV/QFZiHtcN9LI7G6E6zAKE+YvbiaFl5YLX/1kwq7
 jCw1khvJ48TIJs78z4H+2sZH8oArvlzly8vCjw4HRlpnjtN38O2tUTr+8i3pE4V5aSje
 3epqLfLceFD5ZM0uEr5Rh+D8ERodHQUFZ8fdYeOuRL32dDb6FBOpH/BdmJcamn/5MHgU
 /Yr5ccCsKUR+2OOL9LBZEQ22AsHBtWh6OIHX9fDVeSXtoiUzpYF0JyQaDH3PJi/oFTUk
 DJkw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1743177743; x=1743782543;
 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=LiKQ6OhYd6nShG+nQ9B5Xxjr4M0Mf6i9mYrCm8H5lE8=;
 b=kV2o1W9yd5z0MRHU9SdSgFmrwCddOVkTNEgC1PBo2IP+R9AG6PPuhpYJQdKQn1oWvy
 AfoxyPWYsNHCOpQVyMv/czoy44EphhbAKF0I9Gxerl5BQDVHfx0Ta5jrB4mSQMx0jMJR
 i29oDs7Rw01LR5zZEf3yNLG6DUCYgB2Wlm1jpcdNvERksXnQLTz96w/CdbpYcj+ZxyPc
 fdoIyR6k35G1R4TIDyYIyAg5clCQvk7otfFnnOWot4i766fvUoY1mOzDXhkUX7/b0czx
 wMBh3f+JsuN9e664MHD4yAXCJJ/O5VFj0mBshlfcTR7DONhNeEx7tevqIGxjgt7/ELgS
 KHxA==
X-Forwarded-Encrypted: i=1;
 AJvYcCV1FRY1uBjf5r9QNUhMnJWzns6zRLNaWew185+YwdoaUXxnj70Nu7vQer5jpfxBuI6rBzbwXg==@debbugs.gnu.org
X-Gm-Message-State: AOJu0YzDT30CM5GPFcyo64St/Q9+plD0OY6p+ZCy6qoUTJpywheYXWnY
 4S8JCUPsJ+AzFFxiM8kWXVXwJ20BfdRlYJ8Qu4y8oOySg0DWAPMsFDZS8fCEyzXacCwaYqCQGoH
 s1EHsv/qaDb7HacP9rENF5fCB/kg=
X-Gm-Gg: ASbGncs7kCYv1ybxqRpuWA+x5CgCfNPpQT5932XJxSjGdwz20bcGxmdIpril3h+sl4N
 QG5oAsE9BkNojM/iopHs7jZbGmJQ/9nRyt/wTIoXWnR9kgzfSInxAGjZS0xClRwisqogtxYzhtV
 VoO5aE+pBoosjkLqcDOxMsBFmx2g==
X-Google-Smtp-Source: AGHT+IGqrYXd022XFC8m3cgoZn0csDywKmD9H+DS1A3KZ27c+l1HXkmj7sM4xc6Yyy1g2+noQZizbVM1huI7pjLzKSU=
X-Received: by 2002:a05:620a:44c1:b0:7c5:4d2e:4d26 with SMTP id
 af79cd13be357-7c5eda8cd34mr1252071385a.51.1743177742615; Fri, 28 Mar 2025
 09:02:22 -0700 (PDT)
MIME-Version: 1.0
References: <87iknzxski.fsf@HIDDEN> <87o6xq6fud.fsf@HIDDEN>
 <875xjymh93.fsf@HIDDEN> <87ikny2rio.fsf@HIDDEN> <86o6xpe2cx.fsf@HIDDEN>
 <87o6xobdcc.fsf@HIDDEN> <875xjwyzvt.fsf@HIDDEN>
 <8634f0dkhq.fsf@HIDDEN> <875xjvcn4o.fsf@HIDDEN>
 <877c4b81nk.fsf@HIDDEN>
 <86ecyidg2d.fsf@HIDDEN> <87h63ekdxe.fsf@HIDDEN>
 <86cye2d8t6.fsf@HIDDEN> <87a596a29y.fsf@HIDDEN>
 <86tt7ebfnc.fsf@HIDDEN> <877c4aa0m8.fsf@HIDDEN>
 <86pli2befe.fsf@HIDDEN> <878qoq5iui.fsf@HIDDEN>
 <86bjtlbqge.fsf@HIDDEN> <87msd5rwnm.fsf@HIDDEN>
In-Reply-To: <87msd5rwnm.fsf@HIDDEN>
From: Ship Mints <shipmints@HIDDEN>
Date: Fri, 28 Mar 2025 12:02:11 -0400
X-Gm-Features: AQ5f1JqmxXvo0IXzuZtm0_gXrITq-4Qud7nu134VYX_gvWopNiY5Dw0qLbber-o
Message-ID: <CAN+1HbogQAYmmdtcr9Z94KnQSDMp4xcDntTbM7GsnNsK3aUrRw@HIDDEN>
Subject: Re: bug#77224: [PATCH] New minor mode 'cursor-indicators-mode'
To: Daniel Mendler <mail@HIDDEN>
Content-Type: multipart/alternative; boundary="000000000000210a280631693292"
X-Spam-Score: 1.0 (+)
X-Debbugs-Envelope-To: 77224
Cc: 77224 <at> debbugs.gnu.org, Eli Zaretskii <eliz@HIDDEN>, eg642616@HIDDEN,
 juri@HIDDEN
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 (-)

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

On Fri, Mar 28, 2025 at 11:41=E2=80=AFAM Daniel Mendler via Bug reports for=
 GNU
Emacs, the Swiss army knife of text editors <bug-gnu-emacs@HIDDEN> wrote:

> Eli Zaretskii <eliz@HIDDEN> writes:
>
> >> From: Daniel Mendler <mail@HIDDEN>
> >> Cc: eg642616@HIDDEN,  77224 <at> debbugs.gnu.org,  juri@HIDDEN
> >> Date: Thu, 27 Mar 2025 21:17:25 +0100
> >>
> >> Here we discuss changing only the color of the cursor, a much much les=
s
> >> complex operation.
> >
> > My point is that when the list on post-command-hook is long, it takes
> > Emacs time to process all the functions on the list, and the longer
> > the list, the less responsive Emacs will be.  These small
> > insignificant delays add up.
>
> I see your point. But not only the length of the list but also the
> weight of the specific hook functions matters. A handful of
> insignificant delays add up, but will still stay insignificant. There
> are not that many hooks installed in the PCH list (see my list below).
> In the reports where users complain about slow Emacs, it seems more
> likely that one bad hook outweighs all the others.
>
> > How long is the post-command-hook list in your production sessions?
> > Should we poll users to give their data?  Just yesterday someone
> > complained on Reddit that Emacs is too slow, and I have no doubt that
> > features that use post-command-hook are at least part of the reason if
> > not _the_ reason.
>
> Indeed. PCHs are a common reason for slow down. Even worse are functions
> which run during redisplay. Heavy custom mode lines seem to be the main
> problem here.
>
> My `post-command-hook' list looks like this:
>
> Buffer-local:
> (jit-lock--antiblink-post-command eldoc-schedule-timer
>  corfu--auto-post-command jinx--reschedule
>  whitespace-post-command-hook hl-line-highlight t)
>
> Global:
> (ibuffer-auto-update-changed repeat-post-hook)
>
> I don't have any problems with these hooks, since they are either cheap
> or only schedule some timers for more expensive operations. At least I
> don't notice any sluggishness and the PCHs don't appear in profiles.
>

I have experienced issues in the past with PCH entries and cleaned it all
up ages ago and try to keep an eye on it.  One culprit was the pyvenv
tracker which I rewrote a private copy of to use a different method that
achieves the same effect with less overhead.

Out of both curiosity and to butt in on this discussion, I posted this
casual survey on reddit
https://www.reddit.com/r/emacs/comments/1jlyek0/show_your_postcommandhook_c=
ontents_to_help_emacs/

Perhaps we'll see that the bulk of people's PCH is the usual
well-performing suspects.  I posted mine.

-Stephane

--000000000000210a280631693292
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 Fri, Mar 28, 2025 at 11:41=E2=80=AFAM Daniel Mendler via Bug reports for=
 GNU Emacs, the Swiss army knife of text editors &lt;<a href=3D"mailto:bug-=
gnu-emacs@HIDDEN">bug-gnu-emacs@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">Eli Zaretskii &lt;<a href=3D"mailto:eliz@HIDDEN" ta=
rget=3D"_blank">eliz@HIDDEN</a>&gt; writes:<br>
<br>
&gt;&gt; From: Daniel Mendler &lt;<a href=3D"mailto:mail@HIDDEN"=
 target=3D"_blank">mail@HIDDEN</a>&gt;<br>
&gt;&gt; Cc: <a href=3D"mailto:eg642616@HIDDEN" target=3D"_blank">eg6426=
16@HIDDEN</a>,=C2=A0 <a href=3D"mailto:77224 <at> debbugs.gnu.org" target=3D"=
_blank">77224 <at> debbugs.gnu.org</a>,=C2=A0 <a href=3D"mailto:juri@HIDDEN"=
 target=3D"_blank">juri@HIDDEN</a><br>
&gt;&gt; Date: Thu, 27 Mar 2025 21:17:25 +0100<br>
&gt;&gt; <br>
&gt;&gt; Here we discuss changing only the color of the cursor, a much much=
 less<br>
&gt;&gt; complex operation.<br>
&gt;<br>
&gt; My point is that when the list on post-command-hook is long, it takes<=
br>
&gt; Emacs time to process all the functions on the list, and the longer<br=
>
&gt; the list, the less responsive Emacs will be.=C2=A0 These small<br>
&gt; insignificant delays add up.<br>
<br>
I see your point. But not only the length of the list but also the<br>
weight of the specific hook functions matters. A handful of<br>
insignificant delays add up, but will still stay insignificant. There<br>
are not that many hooks installed in the PCH list (see my list below).<br>
In the reports where users complain about slow Emacs, it seems more<br>
likely that one bad hook outweighs all the others.<br>
<br>
&gt; How long is the post-command-hook list in your production sessions?<br=
>
&gt; Should we poll users to give their data?=C2=A0 Just yesterday someone<=
br>
&gt; complained on Reddit that Emacs is too slow, and I have no doubt that<=
br>
&gt; features that use post-command-hook are at least part of the reason if=
<br>
&gt; not _the_ reason.<br>
<br>
Indeed. PCHs are a common reason for slow down. Even worse are functions<br=
>
which run during redisplay. Heavy custom mode lines seem to be the main<br>
problem here.<br>
<br>
My `post-command-hook&#39; list looks like this:<br>
<br>
Buffer-local:<br>
(jit-lock--antiblink-post-command eldoc-schedule-timer<br>
=C2=A0corfu--auto-post-command jinx--reschedule<br>
=C2=A0whitespace-post-command-hook hl-line-highlight t)<br>
<br>
Global:<br>
(ibuffer-auto-update-changed repeat-post-hook)<br>
<br>
I don&#39;t have any problems with these hooks, since they are either cheap=
<br>
or only schedule some timers for more expensive operations. At least I<br>
don&#39;t notice any sluggishness and the PCHs don&#39;t appear in profiles=
.<br></blockquote><div><br></div><div class=3D"gmail_default" style=3D"font=
-family:monospace">I have experienced issues in the past with PCH entries a=
nd cleaned it all up ages ago and try to keep an eye on it.=C2=A0 One culpr=
it was the pyvenv tracker which I rewrote a private copy of to use a differ=
ent method that achieves the same effect with less overhead.</div><div clas=
s=3D"gmail_default" style=3D"font-family:monospace"><br></div><div class=3D=
"gmail_default" style=3D"font-family:monospace">Out of both curiosity and t=
o butt in on this discussion, I posted this casual survey on reddit=C2=A0<a=
 href=3D"https://www.reddit.com/r/emacs/comments/1jlyek0/show_your_postcomm=
andhook_contents_to_help_emacs/">https://www.reddit.com/r/emacs/comments/1j=
lyek0/show_your_postcommandhook_contents_to_help_emacs/</a></div><div class=
=3D"gmail_default" style=3D"font-family:monospace"><br></div><div class=3D"=
gmail_default" style=3D"font-family:monospace">Perhaps we&#39;ll see that t=
he bulk of people&#39;s PCH is the usual well-performing suspects.=C2=A0 I =
posted mine.</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></div>

--000000000000210a280631693292--




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

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


Received: (at 77224) by debbugs.gnu.org; 28 Mar 2025 15:40:41 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Mar 28 11:40:41 2025
Received: from localhost ([127.0.0.1]:55243 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tyBp2-00015M-Lz
	for submit <at> debbugs.gnu.org; Fri, 28 Mar 2025 11:40:41 -0400
Received: from server.qxqx.de ([2a01:4f8:c012:9177::1]:44849 helo=mail.qxqx.de)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <mail@HIDDEN>)
 id 1tyBoz-000154-Co
 for 77224 <at> debbugs.gnu.org; Fri, 28 Mar 2025 11:40:38 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
 d=daniel-mendler.de; s=key; h=Content-Type:MIME-Version:Message-ID:Date:
 References:In-Reply-To:Subject:Cc:To:From:Sender:Reply-To:
 Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date:
 Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:
 List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=ZmIkepyiU2y96Ah/oqA2K/FyCmK11CqqYrgm7VlbmB8=; b=BiQHt8mT3YFRKlhuRmDat1GNtL
 FojHwQlOrzmw0X27MZQlnFMLPuVrWqPq+nAViddVwYLVRA7vRQkAIdGjFKa9HY/uAdbi3Dt3pqIol
 NPjnQpn5fXashfzPdVvHPA4Gu1wua/lWA1rDBCDCY2vnIyTkf3XIAJwZpFghQcbYxNRw=;
From: Daniel Mendler <mail@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#77224: [PATCH] New minor mode 'cursor-indicators-mode'
In-Reply-To: <86bjtlbqge.fsf@HIDDEN> (Eli Zaretskii's message of "Fri, 28 Mar
 2025 09:48:49 +0300")
References: <87iknzxski.fsf@HIDDEN> <87o6xq6fud.fsf@HIDDEN>
 <875xjymh93.fsf@HIDDEN> <87ikny2rio.fsf@HIDDEN>
 <86o6xpe2cx.fsf@HIDDEN> <87o6xobdcc.fsf@HIDDEN>
 <875xjwyzvt.fsf@HIDDEN> <8634f0dkhq.fsf@HIDDEN>
 <875xjvcn4o.fsf@HIDDEN> <877c4b81nk.fsf@HIDDEN>
 <86ecyidg2d.fsf@HIDDEN> <87h63ekdxe.fsf@HIDDEN>
 <86cye2d8t6.fsf@HIDDEN> <87a596a29y.fsf@HIDDEN>
 <86tt7ebfnc.fsf@HIDDEN> <877c4aa0m8.fsf@HIDDEN>
 <86pli2befe.fsf@HIDDEN> <878qoq5iui.fsf@HIDDEN>
 <86bjtlbqge.fsf@HIDDEN>
Date: Fri, 28 Mar 2025 16:40:29 +0100
Message-ID: <87msd5rwnm.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 77224
Cc: 77224 <at> debbugs.gnu.org, eg642616@HIDDEN, juri@HIDDEN
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.7 (-)

Eli Zaretskii <eliz@HIDDEN> writes:

>> From: Daniel Mendler <mail@HIDDEN>
>> Cc: eg642616@HIDDEN,  77224 <at> debbugs.gnu.org,  juri@HIDDEN
>> Date: Thu, 27 Mar 2025 21:17:25 +0100
>> 
>> Here we discuss changing only the color of the cursor, a much much less
>> complex operation.
>
> My point is that when the list on post-command-hook is long, it takes
> Emacs time to process all the functions on the list, and the longer
> the list, the less responsive Emacs will be.  These small
> insignificant delays add up.

I see your point. But not only the length of the list but also the
weight of the specific hook functions matters. A handful of
insignificant delays add up, but will still stay insignificant. There
are not that many hooks installed in the PCH list (see my list below).
In the reports where users complain about slow Emacs, it seems more
likely that one bad hook outweighs all the others.

> How long is the post-command-hook list in your production sessions?
> Should we poll users to give their data?  Just yesterday someone
> complained on Reddit that Emacs is too slow, and I have no doubt that
> features that use post-command-hook are at least part of the reason if
> not _the_ reason.

Indeed. PCHs are a common reason for slow down. Even worse are functions
which run during redisplay. Heavy custom mode lines seem to be the main
problem here.

My `post-command-hook' list looks like this:

Buffer-local:
(jit-lock--antiblink-post-command eldoc-schedule-timer
 corfu--auto-post-command jinx--reschedule
 whitespace-post-command-hook hl-line-highlight t)

Global:
(ibuffer-auto-update-changed repeat-post-hook)

I don't have any problems with these hooks, since they are either cheap
or only schedule some timers for more expensive operations. At least I
don't notice any sluggishness and the PCHs don't appear in profiles.

Daniel




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

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


Received: (at 77224) by debbugs.gnu.org; 28 Mar 2025 14:28:34 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Mar 28 10:28:34 2025
Received: from localhost ([127.0.0.1]:55041 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tyAhF-0005wj-Fx
	for submit <at> debbugs.gnu.org; Fri, 28 Mar 2025 10:28:33 -0400
Received: from dancol.org ([2600:3c01:e000:3d8::1]:50398)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <dancol@HIDDEN>) id 1tyAhC-0005wQ-9G
 for 77224 <at> debbugs.gnu.org; Fri, 28 Mar 2025 10:28:31 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=dancol.org; 
 s=x;
 h=Content-Type:MIME-Version:Message-ID:Date:References:In-Reply-To:
 Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:Content-ID:
 Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc
 :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe:
 List-Post:List-Owner:List-Archive;
 bh=KwdSHQmpOc/DEkqOEf9xCg1wzRTjrPA0R2SLf+wLzmY=; b=U2tCPpv+jLDTSNyr+TKYO9BHRQ
 ULb/6V8fHPelBLBCq06kUvbmU0/ITrDLnpmdwLt6vd481Vpp0VN1SWxv5UuLy5xdNYg44ch1uicwC
 kVM9dFW9uOH12p5Na1vrSy99VsoSkMm6oZ5jeGQYsUbQWoScdZOFRt8mv/InsQ/t2X0sqlyq561ew
 ehcQ+1MvumDuAgxq5f+p3QhNnahl5lRfKvyZp+WqGuNjjCiTGQYxwFhJq3KLPFbbrSAYU4i0+tQhV
 d2OYF1WimM6pcf5fg9+zyr2MadL+w08bQTV7OnicHnx2lfBbu0UyWuwyRnwGvQtjM1Qd9RfVcJgbz
 2eVSWGYg==;
Received: from dancol by dancol.org with local (Exim 4.96)
 (envelope-from <dancol@HIDDEN>) id 1tyAgf-004KBU-39;
 Fri, 28 Mar 2025 10:27:57 -0400
From: Daniel Colascione <dancol@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#77224: [PATCH] New minor mode 'cursor-indicators-mode'
In-Reply-To: <868qopbp40.fsf@HIDDEN>
References: <87iknzxski.fsf@HIDDEN> <87o6xq6fud.fsf@HIDDEN>
 <875xjymh93.fsf@HIDDEN> <87ikny2rio.fsf@HIDDEN>
 <86o6xpe2cx.fsf@HIDDEN> <87o6xobdcc.fsf@HIDDEN>
 <875xjwyzvt.fsf@HIDDEN> <8634f0dkhq.fsf@HIDDEN>
 <875xjvcn4o.fsf@HIDDEN> <877c4b81nk.fsf@HIDDEN>
 <86ecyidg2d.fsf@HIDDEN> <87h63ekdxe.fsf@HIDDEN>
 <86cye2d8t6.fsf@HIDDEN> <87a596a29y.fsf@HIDDEN>
 <86tt7ebfnc.fsf@HIDDEN>
 <44319BF5-31B5-4ECD-95AB-591A216D0072@HIDDEN>
 <868qopbp40.fsf@HIDDEN>
User-Agent: mu4e 1.12.8; emacs 31.0.50
Date: Fri, 28 Mar 2025 10:28:21 -0400
Message-ID: <m1o6xlfcvu.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 77224
Cc: mail@HIDDEN, eg642616@HIDDEN, juri@HIDDEN,
 77224 <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 (-)

Eli Zaretskii <eliz@HIDDEN> writes:

>> Date: Thu, 27 Mar 2025 16:41:39 -0400
>> From: Daniel Colascione <dancol@HIDDEN>
>> CC: 77224 <at> debbugs.gnu.org, eg642616@HIDDEN, juri@HIDDEN
>> 
>> >> Regarding Emacs sluggishness, the `cursor-indicators-mode' is an
>> >> optional mode. If it increases sluggishness unnacceptably (which it
>> >> won't), users can turn it off.
>> >
>> >Experience shows that many users turn on a lot of features which rely
>> >on post-command-hook, and then complain that Emacs is slow to respond.
>> >Telling them to turn off features they like doesn't really work.
>> 
>> Nor does telling external package authors not to use post-command-hook.
>
> Well, I could at least try ;-)  Who knows, some of them might even
> listen...
>
>> I think there are two worthwhile approaches: 1) time the entries in
>> post-command-hook and alert users about slow ones, and 2) provide a
>> "do something when X, Y, or Z changes" API that authors could use
>> when they would otherwise put something on PCH and check X, Y, and Z
>> internally. Internally, we could DTRT and omit running those hooks
>> when the relevant conditions haven't changed.
>
> I'd be okay with developing 1), I think it's a good feature, given the
> proliferation of features that use this hook.

Yeah. SHTDI though, and I'm not going to be able to get to it soon.

> As for 2), I think we already have that: add-variable-watcher.  We
> already use this for a small number of features.  Does that fit the
> bill?

No, because variable watchers are synchronous --- also, they're hacky:
they let you run arbitrary code at nearly arbitrary points.
Like advice, they're a last resort and a debugging aid, and ISTM if
we're using them to implement features, something is wrong.  I think
we're conditioned to understand that named functions can be advised, but
most people aren't thinking of arbitrary variable assignments as
extension points.

The feature I'm proposing is higher-level than that.  For example, for
my personal use, I have something that sits in pre-redisplay-function
and scans all the windows for applying highlights based on current
buffer and window selection.  I should have written this thing using the
appropriate window configuration change hooks, but didn't, because I'm
lazy and my approach is fast enough for me.

    ;; Don't do this.

    (defun window-highlight--pre-redisplay (_window)
      (window-highlight--rescan-windows))

    (add-function :after pre-redisplay-function
       #'window-highlight--pre-redisplay))

What I'd have wanted instead is something like this:

  (run-when-changed
      (list (selected-window) (selected-frame) (frame-focus-state))
    #'window-highlight--rescan-windows)

Here, we'd run window-highlight--rescan-windows only when one of its
dependent conditions (e.g. selected frame) changed.  After any number of
window and frame changes, we'd run window-highlight--rescan-windows
*once*, immediately before its effects would become user-visible
(e.g. just before redisplay, or after commands), and we wouldn't re-run
it until one of its preconditions changed.

It's certainly possible to do the same coalescing and change detection
manually, but it's inconvenient.  It's easier to just throw something in
pre-redisplay or post-command-hook, so that's what people do.
Level-triggered control is easier to reason about than
edge-triggered control.




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

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


Received: (at 77224) by debbugs.gnu.org; 28 Mar 2025 07:38:05 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Mar 28 03:38:05 2025
Received: from localhost ([127.0.0.1]:52652 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ty4I1-0002bc-BX
	for submit <at> debbugs.gnu.org; Fri, 28 Mar 2025 03:38:05 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:49888)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1ty4Hz-0002b3-9V
 for 77224 <at> debbugs.gnu.org; Fri, 28 Mar 2025 03:38:03 -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 1ty4Ht-0003Yt-Vn; Fri, 28 Mar 2025 03:37:57 -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=O/T81Zuzv36V222FUhesTwuNGbxgNEF1lHg/ijU4CeE=; b=BCKlNKJNB13E
 SI/5IK9bmOHrcnaWZKDBEqjRp2iuj4nDfb+YU6f0Z51kn5BIxOfSek1+iid6Wkjg9i+LeHOLaUrYW
 Twkf3VhY/Eq9abVqnMSmavXrFphnUU+4EcGoan41mlrSkTC3Pn+MidNlEHoFP37hLIzAOwLFT86E0
 8TrI4n6/jMR2Kylqt1D+SZZ4dm+NdVH8A+2R25QG2odeEl2D0pKBX3+agYEo+JsmoVq4pzYHvJ7m3
 EqMB1TG/n8QcAhwT9vWljSeRZL5dyKQywrI2J8UlZf/WHIk8kR89jfU1aDRyEhgL4JiWPdFFjQLij
 16z0ArF7aBXnHKF2F9X+Ew==;
Date: Fri, 28 Mar 2025 10:37:48 +0300
Message-Id: <861puhbo6r.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Michael Heerdegen <michael_heerdegen@HIDDEN>
In-Reply-To: <87ldsq7zbc.fsf@HIDDEN> (message from Michael Heerdegen on Fri,
 28 Mar 2025 01:51:03 +0100)
Subject: Re: bug#77224: [PATCH] New minor mode 'cursor-indicators-mode'
References: <87iknzxski.fsf@HIDDEN> <87o6xq6fud.fsf@HIDDEN>
 <875xjymh93.fsf@HIDDEN> <87ikny2rio.fsf@HIDDEN>
 <86o6xpe2cx.fsf@HIDDEN> <87o6xobdcc.fsf@HIDDEN>
 <875xjwyzvt.fsf@HIDDEN> <8634f0dkhq.fsf@HIDDEN>
 <87ldsq7zbc.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 77224
Cc: 77224 <at> debbugs.gnu.org, eg642616@HIDDEN, juri@HIDDEN
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: Michael Heerdegen <michael_heerdegen@HIDDEN>
> Cc: Juri Linkov <juri@HIDDEN>,  77224 <at> debbugs.gnu.org,  eg642616@HIDDEN
> Date: Fri, 28 Mar 2025 01:51:03 +0100
> 
> If we can't use other hooks, are there other alternatives?  Variable
> watchers have been mentioned - would using those be possible?

Yes, if some change should be triggered by a variable, we can use
variable watchers.  IMO, it would be better than either the idle timer
or post-command-hook.





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

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


Received: (at 77224) by debbugs.gnu.org; 28 Mar 2025 07:32:38 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Mar 28 03:32:37 2025
Received: from localhost ([127.0.0.1]:52620 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ty4Cj-0002KN-Ge
	for submit <at> debbugs.gnu.org; Fri, 28 Mar 2025 03:32:37 -0400
Received: from relay4-d.mail.gandi.net ([2001:4b98:dc4:8::224]:50815)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <juri@HIDDEN>) id 1ty4Ch-0002Js-OT
 for 77224 <at> debbugs.gnu.org; Fri, 28 Mar 2025 03:32:36 -0400
Received: by mail.gandi.net (Postfix) with ESMTPSA id DECF2433EC;
 Fri, 28 Mar 2025 07:32:25 +0000 (UTC)
From: Juri Linkov <juri@HIDDEN>
To: Elijah Gabe =?iso-8859-1?Q?P=E9rez?= <eg642616@HIDDEN>
Subject: Re: bug#77224: [PATCH] New minor mode 'cursor-indicators-mode'
In-Reply-To: <87a595tyzt.fsf@HIDDEN>
Organization: LINKOV.NET
References: <87iknzxski.fsf@HIDDEN> <87o6xq6fud.fsf@HIDDEN>
 <875xjymh93.fsf@HIDDEN> <87ikny2rio.fsf@HIDDEN>
 <86o6xpe2cx.fsf@HIDDEN> <87o6xobdcc.fsf@HIDDEN>
 <875xjwyzvt.fsf@HIDDEN> <8634f0dkhq.fsf@HIDDEN>
 <875xjvcn4o.fsf@HIDDEN> <877c4b81nk.fsf@HIDDEN>
 <86ecyidg2d.fsf@HIDDEN> <87h63ekdxe.fsf@HIDDEN>
 <86cye2d8t6.fsf@HIDDEN> <87a596a29y.fsf@HIDDEN>
 <86tt7ebfnc.fsf@HIDDEN>
 <44319BF5-31B5-4ECD-95AB-591A216D0072@HIDDEN>
 <87a595tyzt.fsf@HIDDEN>
Date: Fri, 28 Mar 2025 09:30:03 +0200
Message-ID: <87msd5r4z8.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/31.0.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain
X-GND-State: clean
X-GND-Score: -100
X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgddujedtieelucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuifetpfffkfdpucggtfgfnhhsuhgsshgtrhhisggvnecuuegrihhlohhuthemuceftddunecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvfevufgjohhffffkfgggtgesthdtredttdertdenucfhrhhomheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqeenucggtffrrghtthgvrhhnpeffgeetfeevlefhleejfeeuheeiudeitdffhfdutdekfeffgffhveehteegueekheenucfkphepledurdduvdelrddutdehrdduudejnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepledurdduvdelrddutdehrdduudejpdhhvghlohepmhgrihhlrdhgrghnughirdhnvghtpdhmrghilhhfrhhomhepjhhurhhisehlihhnkhhovhdrnhgvthdpnhgspghrtghpthhtohephedprhgtphhtthhopehmrghilhesuggrnhhivghlqdhmvghnughlvghrrdguvgdprhgtphhtthhopegvlhhiiiesghhnuhdrohhrghdprhgtphhtthhopeejjedvvdegseguvggssghughhsrdhgnhhurdhorhhgpdhrtghpthhtohepuggrnhgtohhlsegurghntgholhdrohhrghdprhgtphhtthhopegvgheigedvieduieesghhmrghilhdrtghomh
X-GND-Sasl: juri@HIDDEN
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 77224
Cc: 77224 <at> debbugs.gnu.org, eliz@HIDDEN, Daniel Colascione <dancol@HIDDEN>,
 mail@HIDDEN
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 (-)

> I've updated the patch which should use the mode hook instead using
> post-command-hook or idle timers (and allows (implicitly) to user use
> post-command-hook (but that is user responsibility add it or not)).
>
> Also this should refresh the cursor while switching windows.
>
> However I've deleted the function/lambdas support as conditions because
> i found it problematic.
>
> I've test it only for overwrite-mode, I ask if anyone wants to give it a
> try.

Please note that this is insufficient for 'repeat-mode'.
Currently it requires adding an advice to update the cursor
on the repeat timer events:

  (add-function :after repeat-echo-function #'cursor-indicators--update-indications)

since need to update the cursor when the timer is fired:

  (run-with-idle-timer timeout nil #'repeat-exit)
  (defun repeat-exit ()
    (setq repeat-in-progress nil)
    (funcall repeat-echo-function nil))

This problem can be solved by adding a hook:

  (defun repeat-exit ()
    (setq repeat-in-progress nil)
    (funcall repeat-echo-function nil)
    (run-hooks 'repeat-exit-hook))

Then 'cursor-indicators-mode' needs to add this hook:

  (define-minor-mode cursor-indicators-mode
    ...
    (add-hook 'repeat-exit-hook #'cursor-indicators--update-indications)

Then maybe it's possible to add more hooks for other features as well.

The drawback of this approach is that specific hooks make the cursor updating
less reliable than with using post-command-hook.




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

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


Received: (at 77224) by debbugs.gnu.org; 28 Mar 2025 07:32:37 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Mar 28 03:32:37 2025
Received: from localhost ([127.0.0.1]:52618 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ty4Cj-0002KI-6e
	for submit <at> debbugs.gnu.org; Fri, 28 Mar 2025 03:32:37 -0400
Received: from relay1-d.mail.gandi.net ([217.70.183.193]:46043)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <juri@HIDDEN>) id 1ty4Cb-0002JY-Qt
 for 77224 <at> debbugs.gnu.org; Fri, 28 Mar 2025 03:32:30 -0400
Received: by mail.gandi.net (Postfix) with ESMTPSA id 8B7B344351;
 Fri, 28 Mar 2025 07:32:21 +0000 (UTC)
From: Juri Linkov <juri@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#77224: [PATCH] New minor mode 'cursor-indicators-mode'
In-Reply-To: <86bjtlbqge.fsf@HIDDEN>
Organization: LINKOV.NET
References: <87iknzxski.fsf@HIDDEN> <87o6xq6fud.fsf@HIDDEN>
 <875xjymh93.fsf@HIDDEN> <87ikny2rio.fsf@HIDDEN>
 <86o6xpe2cx.fsf@HIDDEN> <87o6xobdcc.fsf@HIDDEN>
 <875xjwyzvt.fsf@HIDDEN> <8634f0dkhq.fsf@HIDDEN>
 <875xjvcn4o.fsf@HIDDEN> <877c4b81nk.fsf@HIDDEN>
 <86ecyidg2d.fsf@HIDDEN> <87h63ekdxe.fsf@HIDDEN>
 <86cye2d8t6.fsf@HIDDEN> <87a596a29y.fsf@HIDDEN>
 <86tt7ebfnc.fsf@HIDDEN> <877c4aa0m8.fsf@HIDDEN>
 <86pli2befe.fsf@HIDDEN> <878qoq5iui.fsf@HIDDEN>
 <86bjtlbqge.fsf@HIDDEN>
Date: Fri, 28 Mar 2025 09:25:02 +0200
Message-ID: <874izdsjop.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/31.0.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain
X-GND-State: clean
X-GND-Score: -100
X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgddujedtjedtucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuifetpfffkfdpucggtfgfnhhsuhgsshgtrhhisggvnecuuegrihhlohhuthemuceftddunecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvfevufgjohhffffkfgggtgesthdtredttdertdenucfhrhhomheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqeenucggtffrrghtthgvrhhnpeffgeetfeevlefhleejfeeuheeiudeitdffhfdutdekfeffgffhveehteegueekheenucfkphepledurdduvdelrddutdehrdduudejnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepledurdduvdelrddutdehrdduudejpdhhvghlohepmhgrihhlrdhgrghnughirdhnvghtpdhmrghilhhfrhhomhepjhhurhhisehlihhnkhhovhdrnhgvthdpnhgspghrtghpthhtohepgedprhgtphhtthhopeejjedvvdegseguvggssghughhsrdhgnhhurdhorhhgpdhrtghpthhtohepvghgieegvdeiudeisehgmhgrihhlrdgtohhmpdhrtghpthhtohepmhgrihhlsegurghnihgvlhdqmhgvnhgulhgvrhdruggvpdhrtghpthhtohepvghlihiisehgnhhurdhorhhg
X-GND-Sasl: juri@HIDDEN
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 77224
Cc: Daniel Mendler <mail@HIDDEN>, eg642616@HIDDEN,
 77224 <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.7 (-)

> How long is the post-command-hook list in your production sessions?
> Should we poll users to give their data?

I use very many Emacs features, but my post-command-hook is just

  (repeat-post-hook my-change-cursor)




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

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


Received: (at 77224) by debbugs.gnu.org; 28 Mar 2025 07:18:09 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Mar 28 03:18:09 2025
Received: from localhost ([127.0.0.1]:52579 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ty3yi-0001Xn-K2
	for submit <at> debbugs.gnu.org; Fri, 28 Mar 2025 03:18:08 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:37390)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1ty3yg-0001XN-IT
 for 77224 <at> debbugs.gnu.org; Fri, 28 Mar 2025 03:18:07 -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 1ty3yZ-0000iP-Rn; Fri, 28 Mar 2025 03:17:59 -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=9XKdFaS5q0O+JFHNpzuePCCGtVkPwJndkt9GcEOBSKU=; b=BnAgms6t9oyR
 M+OSuNecRJwrpcizkVqWqhbAAD6lT1oHGtsMS2ox/24QNpglTH4PMvYCl7FG9WED9imcLix4UH6hq
 1E7eMRwCUAvZhXsd08AE+v9NcFSTuDlRXj5UdJBynR9o5sYgLztsahrxukOefzt0IsfVbkH2d/VVW
 QgrpiKkRkw61rVqkEuf3R2nqdarbE0tggPToiDOAkNAJxLNkZMfK0VwPetaNnlUA7c6Xgl/LL6lPo
 LHIKxEbAcLw7kwckjuiz6kvNq6mUYQoStQQPeN1FNImxZnvc2r5cDm8ppuX0iGczMmE9wXKfKOq9l
 5VqPCMFR6H3eVkLL6OtNWQ==;
Date: Fri, 28 Mar 2025 10:17:51 +0300
Message-Id: <868qopbp40.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Daniel Colascione <dancol@HIDDEN>
In-Reply-To: <44319BF5-31B5-4ECD-95AB-591A216D0072@HIDDEN> (message from
 Daniel Colascione on Thu, 27 Mar 2025 16:41:39 -0400)
Subject: Re: bug#77224: [PATCH] New minor mode 'cursor-indicators-mode'
References: <87iknzxski.fsf@HIDDEN> <87o6xq6fud.fsf@HIDDEN>
 <875xjymh93.fsf@HIDDEN> <87ikny2rio.fsf@HIDDEN>
 <86o6xpe2cx.fsf@HIDDEN> <87o6xobdcc.fsf@HIDDEN>
 <875xjwyzvt.fsf@HIDDEN> <8634f0dkhq.fsf@HIDDEN>
 <875xjvcn4o.fsf@HIDDEN> <877c4b81nk.fsf@HIDDEN>
 <86ecyidg2d.fsf@HIDDEN> <87h63ekdxe.fsf@HIDDEN>
 <86cye2d8t6.fsf@HIDDEN> <87a596a29y.fsf@HIDDEN>
 <86tt7ebfnc.fsf@HIDDEN> <44319BF5-31B5-4ECD-95AB-591A216D0072@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 77224
Cc: mail@HIDDEN, eg642616@HIDDEN, juri@HIDDEN,
 77224 <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 (---)

> Date: Thu, 27 Mar 2025 16:41:39 -0400
> From: Daniel Colascione <dancol@HIDDEN>
> CC: 77224 <at> debbugs.gnu.org, eg642616@HIDDEN, juri@HIDDEN
> 
> >> Regarding Emacs sluggishness, the `cursor-indicators-mode' is an
> >> optional mode. If it increases sluggishness unnacceptably (which it
> >> won't), users can turn it off.
> >
> >Experience shows that many users turn on a lot of features which rely
> >on post-command-hook, and then complain that Emacs is slow to respond.
> >Telling them to turn off features they like doesn't really work.
> 
> Nor does telling external package authors not to use post-command-hook.

Well, I could at least try ;-)  Who knows, some of them might even
listen...

> I think there are two worthwhile approaches: 1) time the entries in post-command-hook and alert users about slow ones, and 2) provide a "do something when X, Y, or Z changes" API that authors could use when they would otherwise put something on PCH and check X, Y, and Z internally. Internally, we could DTRT and omit running those hooks when the relevant conditions haven't changed.

I'd be okay with developing 1), I think it's a good feature, given the
proliferation of features that use this hook.

As for 2), I think we already have that: add-variable-watcher.  We
already use this for a small number of features.  Does that fit the
bill?




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

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


Received: (at 77224) by debbugs.gnu.org; 28 Mar 2025 07:07:15 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Mar 28 03:07:15 2025
Received: from localhost ([127.0.0.1]:52557 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ty3oA-00011g-TR
	for submit <at> debbugs.gnu.org; Fri, 28 Mar 2025 03:07:15 -0400
Received: from mail-oa1-x43.google.com ([2001:4860:4864:20::43]:61564)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <eg642616@HIDDEN>)
 id 1ty3o6-00011D-Ef
 for 77224 <at> debbugs.gnu.org; Fri, 28 Mar 2025 03:07:13 -0400
Received: by mail-oa1-x43.google.com with SMTP id
 586e51a60fabf-2a01bcd0143so2054297fac.2
 for <77224 <at> debbugs.gnu.org>; Fri, 28 Mar 2025 00:07:10 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1743145625; x=1743750425; darn=debbugs.gnu.org;
 h=mime-version:user-agent:message-id:date:references:in-reply-to
 :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to;
 bh=KB3aacvJLrgHpwY6nUAQOXnQQYG5+QbRK8mJGbrv5B4=;
 b=j+tcKmlVmXqeCxK0d4UNfkDVNeHRPnJk38bw3vpE+EYcVBbDsyPsU9733wtdiCTP2w
 U47b24+Lq4J2G6pOHACNBayIEigUYNyF98Cg7Gl/kGr0LKVu128GJFLwvxId/3J7JWcx
 FAGuK+2qWC1cf9EX+J41PKGfhBZsFK1FxFqGxnj+1qvOCNiOLWLcAUCxTxfhIMJxxp5y
 88Mch9+7pVEQKfgPjWLyfo21freDXyJsJ+mk1g1KcmgryQ+lwzfqjZ2FOGJVhbYW3zeg
 meNdxe5vUQWr04jFN6CdVNgqhsg7OG/GhSZ3gfF2j67ZUd34DB/yIh6s3RU/YTOfBmAj
 OLIg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1743145625; x=1743750425;
 h=mime-version:user-agent:message-id:date:references:in-reply-to
 :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date
 :message-id:reply-to;
 bh=KB3aacvJLrgHpwY6nUAQOXnQQYG5+QbRK8mJGbrv5B4=;
 b=GDJNY2LsuRf7o4LrpMWg276zSHFf3rbfPZOP/RmhJ9uSs8ivoug6hqHIs4iX2pmCPm
 /Q1eYSYLSOzuVtc5AG42EBEZiwSC20tWe982frsdyBYa7kDIHvzt6auHadpiX9aCC7jb
 zWGVCXNmiaRBhWCKmhvu7seDtsI58F4Al53N0uYFS+GN3LioMGkCVrNqQzVMawRiOg3S
 mbhCvhtpBtPwO8wPr+q8tnW41B3WxWvhn5Eoi+v/YQZf8fj3RhX8HmxfuJMF9xLKTXIA
 T5I6kSv7xL7zqHhIB6VswLO9GpC9PrymqNluF5EMJwXdfHrWhNwnTMVtl85UAcLxZNMR
 qQTw==
X-Gm-Message-State: AOJu0YwqqubFPc2x8WZK5njBIwwskiF/a7ChIMGat9dgy7UIAUd9a7BO
 fnrwV0y9CUlW15m7qc6ubYaNliUVXmPfuc6+3WkZlBs/tJlzveOU
X-Gm-Gg: ASbGncsoXxVE1OxAzmddzDAM8IzikQtxTfzgFgOwJnL69Kqp+xJb0wtnDe4C207UFdM
 ZVo99qNl9/SikYcQ1CEa267o1wh+qBEZatvM7xItB2JLvEFxFYNkD/q/jUYod1Epc5I27UWA6LW
 Y0sDLmcWa5+budWtcD76xHOltV4iv33bRtLJrutJ0kyG3wOz/0+Q4ElgQe4fenNRkcOzVYpEWly
 pmhjlYxV4hr6qk5KBkTWCoycsN09NWzWywSSgZSPd6ZtbikUFZ+VsH3IbBfNsTvAjcjN3tO4Thj
 37FIwOmrQLLm
X-Google-Smtp-Source: AGHT+IH2QqZZjr3YNgEPEinE884lzBL6vjaK0m9AGFFYhE7n9pso20rUHnt3B8x3qgwPLJNV0YeCKQ==
X-Received: by 2002:a05:6871:1cc:b0:2a3:d9b3:3d01 with SMTP id
 586e51a60fabf-2c8481de2d5mr4653294fac.29.1743145624451; 
 Fri, 28 Mar 2025 00:07:04 -0700 (PDT)
Received: from fedora ([2806:10ae:e:5fce::1]) by smtp.gmail.com with ESMTPSA id
 586e51a60fabf-2c86a855d21sm307927fac.34.2025.03.28.00.07.03
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 28 Mar 2025 00:07:03 -0700 (PDT)
From: =?utf-8?Q?Elijah_Gabe_P=C3=A9rez?= <eg642616@HIDDEN>
To: Daniel Colascione <dancol@HIDDEN>
Subject: Re: bug#77224: [PATCH] New minor mode 'cursor-indicators-mode'
In-Reply-To: <44319BF5-31B5-4ECD-95AB-591A216D0072@HIDDEN>
References: <87iknzxski.fsf@HIDDEN> <87o6xq6fud.fsf@HIDDEN>
 <875xjymh93.fsf@HIDDEN> <87ikny2rio.fsf@HIDDEN>
 <86o6xpe2cx.fsf@HIDDEN> <87o6xobdcc.fsf@HIDDEN>
 <875xjwyzvt.fsf@HIDDEN> <8634f0dkhq.fsf@HIDDEN>
 <875xjvcn4o.fsf@HIDDEN> <877c4b81nk.fsf@HIDDEN>
 <86ecyidg2d.fsf@HIDDEN> <87h63ekdxe.fsf@HIDDEN>
 <86cye2d8t6.fsf@HIDDEN> <87a596a29y.fsf@HIDDEN>
 <86tt7ebfnc.fsf@HIDDEN>
 <44319BF5-31B5-4ECD-95AB-591A216D0072@HIDDEN>
Date: Fri, 28 Mar 2025 01:07:02 -0600
Message-ID: <87a595tyzt.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/31.0.50
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-Spam-Score: 0.3 (/)
X-Debbugs-Envelope-To: 77224
Cc: 77224 <at> debbugs.gnu.org, eliz@HIDDEN, juri@HIDDEN,
 mail@HIDDEN
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.7 (/)

--=-=-=
Content-Type: multipart/alternative; boundary="==-=-="

--==-=-=
Content-Type: text/plain

Daniel Colascione <dancol@HIDDEN> writes:
>>Anyway, I think making the cursor change from a mode hook is a better
>>solution.

I've updated the patch which should use the mode hook instead using
=post-command-hook= or idle timers (and allows (implicitly) to user use
post-command-hook (but that is user responsibility add it or not)).

Also this should refresh the cursor while switching windows.

However I've deleted the function/lambdas support as conditions because
i found it problematic.

I've test it only for overwrite-mode, I ask if anyone wants to give it a try.




--==-=-=
Content-Type: text/html

<p>
Daniel Colascione &lt;dancol@HIDDEN&gt; writes:<br />
<blockquote class="gmail_quote" style="border-left:#5555EE solid 0.2em;margin: 0em;padding-left: 0.85em;font-family: monospace;unicode-bidi: isolate;display: box;">

<div><blockquote class="gmail_quote" style="border-left:#5555EE solid 0.2em;margin: 0em;padding-left: 0.85em;font-family: monospace;unicode-bidi: isolate;display: box;">

<div>Anyway, I think making the cursor change from a mode hook is a better<br />
solution.<br />

</div></blockquote>

</div></blockquote>
</p>

<p>
I've updated the patch which should use the mode hook instead using<br />
<code>post-command-hook</code> or idle timers (and allows (implicitly) to user use<br />
post-command-hook (but that is user responsibility add it or not)).<br />
</p>

<p>
Also this should refresh the cursor while switching windows.<br />
</p>

<p>
However I've deleted the function/lambdas support as conditions because<br />
i found it problematic.<br />
</p>

<p>
I've test it only for overwrite-mode, I ask if anyone wants to give it a try.<br />
</p>

--==-=-=--

--=-=-=
Content-Type: text/x-patch; charset=utf-8
Content-Disposition: attachment;
 filename=0001-New-package-cursor-indicators-mode-Bug-77224.patch
Content-Transfer-Encoding: quoted-printable

From 275d3ca5fcea03890e422b845477735f3c30d9ad Mon Sep 17 00:00:00 2001
From: =3D?UTF-8?q?El=3DC3=3DADas=3D20Gabriel=3D20P=3DC3=3DA9rez?=3D <eg6426=
16@HIDDEN>
Date: Sat, 22 Mar 2025 22:56:01 -0600
Subject: [PATCH] New package 'cursor-indicators-mode' (Bug#77224)

This minor mode changes the cursor appearance to indicate
buffers states, such as if overwrite-mode is active or current
buffer is read-only.
Acts similar to 'cua-enable-cursor-indications'
* etc/NEWS: Document new package.
* lisp/cursor-indicators.el: New file.
---
 etc/NEWS                  |  10 +++
 lisp/cursor-indicators.el | 164 ++++++++++++++++++++++++++++++++++++++
 2 files changed, 174 insertions(+)
 create mode 100644 lisp/cursor-indicators.el

diff --git a/etc/NEWS b/etc/NEWS
index cc63d03eafe..2745d467722 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -1566,6 +1566,16 @@ This user option replaces 'follow-mode-prefix', whic=
h had to be set
 before loading Follow mode.  This new option allows you to change the
 prefix even after it was loaded, using 'customize-option' or 'setopt'.
=20
+---
+*** New package 'cursor-indicators-mode'
+This provides a new minor mode, 'cursor-indicators-mode'.
+This mode changes cursor appearance (color and/or type) to indicate
+different buffer states according to 'cursor-indicators-conditions'.
+The mode have cursor indicators out the box for:
+- Overwrite mode
+- Read-only buffers
+- Input method activation
+
 ---
 *** cdl.el is now obsolete.
 Use 'shell-command' and 'shell-command-on-region' instead.
diff --git a/lisp/cursor-indicators.el b/lisp/cursor-indicators.el
new file mode 100644
index 00000000000..c97e6d0748a
--- /dev/null
+++ b/lisp/cursor-indicators.el
@@ -0,0 +1,164 @@
+;;; cursor-indicators.el --- Cursor indicators for some states  -*- lexica=
l-binding: t; -*-
+
+;; Copyright (C) 2025 Free Software Foundation, Inc.
+
+;; Version: 1.0.0
+;; Author: El=C3=ADas Gabriel P=C3=A9rez <eg642616@HIDDEN>
+;; Package-Requires: ((emacs "26.1") (compat "30"))
+
+;; This program is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; This program is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with this program.  If not, see <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+;; This package allows changes cursor appearance (color and/or type) to
+;; indicate different buffer states such as if current buffer is
+;; read-only or if overwrite mode is currently active.
+;;
+;; Usage:
+;; For use this mode enable: cursor-indicators-mode.
+;; By default it will set cursor color if overwrite mode is currently
+;; active, if buffer is read-only or if input method is active.
+;;
+;; To change this behavior customize `cursor-indicators-conditions'.
+;; For example, change cursor type to bar when there is a region active:
+;; (setopt cursor-indicators-conditions '((use-region-p . bar)))
+;; Or change both cursor color and type when current buffer have a
+;; specific name:
+;; (setopt cursor-indicators-conditions `((,(lambda () (string-prefix-p " =
*" (buffer-name)))
+;;                                         hollow "yellow")))
+
+;;; Code:
+(require 'compat)
+
+;;; User options
+
+(defcustom cursor-indicators
+  '((overwrite-mode-hook overwrite-mode "red")
+    (read-only-mode-hook buffer-read-only "green")
+    (input-method-activate-hook current-input-method "blue")
+    (input-method-deactivate-hook current-input-method "blue"))
+  "Alist of conditions to which cursor should change its appearence.
+Only used when `cursor-indicators-mode' is enabled.
+
+Each element is an alist entry in one of these forms:
+  (HOOK CONDITION COLOR)     Change cursor color
+  (HOOK CONDITION TYPE)      Change cursor type
+  (HOOK CONDITION TYPE COLOR)  Change cursor color and type
+
+HOOK must be a hook where conditions will be trigger.
+CONDITION must be a variable that must return non-nil.
+COLOR is a string specifying the cursor color.
+TYPE specifies cursor type.
+
+Valid cursor types are:
+  `box'    - Filled box
+  `bar'    - Vertical bar
+  `hbar'   - Horizontal bar
+  `hollow' - Hollow box
+
+Each element in this alist takes predominance according to its order.
+
+If none of the conditions return non-nil, the cursor will use default
+cursor type and color."
+  :group 'cursor
+  :version "31.1"
+  :type '(alist :key-type
+                (variable :tag "Hook")
+                :value-type
+                (group
+                 (choice :tag "Condition"
+                         (const :tag "Overwrite mode" overwrite-mode)
+                         (const :tag "Read-only mode" buffer-read-only)
+                         (const :tag "Repeat mode" repeat-in-progress)
+                         (const :tag "Activated input method" current-inpu=
t-method)
+                         ;; User-defined conditions
+                         (function :tag "Variable")
+                         (variable :tag "Function"))
+                 (choice
+                  (color :tag "Color")
+                  (choice :tag "Type"
+                          (const :tag "Filled box" box)
+                          (const :tag "Vertical bar" bar)
+                          (const :tag "Horizontal bar" hbar)
+                          (const :tag "Hollow box" hollow))
+                  (group :tag "Color and Type"
+                         (choice :tag "Type"
+                                 (const :tag "Filled box" box)
+                                 (const :tag "Vertical bar" bar)
+                                 (const :tag "Horizontal bar" hbar)
+                                 (const :tag "Hollow box" hollow))
+                         (color :tag "Color"))))))
+
+;;; Internal Code
+
+(defvar cursor-indicators--default-cursor-color (frame-parameter nil 'curs=
or-color))
+
+(defun cursor-indicators--change-cursor ()
+  "Helper function to `cursor-indicators--update-indications'."
+  ;; Check if KEY is non-nil
+  (dolist (el cursor-indicators)
+    (let ((con (nth 1 el))
+          (type-or-color (nth 2 el))
+          (color (nth 3 el)))
+      (when (and (symbolp con) (boundp con) (symbol-value con))
+        (cond
+         ;; Set cursor color
+         ((and (stringp type-or-color) (not (equal type-or-color (frame-pa=
rameter nil 'cursor-color))))
+          (set-cursor-color type-or-color)
+          (setq-local cursor-type (default-value 'cursor-type))) ; Set to =
default cursor type
+         ;; Set cursor type
+         ((and (symbolp type-or-color) (not (eq type-or-color (default-val=
ue 'cursor-type))))
+          (setq-local cursor-type type-or-color)
+          (set-cursor-color cursor-indicators--default-cursor-color)) ; Se=
t to default cursor color
+         ;; Set cursor color and type
+         (color
+          (when (and (symbolp type-or-color) (not (eq type-or-color (defau=
lt-value 'cursor-type)))
+                     (stringp color) (not (equal color (frame-parameter ni=
l 'cursor-color))))
+            (set-cursor-color color)
+            (setq-local cursor-type type-or-color))))
+        ;; And exit from loop.
+        (throw 'c-i-exit t)))))
+
+(defun cursor-indicators--update-indications (&rest _)
+  ;; C-I-EXIT is used here for exit from loop.
+  (when (and cursor-type
+             (not (catch 'c-i-exit (cursor-indicators--change-cursor))))
+    (setq-local cursor-type (default-value 'cursor-type))
+    (set-cursor-color cursor-indicators--default-cursor-color)))
+
+;;;###autoload
+(define-minor-mode cursor-indicators-mode
+  "Change cursor type and/or face for indications.
+When enabled, this mode changes the cursor appearance to indicate
+different buffer states."
+  :group 'cursor
+  :version "31.1"
+  :global t
+  (if cursor-indicators-mode
+      (progn
+        (add-hook 'after-change-major-mode-hook #'cursor-indicators--updat=
e-indications)
+        (add-hook 'window-selection-change-functions #'cursor-indicators--=
update-indications)
+        ;; Set indicators hooks
+        (dolist (key cursor-indicators)
+          (let ((hook (car key)))
+            (add-hook hook #'cursor-indicators--update-indications 100 t))=
))
+    ;; Remove all hooks done
+    (remove-hook 'after-change-major-mode-hook #'cursor-indicators--update=
-indications)
+    (remove-hook 'window-selection-change-functions #'cursor-indicators--u=
pdate-indications)
+    (dolist (el cursor-indicators)
+      (remove-hook (car el) #'cursor-indicators--update-indications))
+    (set-cursor-color cursor-indicators--default-cursor-color)
+    (setq-local cursor-type (default-value 'cursor-type))))
+
+(provide 'cursor-indicators)
+;;; cursor-indicators.el ends here
--=20
2.49.0


--=-=-=
Content-Type: text/plain


-- 
                                          - E.G via GNU Emacs and Org.

--=-=-=--




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

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


Received: (at 77224) by debbugs.gnu.org; 28 Mar 2025 06:49:07 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Mar 28 02:49:07 2025
Received: from localhost ([127.0.0.1]:52535 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ty3Wc-00005T-Hs
	for submit <at> debbugs.gnu.org; Fri, 28 Mar 2025 02:49:07 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:34402)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1ty3WW-00004r-So
 for 77224 <at> debbugs.gnu.org; Fri, 28 Mar 2025 02:49:04 -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 1ty3WP-0004dB-Mx; Fri, 28 Mar 2025 02:48:53 -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=Qy0bSPaDOR/FadewCm5OWfV0F+OECa8d0HAchJZjgVM=; b=GA3q9KiLyptc
 01fOOFqwynJUYoz8V3UUjlspmDsI6P71VH75cOlcZTlKOs00zmeTK5kSnw5PBOOkP3q0lA2KbLC7v
 GwwuLuXW8b+OtIeB1HnbbTc9vsl5ATLVXrcf4Opu608JOuzU3dHVAWWu2OGZZwS9QTtLACfay34lH
 E+pjnmQg6lXmM+iCEmFEuUVUSTn5MTri8qyF6QSPO48jjr9g1y8WeldTRRVNtoi8n65rfX3AkKpCX
 5gcXL1nFZdn7kIGY6PDwraWEL7yGWq2QnTKl7Fe5lV9RCOAQ5XSTgubNykqWNCA+g8gUN/+/uu08F
 mCkQqXeMnjCIz/w0/9knKw==;
Date: Fri, 28 Mar 2025 09:48:49 +0300
Message-Id: <86bjtlbqge.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Daniel Mendler <mail@HIDDEN>
In-Reply-To: <878qoq5iui.fsf@HIDDEN> (message from Daniel Mendler
 on Thu, 27 Mar 2025 21:17:25 +0100)
Subject: Re: bug#77224: [PATCH] New minor mode 'cursor-indicators-mode'
References: <87iknzxski.fsf@HIDDEN> <87o6xq6fud.fsf@HIDDEN>
 <875xjymh93.fsf@HIDDEN> <87ikny2rio.fsf@HIDDEN>
 <86o6xpe2cx.fsf@HIDDEN> <87o6xobdcc.fsf@HIDDEN>
 <875xjwyzvt.fsf@HIDDEN> <8634f0dkhq.fsf@HIDDEN>
 <875xjvcn4o.fsf@HIDDEN> <877c4b81nk.fsf@HIDDEN>
 <86ecyidg2d.fsf@HIDDEN> <87h63ekdxe.fsf@HIDDEN>
 <86cye2d8t6.fsf@HIDDEN> <87a596a29y.fsf@HIDDEN>
 <86tt7ebfnc.fsf@HIDDEN> <877c4aa0m8.fsf@HIDDEN>
 <86pli2befe.fsf@HIDDEN> <878qoq5iui.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 77224
Cc: 77224 <at> debbugs.gnu.org, eg642616@HIDDEN, juri@HIDDEN
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: Daniel Mendler <mail@HIDDEN>
> Cc: eg642616@HIDDEN,  77224 <at> debbugs.gnu.org,  juri@HIDDEN
> Date: Thu, 27 Mar 2025 21:17:25 +0100
> 
> Here we discuss changing only the color of the cursor, a much much less
> complex operation.

My point is that when the list on post-command-hook is long, it takes
Emacs time to process all the functions on the list, and the longer
the list, the less responsive Emacs will be.  These small
insignificant delays add up.

How long is the post-command-hook list in your production sessions?
Should we poll users to give their data?  Just yesterday someone
complained on Reddit that Emacs is too slow, and I have no doubt that
features that use post-command-hook are at least part of the reason if
not _the_ reason.

So I maintain that we should try to avoid post-command-hook for
operations that should happen very rarely (this case is one such case:
we only want to run this code when something is turned on or off).
Even if the reaction to the change is a bit slower, it is worth our
while to pay that price: users will be a tad happier with Emacs
response times.  And if there are alternative methods of doing the
same, like the respective mode hooks in this case, we should use them
without thinking twice.  Ideally, post-command-hook should only be
used for stuff that really must be done after almost every command;
for any other cases we should look for other Emacs features to do the
job.

Emacs is a very old program, and if we do it right, it will live a
long time since.  We should realize the long-run effects of (ab)using
stuff like post-command-hook, and try to imagine how much more stuff
will be accrued in post-command-hook 40 years hence if we lower our
guards in this regard.

But I repeat myself.




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

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


Received: (at 77224) by debbugs.gnu.org; 28 Mar 2025 00:49:42 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Mar 27 20:49:42 2025
Received: from localhost ([127.0.0.1]:51963 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1txxuo-0008Dq-EA
	for submit <at> debbugs.gnu.org; Thu, 27 Mar 2025 20:49:42 -0400
Received: from mout.web.de ([212.227.17.11]:42629)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <michael_heerdegen@HIDDEN>)
 id 1txxul-0008DZ-7O
 for 77224 <at> debbugs.gnu.org; Thu, 27 Mar 2025 20:49:40 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=web.de;
 s=s29768273; t=1743122972; x=1743727772;
 i=michael_heerdegen@HIDDEN;
 bh=UIDQm8GgVpragslBQILHtHA5rHzSQkEshzpfPzrP2F4=;
 h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date:
 Message-ID:MIME-Version:Content-Type:cc:content-transfer-encoding:
 content-type:date:from:message-id:mime-version:reply-to:subject:
 to;
 b=mbqlrWoyUMxymzzMKe6JrtDK6OcPJl8UZkBE0cfhSHQ7JWmLaOTatTwan87dZgCB
 GjdI7tw5PjWnbDNyDwwm/OefXbn5+sSFkoD8F0TJAxwCmeNxJbjD7KbBL2+zOc/ja
 jfepkd80hRIhbQltSjuqoB1HJ7ZkWdSaz7Nh8BJdlQX+JVOCuuwpGGC8ERr3UKNAM
 HtgtFcGXBypfpoqWy3kwQ0kGnRkOw2gAZF+GWVRVxLuKZycORxXuVuCFJemfZuAzR
 mtkMdOjYNjovhFt4SJVpnnE1tJa5wveB9H5/5oV64M7DyhZB++TFBFuuM1jod7kRm
 Q9xBinfgTRkXnWAxbw==
X-UI-Sender-Class: 814a7b36-bfc1-4dae-8640-3722d8ec6cd6
Received: from drachen.dragon ([88.66.201.136]) by smtp.web.de (mrweb106
 [213.165.67.124]) with ESMTPSA (Nemesis) id 1MTOli-1tYZqC35A4-00U4gq; Fri, 28
 Mar 2025 01:49:32 +0100
From: Michael Heerdegen <michael_heerdegen@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#77224: [PATCH] New minor mode 'cursor-indicators-mode'
In-Reply-To: <8634f0dkhq.fsf@HIDDEN>
References: <87iknzxski.fsf@HIDDEN> <87o6xq6fud.fsf@HIDDEN>
 <875xjymh93.fsf@HIDDEN> <87ikny2rio.fsf@HIDDEN>
 <86o6xpe2cx.fsf@HIDDEN> <87o6xobdcc.fsf@HIDDEN>
 <875xjwyzvt.fsf@HIDDEN> <8634f0dkhq.fsf@HIDDEN>
Date: Fri, 28 Mar 2025 01:51:03 +0100
Message-ID: <87ldsq7zbc.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-Provags-ID: V03:K1:ElsFRiSRAiq2el/n6kelZXhwsk2Z4opaFHMrhQItPo0dx7A9Tcq
 VMY2euJq0/5eOU6i+yA70dltqPUg4E6GM4fQNTG28T+HLrX7gW3kyxpVV+PbzWEkZRHOZfJ
 FQcWS7bs1IesnKyG9CVsiYSEGaz2CHj0/ZHmHGKQfhqSo/uG0e/u7ni0dV3geVvN2eH8VUq
 IkCN31ClyP5MmauuevGHg==
X-Spam-Flag: NO
UI-OutboundReport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/de7kE7XsiFYORZdPu8xMwWrz
 w3Vv5JwMX3ykkMCQFlXqIG/ZhWlU9g2g4UmCHdmipyP5ZzyEdT9Tl6+UIMQ03l5K1qYt+Bc3m
 0OJMUi8phvRBw8N9B98vUdkvIn+uvpTVycrGji1b9NcIFGWk59Z38MwgmI47OtCBcUP8CYljJ
 RPEMqzmmd4tTAuUQ2AcE8XqHE8R1Tl1/0pDvCoIFagnWg0hNpek0hcyJLPJow/vA6lMQT7OXy
 lqv5TRSALCfERZsNlj9L3QD1JOeB3N49BHcH0KiBtAEzB/JKLtwKb0OC5Xo9TwB88BYMUMlF6
 mWck3E1YhGKMjLXloE5mIcahlnFKr/3Sy/blKARFbRdyRAa7SRGgAa3F1H+5dLJKdf6kj7xGy
 2yjhfsYn1fuR9fQbgKkPsJmSpYARaepzXKiCpqp4Zwar0F8LPJYdfePofBXxZl6yOvug0Ge5h
 vF9S5RyeUt5dJ6L7ilAaYJSYIgsM=
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 77224
Cc: 77224 <at> debbugs.gnu.org, eg642616@HIDDEN, Juri Linkov <juri@HIDDEN>
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.7 (-)

Eli Zaretskii <eliz@HIDDEN> writes:

> Would it be better to use an idle timer instead?  post-command-hook
> tends to make Emacs sluggish.

post-command-hook is the most general, and thus the simplest way to
implement something like this, but not necessarily a good way.  A
solution using such a general tool like post-command-hook also comes
with problems.  What if something adds something to post-command-hook
that changes one of the conditions that should trigger a cursor type
change?  And yes, obviously, the conditions are checked much too often
when using post-command-hook, and yes, people will complain because they
are will add conditions where checking is not that cheap.

Timers are a bit better, but are also far from optimal.

I would really prefer to use other hooks.  If we miss a hook, let's add
those hooks we miss.

Nearly all uses of hooks could be replaced by adding something to
post-command-hook, but the other hooks are there for a reason.  What's
different in this case that justifies this measure here (the question
does not go to Eli, obviously)?

If we can't use other hooks, are there other alternatives?  Variable
watchers have been mentioned - would using those be possible?  Or, could
we at least try to use the buffer local binding of post-command-hook, at
least for conditions that are buffer local anyway?


Michael.




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

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


Received: (at 77224) by debbugs.gnu.org; 27 Mar 2025 20:48:27 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Mar 27 16:48:27 2025
Received: from localhost ([127.0.0.1]:51565 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1txu9K-0001uF-VL
	for submit <at> debbugs.gnu.org; Thu, 27 Mar 2025 16:48:27 -0400
Received: from dancol.org ([2600:3c01:e000:3d8::1]:35044)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <dancol@HIDDEN>) id 1txu9I-0001u5-CR
 for 77224 <at> debbugs.gnu.org; Thu, 27 Mar 2025 16:48:24 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=dancol.org; 
 s=x;
 h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID:
 References:In-Reply-To:Subject:CC:To:From:Date:Sender:Reply-To:Content-ID:
 Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc
 :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe:
 List-Post:List-Owner:List-Archive;
 bh=7W0lMmcYGrq9215poGXmQMBRSfVYhZVbTZOOumdZIO4=; b=oM1iv/qDy2IgSExxwaXfmZK1bG
 g6x3DGNLsLHy4kvHlOaoO9tonJy923iogB34bVC0c0b2kQxAEjAPU0KURUDmcT6qLvuVCtdhlRnU0
 plIDNs3Dkcai1C52LN/rJWZh9a6g68fKdwGyFKxIQl2L2Puzj4g5sUhdYx8bPJoq1KmlQqs/XIPdE
 bg7CN/wVu7ZiFbTcjIp17quqP+XrbCa1e8WQf1UscI4m4+exgsSPu1tWgqZM0WR6dJGqQpid1yMjC
 uzJ7r9f5//NLGTRneqHn5vTt5ZghS/XHdz6HpV0NCU0WzIcWzFK3bkqEx/p8j00GIvi56EBNEtEEG
 DdBPV45w==;
Received: from 2603-9001-4203-1ab2-6547-8c8c-bd19-5cb4.inf6.spectrum.com
 ([2603:9001:4203:1ab2:6547:8c8c:bd19:5cb4]:39814 helo=[IPv6:::1])
 by dancol.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
 (Exim 4.96) (envelope-from <dancol@HIDDEN>) id 1txu8o-004FOx-0d;
 Thu, 27 Mar 2025 16:47:55 -0400
Date: Thu, 27 Mar 2025 16:47:03 -0400
From: Daniel Colascione <dancol@HIDDEN>
To: bug-gnu-emacs@HIDDEN, Eli Zaretskii <eliz@HIDDEN>,
 Daniel Mendler <mail@HIDDEN>
Subject: Re: bug#77224: [PATCH] New minor mode 'cursor-indicators-mode'
User-Agent: K-9 Mail for Android
In-Reply-To: <44319BF5-31B5-4ECD-95AB-591A216D0072@HIDDEN>
References: <87iknzxski.fsf@HIDDEN> <87o6xq6fud.fsf@HIDDEN>
 <875xjymh93.fsf@HIDDEN> <87ikny2rio.fsf@HIDDEN>
 <86o6xpe2cx.fsf@HIDDEN> <87o6xobdcc.fsf@HIDDEN>
 <875xjwyzvt.fsf@HIDDEN> <8634f0dkhq.fsf@HIDDEN>
 <875xjvcn4o.fsf@HIDDEN> <877c4b81nk.fsf@HIDDEN>
 <86ecyidg2d.fsf@HIDDEN> <87h63ekdxe.fsf@HIDDEN>
 <86cye2d8t6.fsf@HIDDEN> <87a596a29y.fsf@HIDDEN>
 <86tt7ebfnc.fsf@HIDDEN> <44319BF5-31B5-4ECD-95AB-591A216D0072@HIDDEN>
Message-ID: <93E6AF16-CA6C-443F-9712-B395E2403F60@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain;
 charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 77224
Cc: 77224 <at> debbugs.gnu.org, eg642616@HIDDEN, juri@HIDDEN
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 (-)



On March 27, 2025 4:41:39 PM EDT, Daniel Colascione <dancol@dancol=2Eorg> =
wrote:
>
>
>On March 27, 2025 12:29:59 PM EDT, Eli Zaretskii <eliz@gnu=2Eorg> wrote:
>>> From: Daniel Mendler <mail@daniel-mendler=2Ede>
>>> Cc: eg642616@gmail=2Ecom,  77224@debbugs=2Egnu=2Eorg,  juri@linkov=2En=
et
>>> Date: Thu, 27 Mar 2025 17:04:09 +0100
>>>=20
>>> Eli Zaretskii <eliz@gnu=2Eorg> writes:
>>>=20
>>> > I disagree that the cursor must change "immediately", in the rigorou=
s
>>> > sense of that word=2E  I think if it changes after 10 or 20 or 50
>>> > milliseconds, that's "immediately" for any practical purpose=2E
>>>=20
>>> No, 50ms are not acceptable for the user if they except an immediate
>>> response to a key press=2E
>>
>>50ms was just an example, and it is actually quite improbable to be
>>that large=2E
>>
>>post-command-hook is run by the same loop that decides that Emacs is
>>idle and runs timers, so the difference in practice should be very
>>small if at all=2E
>>
>>> Regarding Emacs sluggishness, the `cursor-indicators-mode' is an
>>> optional mode=2E If it increases sluggishness unnacceptably (which it
>>> won't), users can turn it off=2E
>>
>>Experience shows that many users turn on a lot of features which rely
>>on post-command-hook, and then complain that Emacs is slow to respond=2E
>>Telling them to turn off features they like doesn't really work=2E
>
>Nor does telling external package authors not to use post-command-hook=2E=
 I think there are two worthwhile approaches: 1) time the entries in post-c=
ommand-hook and alert users about slow ones, and 2) provide a "do something=
 when X, Y, or Z changes" API that authors could use when they would otherw=
ise put something on PCH and check X, Y, and Z internally=2E Internally, we=
 could DTRT and omit running those hooks when the relevant conditions haven=
't changed=2E
>
>For example, instead of putting something buffer and focus dependent in P=
CH or fiddling with buffer and window and frame hooks, you could write some=
thing like
>
>(call-on-change (:buffer :window :focus) #'my-thing)
>
>or something like that=2E
>
>It's not that you can't do the equivalent by manually adding my-thing to =
the appropriate hooks directly, but the convenient one stop syntax might gu=
ide people away from PCH=2E


Also, we'd be able to coalesce and debounce calls to these change function=
s=2E 




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

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


Received: (at submit) by debbugs.gnu.org; 27 Mar 2025 20:48:39 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Mar 27 16:48:39 2025
Received: from localhost ([127.0.0.1]:51568 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1txu9W-0001ug-Hv
	for submit <at> debbugs.gnu.org; Thu, 27 Mar 2025 16:48:39 -0400
Received: from lists.gnu.org ([2001:470:142::17]:56470)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <dancol@HIDDEN>) id 1txu9O-0001uC-Jy
 for submit <at> debbugs.gnu.org; Thu, 27 Mar 2025 16:48:31 -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 <dancol@HIDDEN>) id 1txu9J-0008R1-8H
 for bug-gnu-emacs@HIDDEN; Thu, 27 Mar 2025 16:48:25 -0400
Received: from dancol.org ([2600:3c01:e000:3d8::1])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <dancol@HIDDEN>)
 id 1txu9G-0005yI-Ir; Thu, 27 Mar 2025 16:48:24 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=dancol.org; 
 s=x;
 h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID:
 References:In-Reply-To:Subject:CC:To:From:Date:Sender:Reply-To:Content-ID:
 Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc
 :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe:
 List-Post:List-Owner:List-Archive;
 bh=7W0lMmcYGrq9215poGXmQMBRSfVYhZVbTZOOumdZIO4=; b=oM1iv/qDy2IgSExxwaXfmZK1bG
 g6x3DGNLsLHy4kvHlOaoO9tonJy923iogB34bVC0c0b2kQxAEjAPU0KURUDmcT6qLvuVCtdhlRnU0
 plIDNs3Dkcai1C52LN/rJWZh9a6g68fKdwGyFKxIQl2L2Puzj4g5sUhdYx8bPJoq1KmlQqs/XIPdE
 bg7CN/wVu7ZiFbTcjIp17quqP+XrbCa1e8WQf1UscI4m4+exgsSPu1tWgqZM0WR6dJGqQpid1yMjC
 uzJ7r9f5//NLGTRneqHn5vTt5ZghS/XHdz6HpV0NCU0WzIcWzFK3bkqEx/p8j00GIvi56EBNEtEEG
 DdBPV45w==;
Received: from 2603-9001-4203-1ab2-6547-8c8c-bd19-5cb4.inf6.spectrum.com
 ([2603:9001:4203:1ab2:6547:8c8c:bd19:5cb4]:39814 helo=[IPv6:::1])
 by dancol.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
 (Exim 4.96) (envelope-from <dancol@HIDDEN>) id 1txu8o-004FOx-0d;
 Thu, 27 Mar 2025 16:47:55 -0400
Date: Thu, 27 Mar 2025 16:47:03 -0400
From: Daniel Colascione <dancol@HIDDEN>
To: bug-gnu-emacs@HIDDEN, Eli Zaretskii <eliz@HIDDEN>,
 Daniel Mendler <mail@HIDDEN>
Subject: Re: bug#77224: [PATCH] New minor mode 'cursor-indicators-mode'
User-Agent: K-9 Mail for Android
In-Reply-To: <44319BF5-31B5-4ECD-95AB-591A216D0072@HIDDEN>
References: <87iknzxski.fsf@HIDDEN> <87o6xq6fud.fsf@HIDDEN>
 <875xjymh93.fsf@HIDDEN> <87ikny2rio.fsf@HIDDEN>
 <86o6xpe2cx.fsf@HIDDEN> <87o6xobdcc.fsf@HIDDEN>
 <875xjwyzvt.fsf@HIDDEN> <8634f0dkhq.fsf@HIDDEN>
 <875xjvcn4o.fsf@HIDDEN> <877c4b81nk.fsf@HIDDEN>
 <86ecyidg2d.fsf@HIDDEN> <87h63ekdxe.fsf@HIDDEN>
 <86cye2d8t6.fsf@HIDDEN> <87a596a29y.fsf@HIDDEN>
 <86tt7ebfnc.fsf@HIDDEN> <44319BF5-31B5-4ECD-95AB-591A216D0072@HIDDEN>
Message-ID: <93E6AF16-CA6C-443F-9712-B395E2403F60@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain;
 charset=utf-8
Content-Transfer-Encoding: quoted-printable
Received-SPF: pass client-ip=2600:3c01:e000:3d8::1;
 envelope-from=dancol@HIDDEN; helo=dancol.org
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, SPF_HELO_PASS=-0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: 0.9 (/)
X-Debbugs-Envelope-To: submit
Cc: 77224 <at> debbugs.gnu.org, eg642616@HIDDEN, juri@HIDDEN
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.1 (/)



On March 27, 2025 4:41:39 PM EDT, Daniel Colascione <dancol@dancol=2Eorg> =
wrote:
>
>
>On March 27, 2025 12:29:59 PM EDT, Eli Zaretskii <eliz@gnu=2Eorg> wrote:
>>> From: Daniel Mendler <mail@daniel-mendler=2Ede>
>>> Cc: eg642616@gmail=2Ecom,  77224@debbugs=2Egnu=2Eorg,  juri@linkov=2En=
et
>>> Date: Thu, 27 Mar 2025 17:04:09 +0100
>>>=20
>>> Eli Zaretskii <eliz@gnu=2Eorg> writes:
>>>=20
>>> > I disagree that the cursor must change "immediately", in the rigorou=
s
>>> > sense of that word=2E  I think if it changes after 10 or 20 or 50
>>> > milliseconds, that's "immediately" for any practical purpose=2E
>>>=20
>>> No, 50ms are not acceptable for the user if they except an immediate
>>> response to a key press=2E
>>
>>50ms was just an example, and it is actually quite improbable to be
>>that large=2E
>>
>>post-command-hook is run by the same loop that decides that Emacs is
>>idle and runs timers, so the difference in practice should be very
>>small if at all=2E
>>
>>> Regarding Emacs sluggishness, the `cursor-indicators-mode' is an
>>> optional mode=2E If it increases sluggishness unnacceptably (which it
>>> won't), users can turn it off=2E
>>
>>Experience shows that many users turn on a lot of features which rely
>>on post-command-hook, and then complain that Emacs is slow to respond=2E
>>Telling them to turn off features they like doesn't really work=2E
>
>Nor does telling external package authors not to use post-command-hook=2E=
 I think there are two worthwhile approaches: 1) time the entries in post-c=
ommand-hook and alert users about slow ones, and 2) provide a "do something=
 when X, Y, or Z changes" API that authors could use when they would otherw=
ise put something on PCH and check X, Y, and Z internally=2E Internally, we=
 could DTRT and omit running those hooks when the relevant conditions haven=
't changed=2E
>
>For example, instead of putting something buffer and focus dependent in P=
CH or fiddling with buffer and window and frame hooks, you could write some=
thing like
>
>(call-on-change (:buffer :window :focus) #'my-thing)
>
>or something like that=2E
>
>It's not that you can't do the equivalent by manually adding my-thing to =
the appropriate hooks directly, but the convenient one stop syntax might gu=
ide people away from PCH=2E


Also, we'd be able to coalesce and debounce calls to these change function=
s=2E 




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

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


Received: (at submit) by debbugs.gnu.org; 27 Mar 2025 20:42:15 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Mar 27 16:42:14 2025
Received: from localhost ([127.0.0.1]:51549 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1txu3K-0001d9-3E
	for submit <at> debbugs.gnu.org; Thu, 27 Mar 2025 16:42:14 -0400
Received: from lists.gnu.org ([2001:470:142::17]:34424)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <dancol@HIDDEN>) id 1txu35-0001c7-8W
 for submit <at> debbugs.gnu.org; Thu, 27 Mar 2025 16:41:59 -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 <dancol@HIDDEN>) id 1txu2z-0006jm-Vh
 for bug-gnu-emacs@HIDDEN; Thu, 27 Mar 2025 16:41:53 -0400
Received: from dancol.org ([2600:3c01:e000:3d8::1])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <dancol@HIDDEN>)
 id 1txu2v-0005QL-Kp; Thu, 27 Mar 2025 16:41:53 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=dancol.org; 
 s=x;
 h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID:
 References:In-Reply-To:Subject:CC:To:From:Date:Sender:Reply-To:Content-ID:
 Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc
 :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe:
 List-Post:List-Owner:List-Archive;
 bh=DR+s+MO9eKJedPblRkdogF9UD47g/Ap8ilT5MINlC+s=; b=Hr5SdC8sYpMAar6G0Pq/Lss/pU
 uwcEeXxFciUKQdUlOfr0OmxovBVbrhRAEp5uBFyfQiFZ76nsdwPp1v7EX/izB3oPYGwg7kiSbsTGt
 WGbQDJdrKTfqN+q1VIduEbxXI85FkmAM+jgTO1dzkfOk30sZ4q93pN7OFvYm00a1MDCYXer6EKVyO
 w3ezhJ0hUeJM9a/Scxor2weGeO0HZeN4E+5iUWm8O49aTTSfK9TrO7Sh6w+leG7OgQfT/ZncvUz3B
 jj2bROqcXc2vbQiud3c7bN7BNSEq6oQw3lDSBxS5tyGrZNwTRxHwAMsW03C47G0CT/ZUQ6NruwnxA
 orKJki8g==;
Received: from 2603-9001-4203-1ab2-6547-8c8c-bd19-5cb4.inf6.spectrum.com
 ([2603:9001:4203:1ab2:6547:8c8c:bd19:5cb4]:47182 helo=[IPv6:::1])
 by dancol.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
 (Exim 4.96) (envelope-from <dancol@HIDDEN>) id 1txu2R-004FNd-1w;
 Thu, 27 Mar 2025 16:41:19 -0400
Date: Thu, 27 Mar 2025 16:41:39 -0400
From: Daniel Colascione <dancol@HIDDEN>
To: bug-gnu-emacs@HIDDEN, Eli Zaretskii <eliz@HIDDEN>,
 Daniel Mendler <mail@HIDDEN>
Subject: Re: bug#77224: [PATCH] New minor mode 'cursor-indicators-mode'
User-Agent: K-9 Mail for Android
In-Reply-To: <86tt7ebfnc.fsf@HIDDEN>
References: <87iknzxski.fsf@HIDDEN> <87o6xq6fud.fsf@HIDDEN>
 <875xjymh93.fsf@HIDDEN> <87ikny2rio.fsf@HIDDEN>
 <86o6xpe2cx.fsf@HIDDEN> <87o6xobdcc.fsf@HIDDEN>
 <875xjwyzvt.fsf@HIDDEN> <8634f0dkhq.fsf@HIDDEN>
 <875xjvcn4o.fsf@HIDDEN> <877c4b81nk.fsf@HIDDEN>
 <86ecyidg2d.fsf@HIDDEN> <87h63ekdxe.fsf@HIDDEN>
 <86cye2d8t6.fsf@HIDDEN> <87a596a29y.fsf@HIDDEN>
 <86tt7ebfnc.fsf@HIDDEN>
Message-ID: <44319BF5-31B5-4ECD-95AB-591A216D0072@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain;
 charset=utf-8
Content-Transfer-Encoding: quoted-printable
Received-SPF: pass client-ip=2600:3c01:e000:3d8::1;
 envelope-from=dancol@HIDDEN; helo=dancol.org
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, SPF_HELO_PASS=-0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: 0.9 (/)
X-Debbugs-Envelope-To: submit
Cc: 77224 <at> debbugs.gnu.org, eg642616@HIDDEN, juri@HIDDEN
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.1 (/)



On March 27, 2025 12:29:59 PM EDT, Eli Zaretskii <eliz@gnu=2Eorg> wrote:
>> From: Daniel Mendler <mail@daniel-mendler=2Ede>
>> Cc: eg642616@gmail=2Ecom,  77224@debbugs=2Egnu=2Eorg,  juri@linkov=2Ene=
t
>> Date: Thu, 27 Mar 2025 17:04:09 +0100
>>=20
>> Eli Zaretskii <eliz@gnu=2Eorg> writes:
>>=20
>> > I disagree that the cursor must change "immediately", in the rigorous
>> > sense of that word=2E  I think if it changes after 10 or 20 or 50
>> > milliseconds, that's "immediately" for any practical purpose=2E
>>=20
>> No, 50ms are not acceptable for the user if they except an immediate
>> response to a key press=2E
>
>50ms was just an example, and it is actually quite improbable to be
>that large=2E
>
>post-command-hook is run by the same loop that decides that Emacs is
>idle and runs timers, so the difference in practice should be very
>small if at all=2E
>
>> Regarding Emacs sluggishness, the `cursor-indicators-mode' is an
>> optional mode=2E If it increases sluggishness unnacceptably (which it
>> won't), users can turn it off=2E
>
>Experience shows that many users turn on a lot of features which rely
>on post-command-hook, and then complain that Emacs is slow to respond=2E
>Telling them to turn off features they like doesn't really work=2E

Nor does telling external package authors not to use post-command-hook=2E =
I think there are two worthwhile approaches: 1) time the entries in post-co=
mmand-hook and alert users about slow ones, and 2) provide a "do something =
when X, Y, or Z changes" API that authors could use when they would otherwi=
se put something on PCH and check X, Y, and Z internally=2E Internally, we =
could DTRT and omit running those hooks when the relevant conditions haven'=
t changed=2E

For example, instead of putting something buffer and focus dependent in PC=
H or fiddling with buffer and window and frame hooks, you could write somet=
hing like

(call-on-change (:buffer :window :focus) #'my-thing)

or something like that=2E

It's not that you can't do the equivalent by manually adding my-thing to t=
he appropriate hooks directly, but the convenient one stop syntax might gui=
de people away from PCH=2E

>
>Anyway, I think making the cursor change from a mode hook is a better
>solution=2E

+1=20




>




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

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


Received: (at 77224) by debbugs.gnu.org; 27 Mar 2025 20:42:01 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Mar 27 16:42:01 2025
Received: from localhost ([127.0.0.1]:51545 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1txu34-0001cJ-Aa
	for submit <at> debbugs.gnu.org; Thu, 27 Mar 2025 16:42:01 -0400
Received: from dancol.org ([2600:3c01:e000:3d8::1]:41568)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <dancol@HIDDEN>) id 1txu2x-0001c3-SJ
 for 77224 <at> debbugs.gnu.org; Thu, 27 Mar 2025 16:41:55 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=dancol.org; 
 s=x;
 h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID:
 References:In-Reply-To:Subject:CC:To:From:Date:Sender:Reply-To:Content-ID:
 Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc
 :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe:
 List-Post:List-Owner:List-Archive;
 bh=DR+s+MO9eKJedPblRkdogF9UD47g/Ap8ilT5MINlC+s=; b=Hr5SdC8sYpMAar6G0Pq/Lss/pU
 uwcEeXxFciUKQdUlOfr0OmxovBVbrhRAEp5uBFyfQiFZ76nsdwPp1v7EX/izB3oPYGwg7kiSbsTGt
 WGbQDJdrKTfqN+q1VIduEbxXI85FkmAM+jgTO1dzkfOk30sZ4q93pN7OFvYm00a1MDCYXer6EKVyO
 w3ezhJ0hUeJM9a/Scxor2weGeO0HZeN4E+5iUWm8O49aTTSfK9TrO7Sh6w+leG7OgQfT/ZncvUz3B
 jj2bROqcXc2vbQiud3c7bN7BNSEq6oQw3lDSBxS5tyGrZNwTRxHwAMsW03C47G0CT/ZUQ6NruwnxA
 orKJki8g==;
Received: from 2603-9001-4203-1ab2-6547-8c8c-bd19-5cb4.inf6.spectrum.com
 ([2603:9001:4203:1ab2:6547:8c8c:bd19:5cb4]:47182 helo=[IPv6:::1])
 by dancol.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
 (Exim 4.96) (envelope-from <dancol@HIDDEN>) id 1txu2R-004FNd-1w;
 Thu, 27 Mar 2025 16:41:19 -0400
Date: Thu, 27 Mar 2025 16:41:39 -0400
From: Daniel Colascione <dancol@HIDDEN>
To: bug-gnu-emacs@HIDDEN, Eli Zaretskii <eliz@HIDDEN>,
 Daniel Mendler <mail@HIDDEN>
Subject: Re: bug#77224: [PATCH] New minor mode 'cursor-indicators-mode'
User-Agent: K-9 Mail for Android
In-Reply-To: <86tt7ebfnc.fsf@HIDDEN>
References: <87iknzxski.fsf@HIDDEN> <87o6xq6fud.fsf@HIDDEN>
 <875xjymh93.fsf@HIDDEN> <87ikny2rio.fsf@HIDDEN>
 <86o6xpe2cx.fsf@HIDDEN> <87o6xobdcc.fsf@HIDDEN>
 <875xjwyzvt.fsf@HIDDEN> <8634f0dkhq.fsf@HIDDEN>
 <875xjvcn4o.fsf@HIDDEN> <877c4b81nk.fsf@HIDDEN>
 <86ecyidg2d.fsf@HIDDEN> <87h63ekdxe.fsf@HIDDEN>
 <86cye2d8t6.fsf@HIDDEN> <87a596a29y.fsf@HIDDEN>
 <86tt7ebfnc.fsf@HIDDEN>
Message-ID: <44319BF5-31B5-4ECD-95AB-591A216D0072@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain;
 charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 77224
Cc: 77224 <at> debbugs.gnu.org, eg642616@HIDDEN, juri@HIDDEN
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 (-)



On March 27, 2025 12:29:59 PM EDT, Eli Zaretskii <eliz@gnu=2Eorg> wrote:
>> From: Daniel Mendler <mail@daniel-mendler=2Ede>
>> Cc: eg642616@gmail=2Ecom,  77224@debbugs=2Egnu=2Eorg,  juri@linkov=2Ene=
t
>> Date: Thu, 27 Mar 2025 17:04:09 +0100
>>=20
>> Eli Zaretskii <eliz@gnu=2Eorg> writes:
>>=20
>> > I disagree that the cursor must change "immediately", in the rigorous
>> > sense of that word=2E  I think if it changes after 10 or 20 or 50
>> > milliseconds, that's "immediately" for any practical purpose=2E
>>=20
>> No, 50ms are not acceptable for the user if they except an immediate
>> response to a key press=2E
>
>50ms was just an example, and it is actually quite improbable to be
>that large=2E
>
>post-command-hook is run by the same loop that decides that Emacs is
>idle and runs timers, so the difference in practice should be very
>small if at all=2E
>
>> Regarding Emacs sluggishness, the `cursor-indicators-mode' is an
>> optional mode=2E If it increases sluggishness unnacceptably (which it
>> won't), users can turn it off=2E
>
>Experience shows that many users turn on a lot of features which rely
>on post-command-hook, and then complain that Emacs is slow to respond=2E
>Telling them to turn off features they like doesn't really work=2E

Nor does telling external package authors not to use post-command-hook=2E =
I think there are two worthwhile approaches: 1) time the entries in post-co=
mmand-hook and alert users about slow ones, and 2) provide a "do something =
when X, Y, or Z changes" API that authors could use when they would otherwi=
se put something on PCH and check X, Y, and Z internally=2E Internally, we =
could DTRT and omit running those hooks when the relevant conditions haven'=
t changed=2E

For example, instead of putting something buffer and focus dependent in PC=
H or fiddling with buffer and window and frame hooks, you could write somet=
hing like

(call-on-change (:buffer :window :focus) #'my-thing)

or something like that=2E

It's not that you can't do the equivalent by manually adding my-thing to t=
he appropriate hooks directly, but the convenient one stop syntax might gui=
de people away from PCH=2E

>
>Anyway, I think making the cursor change from a mode hook is a better
>solution=2E

+1=20




>




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

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


Received: (at 77224) by debbugs.gnu.org; 27 Mar 2025 20:32:27 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Mar 27 16:32:27 2025
Received: from localhost ([127.0.0.1]:51521 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1txttr-0001Ac-05
	for submit <at> debbugs.gnu.org; Thu, 27 Mar 2025 16:32:27 -0400
Received: from mail-pl1-x634.google.com ([2607:f8b0:4864:20::634]:47205)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <jporterbugs@HIDDEN>)
 id 1txttn-0001AI-9N
 for 77224 <at> debbugs.gnu.org; Thu, 27 Mar 2025 16:32:23 -0400
Received: by mail-pl1-x634.google.com with SMTP id
 d9443c01a7336-22401f4d35aso33754135ad.2
 for <77224 <at> debbugs.gnu.org>; Thu, 27 Mar 2025 13:32:23 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1743107537; x=1743712337; darn=debbugs.gnu.org;
 h=content-transfer-encoding:in-reply-to:from:references:cc:to
 :content-language:subject:mime-version:date:message-id:from:to:cc
 :subject:date:message-id:reply-to;
 bh=x1dsDPJbWq5m/yxj29hPc0nnXV0NdKnnJ+P5ll8JtjU=;
 b=TaseePNzixY4QexJZ6LWkdWvLF4YMaV718Tki01DV7I4sdM5jzYZ6pwziqmENdtuu8
 7WaSCQqPwp+PHgrh2QJvQ36cSeO/HPaOHfoGsxW5AoIRWrwIaOvWUfiOfLCZZqteniCZ
 tDZMXfNp6ImgTfG/q2vBug4tUbp6I21u3AGan85MKtgc/J5hCH7xHa2T1ai+EqGZsN4U
 r/dWmmxm0TVmlAp/ruN4/vexYi4Ix6kShbGQcnUHf5Q1DSwgKLCPj4ADFfJ9I0xHm1je
 Hg2/bNOjXx3Jtg9UhHGNpvK4BXtwqQZFZB2Pr7wT3lXYQ0KKvpLopSS2t5YW1gTcpPe3
 lp+Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1743107537; x=1743712337;
 h=content-transfer-encoding:in-reply-to:from:references:cc:to
 :content-language:subject:mime-version:date:message-id
 :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
 bh=x1dsDPJbWq5m/yxj29hPc0nnXV0NdKnnJ+P5ll8JtjU=;
 b=DfNNSO7vNQTkeOwT9dTPDoew6Vg754TvAxXGDjCy2/TPaQK93UbzVQ01mYfXlGu6vK
 WuAJ54xriwFOpHMM5EVEmSqrIjUQFqMJaOFcrpH+Yb/hFRwkpRrO5yMhuhvlHyXlUlVy
 dxvsdjzQ22JshEDUfUqKZmXVzXhh9GpnfHLYASQeMEErd5SzLvvLm6eiIuLPk+kR9Fmg
 F45csZDqJy0rLL4UmORUJ0dl76hBYePywpZ0tdgqqBoljYsa3ayc4CqL5sQPEe3hloPe
 xY3P/YWhkcHcYzouNdy6Umh02LZayfPGoS/7xUO3hf91bJMcadYI9d8sS4qDS3Oi7HFn
 pQDg==
X-Gm-Message-State: AOJu0Yyv2dXgkDqnOtgJ/uRHp2WvD11s5nsHbVV33zmJhRKAqHfL6rZ7
 RmB/zxvvTftUk2oTAtLbT9MMwCdyACh1C+Xxp70tJ3mMc5cEV8HR
X-Gm-Gg: ASbGnctx9IJoCgphCFCuCU93kYuiE2K7ibLu/iS7/J1Y1y9L0QjPPj6jVZiDx7QoGEF
 VMuyy0UJlhSFzuCUJ5LTOdrykkunKhfT4A7tHqV4w9D2vuVLZVMwXHQqkkHr49xv4N5MC6ZrZ9p
 QvCGofOGrB9NJEu6niHtZls5n9SMrOa5zApMNIrKd6+K/1VSQo+PtMqvVe6MLDFSIXvy1J1YV9d
 3zHvKhQg/o47u1YbQClVq6mQiPGGEC6QRsg3yTihzRLZWn07MzljBFUcCoacbAQjB79U8YoyOF4
 Veq7P9Evgf7bD8LCO38n4JBbY9ME3oLTEA/aug2j9VizGkz7dZa/Y3jUys/GIaYoFZ+P1jEwoQ7
 Us3dynp5uR47OAXldeFgitrKc
X-Google-Smtp-Source: AGHT+IF9lMyZ2Pl1qCNLwpNE9Ic5cws4DvNiyhDYZFm1II40amkQJWJ9g5Lr+IcQMVdfGdZqUi4Vqg==
X-Received: by 2002:a05:6a21:3a46:b0:1f5:619a:7f4c with SMTP id
 adf61e73a8af0-1fea2f4c253mr9741863637.29.1743107536809; 
 Thu, 27 Mar 2025 13:32:16 -0700 (PDT)
Received: from [192.168.1.2] (syn-023-240-109-202.res.spectrum.com.
 [23.240.109.202]) by smtp.googlemail.com with ESMTPSA id
 d2e1a72fcca58-7397106b01asm273378b3a.102.2025.03.27.13.32.15
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 27 Mar 2025 13:32:16 -0700 (PDT)
Message-ID: <bc452b18-3561-29e2-0247-a43c19575e77@HIDDEN>
Date: Thu, 27 Mar 2025 13:32:16 -0700
MIME-Version: 1.0
Subject: Re: bug#77224: [PATCH] New minor mode 'cursor-indicators-mode'
Content-Language: en-US
To: Eli Zaretskii <eliz@HIDDEN>, mail@HIDDEN
References: <87iknzxski.fsf@HIDDEN> <87o6xq6fud.fsf@HIDDEN>
 <875xjymh93.fsf@HIDDEN> <87ikny2rio.fsf@HIDDEN>
 <86o6xpe2cx.fsf@HIDDEN> <87o6xobdcc.fsf@HIDDEN>
 <875xjwyzvt.fsf@HIDDEN> <8634f0dkhq.fsf@HIDDEN>
 <875xjvcn4o.fsf@HIDDEN> <877c4b81nk.fsf@HIDDEN>
 <86ecyidg2d.fsf@HIDDEN> <87h63ekdxe.fsf@HIDDEN>
 <86cye2d8t6.fsf@HIDDEN> <86a596d7l5.fsf@HIDDEN>
From: Jim Porter <jporterbugs@HIDDEN>
In-Reply-To: <86a596d7l5.fsf@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 77224
Cc: 77224 <at> debbugs.gnu.org, eg642616@HIDDEN, juri@HIDDEN
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 (-)

On 3/27/2025 4:41 AM, Eli Zaretskii wrote:
> Btw, a possibly even better way is to modify the cursor looks from the
> hooks of the relevant commands, like overwrite-mode.  If some of them
> don't have a hook, we could add a hook.  This is better because it
> doesn't unnecessarily "punish" Emacs anywhere else, only the commands
> that could affect the cursor.
> 
> Does this make sense?

That makes sense to me, and is approximately what I have in my own 
configuration to do the same sort of thing as this patch. I update the 
cursor by adding a hook to 'after-change-major-mode-hook' and then 
adding variable watchers for 'buffer-read-only' and 'overwrite-mode'. 
That was the most-reliable method I could find at the time. If there 
were appropriate hooks for read-only/overwrite, then I think that would 
be the ideal solution.




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

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


Received: (at 77224) by debbugs.gnu.org; 27 Mar 2025 20:17:44 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Mar 27 16:17:44 2025
Received: from localhost ([127.0.0.1]:51495 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1txtfY-0000Sh-G7
	for submit <at> debbugs.gnu.org; Thu, 27 Mar 2025 16:17:44 -0400
Received: from server.qxqx.de ([2a01:4f8:c012:9177::1]:34123 helo=mail.qxqx.de)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <mail@HIDDEN>)
 id 1txtfS-0000SN-9W
 for 77224 <at> debbugs.gnu.org; Thu, 27 Mar 2025 16:17:37 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
 d=daniel-mendler.de; s=key; h=Content-Type:MIME-Version:Message-ID:Date:
 References:In-Reply-To:Subject:Cc:To:From:Sender:Reply-To:
 Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date:
 Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:
 List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=byP74CLiKgIVYjs+xBmOMXWFZ/zIgDzSUFYBi0WRk4I=; b=nxeOT4/2KiBmzXZCAiGI32Fsdf
 mIwO45Bq3cm6N001UmP0N3/tgISZvTFYedmLWRdtuUBtVdcBXzhg/uz4lqRtYKw/1p7JQb3fz0t0m
 9AzhmIktXo1tg7AvABgHXBnkf4/VnoPpKzVkzyyi5BAr75y7h/fMMHwcECBv8anyANPU=;
From: Daniel Mendler <mail@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#77224: [PATCH] New minor mode 'cursor-indicators-mode'
In-Reply-To: <86pli2befe.fsf@HIDDEN> (Eli Zaretskii's message of "Thu, 27 Mar
 2025 18:56:21 +0200")
References: <87iknzxski.fsf@HIDDEN> <87o6xq6fud.fsf@HIDDEN>
 <875xjymh93.fsf@HIDDEN> <87ikny2rio.fsf@HIDDEN>
 <86o6xpe2cx.fsf@HIDDEN> <87o6xobdcc.fsf@HIDDEN>
 <875xjwyzvt.fsf@HIDDEN> <8634f0dkhq.fsf@HIDDEN>
 <875xjvcn4o.fsf@HIDDEN> <877c4b81nk.fsf@HIDDEN>
 <86ecyidg2d.fsf@HIDDEN> <87h63ekdxe.fsf@HIDDEN>
 <86cye2d8t6.fsf@HIDDEN> <87a596a29y.fsf@HIDDEN>
 <86tt7ebfnc.fsf@HIDDEN> <877c4aa0m8.fsf@HIDDEN>
 <86pli2befe.fsf@HIDDEN>
Date: Thu, 27 Mar 2025 21:17:25 +0100
Message-ID: <878qoq5iui.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 77224
Cc: 77224 <at> debbugs.gnu.org, eg642616@HIDDEN, juri@HIDDEN
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.7 (-)

Eli Zaretskii <eliz@HIDDEN> writes:

>> From: Daniel Mendler <mail@HIDDEN>
>> Cc: eg642616@HIDDEN,  77224 <at> debbugs.gnu.org,  juri@HIDDEN
>> Date: Thu, 27 Mar 2025 17:39:59 +0100
>> 
>> Eli Zaretskii <eliz@HIDDEN> writes:
>> 
>> > post-command-hook is run by the same loop that decides that Emacs is
>> > idle and runs timers, so the difference in practice should be very
>> > small if at all.
>> 
>> The `post-command-hook' is guaranteed to run after a command while the
>> idle timer is delayed until no new events are in the queue.
>
> No, the idle time is run immediately if there's no input.  Emacs
> doesn't wait or delay the timer.

We are saying the same thing here. Yes, if there is no input, the idle
timer will run immediately. But if the user continues typing and events
are in the queue, then the timer will not run for some time. A delay
also occurs when an asynchronous process runs and fills a buffer in the
background like the *compilation* buffer. Then the cursor update will
lag behind.

I am with you that one should not carelessly add `post-command-hooks'. I
use various modes which use `post-command-hooks', idle timers and
regular timers, each for their proper use case. For example
`post-command-hooks' lead to sluggishness if they were used for auto
completion, spell checking or help at point (like Eldoc). For such use
cases idle timers or regular timers are the better tool since they defer
the expensive computation of completion strings, talking to a language
server, completion backend or a spell checker.

Here we discuss changing only the color of the cursor, a much much less
complex operation. The `cursor-type' update and checking a few variables
to find the color is a cheap operation which will not lead to
sluggishness. If this were an expensive operation, I would look
elsewhere for places to optimize, but avoiding `post-command-hook' is
not the solution.

Daniel




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

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


Received: (at 77224) by debbugs.gnu.org; 27 Mar 2025 19:25:41 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Mar 27 15:25:41 2025
Received: from localhost ([127.0.0.1]:51417 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1txsrE-0006X9-RE
	for submit <at> debbugs.gnu.org; Thu, 27 Mar 2025 15:25:41 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:40288)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1txsrA-0006Wq-7g
 for 77224 <at> debbugs.gnu.org; Thu, 27 Mar 2025 15:25: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 <eliz@HIDDEN>)
 id 1txsr3-000326-2z; Thu, 27 Mar 2025 15:25:29 -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=xZiyZIhdg9yQRybG9pX1oDipf3DffQyQBau+Hunkegg=; b=JnchDMyg/w3wHTyvjqGK
 B7QmQ5yKFQREe/1COySo1SxrZCnu0NWMnDpCwtN7i9CMVNTcxgkOd7e0fsjPm92f4UXe9iS09LHB7
 0tsCCnGvwI8m4ykW2oJfLLRTuydhI5+GEIO+ygnZmdjNDooQRTUCGiqtabtsbRNFWT7cq56iYqecK
 p1h/iz7ZIt4xCK7Te+DrBZK4yj9cNqPhX9JWCfUWFdbQ8sX1KZ0UKJBfJHLGklIhvDRS+9xuUS4ow
 AaRj8s/TerEIqD1JDdbswE+0QxBnH6y/lZfedR8lZC8b2UK+NWZVUxSYBiQHvVaPO9KIFYHkPpQ3d
 YI2ZTWSuCH5QaQ==;
Date: Thu, 27 Mar 2025 21:25:22 +0200
Message-Id: <86iknub7j1.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Elijah Gabe =?utf-8?Q?P=C3=A9rez?= <eg642616@HIDDEN>
In-Reply-To: <87pli2z5v9.fsf@HIDDEN> (message from Elijah Gabe
 =?utf-8?Q?P=C3=A9rez?= on Thu, 27 Mar 2025 12:27:22 -0600)
Subject: Re: bug#77224: [PATCH] New minor mode 'cursor-indicators-mode'
References: <87iknzxski.fsf@HIDDEN> <87o6xq6fud.fsf@HIDDEN>
 <875xjymh93.fsf@HIDDEN> <87ikny2rio.fsf@HIDDEN>
 <86o6xpe2cx.fsf@HIDDEN> <87o6xobdcc.fsf@HIDDEN>
 <875xjwyzvt.fsf@HIDDEN> <8634f0dkhq.fsf@HIDDEN>
 <875xjvcn4o.fsf@HIDDEN> <877c4b81nk.fsf@HIDDEN>
 <86ecyidg2d.fsf@HIDDEN> <87h63ekdxe.fsf@HIDDEN>
 <86cye2d8t6.fsf@HIDDEN> <87a596a29y.fsf@HIDDEN>
 <86tt7ebfnc.fsf@HIDDEN> <877c4aa0m8.fsf@HIDDEN>
 <86pli2befe.fsf@HIDDEN> <87pli2z5v9.fsf@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 77224
Cc: mail@HIDDEN, juri@HIDDEN, 77224 <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: Elijah Gabe Pérez <eg642616@HIDDEN>
> Cc: Daniel Mendler <mail@HIDDEN>,  77224 <at> debbugs.gnu.org,
>   juri@HIDDEN
> Date: Thu, 27 Mar 2025 12:27:22 -0600
> 
> Eli Zaretskii <eliz@HIDDEN> writes:
> 
>  Anyway, I think making the cursor change from a mode hook is a better
>  solution.
> 
>  As has been mentioned, the problem is that not every scenario is covered
>  by hooks, while the PCH is a potentially universal solution which can
>  check arbitrary conditions. But if hooks work sufficiently well for most
>  scenarios, then why not.
> 
>  If there are cases that this indication supports but there's no mode
>  hook for them, let's discuss those cases one by one and see how to
>  solve them. I see overwrite-mode, read-only-mode, and input-method
>  activation, all of which have hooks, AFAIR.
> 
> But the problem with using hooks is that modes sometimes defines a
> specific name for hook or use different hooks for that, for example
> overwrite-mode only defines overwrite-mode-hook, however input-method
> defines input-method-activate-hook and input-method-deactivate-hook or
> mark/region have activate-mark-hook and deactivate-mark-hook.

If there's a single hook, it is called both when turning the mode on
and when turning it off, so I'm not sure I see the problem.

Anyway, I think I'm done arguing.  I'm quite sure you all understand
my opinions and suggestions; if you want to disregard them and use the
post-command-hook anyway, feel free, but don't be surprised if someone
then complains that Emacs became a tad slower: it's because of all
these features that take the easy way out and use post-command-hook,
and by that add yet another one of those small slowdowns, which add up
and up...




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

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


Received: (at 77224) by debbugs.gnu.org; 27 Mar 2025 19:13:38 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Mar 27 15:13:38 2025
Received: from localhost ([127.0.0.1]:51383 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1txsfa-0005tx-Du
	for submit <at> debbugs.gnu.org; Thu, 27 Mar 2025 15:13:38 -0400
Received: from relay6-d.mail.gandi.net ([217.70.183.198]:35231)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <juri@HIDDEN>) id 1txsfX-0005td-8W
 for 77224 <at> debbugs.gnu.org; Thu, 27 Mar 2025 15:13:35 -0400
Received: by mail.gandi.net (Postfix) with ESMTPSA id 23CFA442AC;
 Thu, 27 Mar 2025 19:13:24 +0000 (UTC)
From: Juri Linkov <juri@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#77224: [PATCH] New minor mode 'cursor-indicators-mode'
In-Reply-To: <86jz8ababt.fsf@HIDDEN>
Organization: LINKOV.NET
References: <87iknzxski.fsf@HIDDEN> <87o6xq6fud.fsf@HIDDEN>
 <875xjymh93.fsf@HIDDEN> <87ikny2rio.fsf@HIDDEN>
 <86o6xpe2cx.fsf@HIDDEN> <87o6xobdcc.fsf@HIDDEN>
 <875xjwyzvt.fsf@HIDDEN> <8634f0dkhq.fsf@HIDDEN>
 <875xjvcn4o.fsf@HIDDEN> <877c4b81nk.fsf@HIDDEN>
 <86ecyidg2d.fsf@HIDDEN> <87h63ekdxe.fsf@HIDDEN>
 <86cye2d8t6.fsf@HIDDEN> <87a596a29y.fsf@HIDDEN>
 <86tt7ebfnc.fsf@HIDDEN> <877c4aa0m8.fsf@HIDDEN>
 <87semywfkr.fsf@HIDDEN> <86jz8ababt.fsf@HIDDEN>
Date: Thu, 27 Mar 2025 21:13:06 +0200
Message-ID: <87pli2qocd.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/31.0.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain
X-GND-State: clean
X-GND-Score: -100
X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdduieelvddvucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuifetpfffkfdpucggtfgfnhhsuhgsshgtrhhisggvnecuuegrihhlohhuthemuceftddunecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvfevufgjohhffffkfgggtgesthdtredttdertdenucfhrhhomheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqeenucggtffrrghtthgvrhhnpeffgeetfeevlefhleejfeeuheeiudeitdffhfdutdekfeffgffhveehteegueekheenucfkphepledurdduvdelrddutdehrdduudejnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepledurdduvdelrddutdehrdduudejpdhhvghlohepmhgrihhlrdhgrghnughirdhnvghtpdhmrghilhhfrhhomhepjhhurhhisehlihhnkhhovhdrnhgvthdpnhgspghrtghpthhtohepgedprhgtphhtthhopeejjedvvdegseguvggssghughhsrdhgnhhurdhorhhgpdhrtghpthhtohepvghgieegvdeiudeisehgmhgrihhlrdgtohhmpdhrtghpthhtohepmhgrihhlsegurghnihgvlhdqmhgvnhgulhgvrhdruggvpdhrtghpthhtohepvghlihiisehgnhhurdhorhhg
X-GND-Sasl: juri@HIDDEN
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 77224
Cc: mail@HIDDEN, eg642616@HIDDEN, 77224 <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.7 (-)

>> > I think Stefan and Juri should chime in with their experience about
>> > this, since as I've seen, they both want to replace some custom cursor
>> > code with the new mode in their configuration.
>> 
>> I tried the patch with 'run-with-idle-timer',
>> and even the delay 0.1 is noticeable and causes
>> the feeling that Emacs became sluggish
>> and can't update the cursor immediately.
>
> What about the delay of zero?

Ok, will try zero for a while.




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

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


Received: (at 77224) by debbugs.gnu.org; 27 Mar 2025 18:35:54 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Mar 27 14:35:54 2025
Received: from localhost ([127.0.0.1]:51327 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1txs53-0001Co-Ho
	for submit <at> debbugs.gnu.org; Thu, 27 Mar 2025 14:35:54 -0400
Received: from mail-oi1-x244.google.com ([2607:f8b0:4864:20::244]:44434)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <eg642616@HIDDEN>)
 id 1txs4z-0001CY-0c
 for 77224 <at> debbugs.gnu.org; Thu, 27 Mar 2025 14:35:50 -0400
Received: by mail-oi1-x244.google.com with SMTP id
 5614622812f47-3feaedb6670so777279b6e.1
 for <77224 <at> debbugs.gnu.org>; Thu, 27 Mar 2025 11:35:48 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1743100543; x=1743705343; darn=debbugs.gnu.org;
 h=mime-version:user-agent:message-id:date:references:in-reply-to
 :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to;
 bh=ASIP97p7J05zMWWyNFJMSX09KUqL/cD/GgDlDzKcrIM=;
 b=SCqAg0DhZi1b4zFfkx6J8ot0b0ahOCDljN+JQxrVNWA5XV1xF1VmRPf6TyVR0WYU19
 XCW4BsypH9pkJWEGpiqMUHR7YmzzLYDTMaFRBnruLL0tXwaLHdxnrFoqXL7nSet9mR/p
 blo3YTiyYJAVlvOJHEww/Oh436UoVAE6F4zfJtgBLHIjQPn2BWXGDyRFzM/GdwMSC5I5
 ubgWYKiWh3Viauag3YM9DlRbrO9fTk+0fjOfIawOrWildbYn8cX17SxjK9bSwMUt6mcT
 RE/2EaR5lihUeqigwGUHjjw5nBG9sgtbkaRQYS32wDFOnmbQFFREkLK7FHWEQHiRkQnj
 1Gow==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1743100543; x=1743705343;
 h=mime-version:user-agent:message-id:date:references:in-reply-to
 :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date
 :message-id:reply-to;
 bh=ASIP97p7J05zMWWyNFJMSX09KUqL/cD/GgDlDzKcrIM=;
 b=Nj8QgC2rQq94lSz4z78ADd4k2Pt01JmAafA5K0iTpNYN8qi6cIDGnxxcfDkvu/Spzi
 dCk1BFpMmeHrbY1UwYkcphDtiAYdgmKGxPQgRxN5hbKpsUyT6PcR6byeiq5JO2z+AT9K
 DIkP9N4bap9o5EyJ6FodMg0UmymLY5pVmUrezISR2HkToQzNE55ZjrWpLg24XF77NjIk
 MxQX5k4If3VDI52TMDBkcYLoy5TNJc2GknPLK4wcrKLq7w/0RYjok0yzFrc57djP8hmN
 AI61zRYJ8eSKjS6vry31WvV3OxDpgb8cRZXw32kknq9AWmcNHa9O5LiNhRdmeXDeZTf8
 o3gg==
X-Forwarded-Encrypted: i=1;
 AJvYcCX4ElQyQQuWeNfAs9ZiDSajxRQgNgXPthQ2arXSxbUOTgAgPF2sSftH7HS+POC4el4OK3c+Fw==@debbugs.gnu.org
X-Gm-Message-State: AOJu0Yyyx5KWaqV2pvvfLPzonANGhAvE5CUaZ+4ShkPd7NUy54J53LoX
 nBWVMCanWbHoeCcLfN8uf+4/nzDmQOp1zRLGyLAhu8e0nbmHlaWL
X-Gm-Gg: ASbGncvX8oI+KIal0oDrXleOUQhTSmIfyS3XYDb9JkH1bkRsx16tb25wfSyCXdSdmrY
 HHldxT+TFweZOCoLSJ1ItqAn9O6NBnTtZJhcxJJ8I2LDsp5uDAJA+CjJj4F61gxbco8nzWMDNQV
 /4r2hvkAkE2ZVRM8KRDzt904/sZKvXZdK8wXgrQ68Bkrtw9KLJYsLVYoch16c1t8yFr4NVOlAgm
 ppYrMXja0SJY79DI9OgkhtrgDl17Cu0lJ/uyxarqhyuOYM6xztgMHlF8ibUuaDlHrG1WM/sWJ2I
 nmiJ1tTPaDCa
X-Google-Smtp-Source: AGHT+IFIWcGChHWXHsV2qzJfIAXVRa+PiyM05c6H68+SWakEdM7y4dEtwsVKYZlD6H9QEOsk+2P9CA==
X-Received: by 2002:a05:6808:3844:b0:3f6:7b62:942e with SMTP id
 5614622812f47-3fefa3ad594mr2837422b6e.0.1743100542841; 
 Thu, 27 Mar 2025 11:35:42 -0700 (PDT)
Received: from fedora ([2806:10ae:e:5fce::1]) by smtp.gmail.com with ESMTPSA id
 5614622812f47-3ff05167347sm30620b6e.6.2025.03.27.11.35.41
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 27 Mar 2025 11:35:42 -0700 (PDT)
From: =?utf-8?Q?Elijah_Gabe_P=C3=A9rez?= <eg642616@HIDDEN>
To: Juri Linkov <juri@HIDDEN>
Subject: Re: bug#77224: [PATCH] New minor mode 'cursor-indicators-mode'
In-Reply-To: <87semywfkr.fsf@HIDDEN>
References: <87iknzxski.fsf@HIDDEN> <87o6xq6fud.fsf@HIDDEN>
 <875xjymh93.fsf@HIDDEN> <87ikny2rio.fsf@HIDDEN>
 <86o6xpe2cx.fsf@HIDDEN> <87o6xobdcc.fsf@HIDDEN>
 <875xjwyzvt.fsf@HIDDEN> <8634f0dkhq.fsf@HIDDEN>
 <875xjvcn4o.fsf@HIDDEN> <877c4b81nk.fsf@HIDDEN>
 <86ecyidg2d.fsf@HIDDEN> <87h63ekdxe.fsf@HIDDEN>
 <86cye2d8t6.fsf@HIDDEN> <87a596a29y.fsf@HIDDEN>
 <86tt7ebfnc.fsf@HIDDEN> <877c4aa0m8.fsf@HIDDEN>
 <87semywfkr.fsf@HIDDEN>
Date: Thu, 27 Mar 2025 12:35:41 -0600
Message-ID: <87jz8az5he.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/31.0.50
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-Spam-Score: 0.3 (/)
X-Debbugs-Envelope-To: 77224
Cc: Daniel Mendler <mail@HIDDEN>, Eli Zaretskii <eliz@HIDDEN>,
 77224 <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: -0.7 (/)

--=-=-=
Content-Type: multipart/alternative; boundary="==-=-="

--==-=-=
Content-Type: text/plain

Juri Linkov <juri@HIDDEN> writes:

>> I think Stefan and Juri should chime in with their experience about
>> this, since as I've seen, they both want to replace some custom cursor
>> code with the new mode in their configuration.

> I tried the patch with 'run-with-idle-timer',
> and even the delay 0.1 is noticeable and causes
> the feeling that Emacs became sluggish
> and can't update the cursor immediately.

I think with 0.005 is most that fine, it's not immediate but also not
too lazy IMO.

Anyways the user can change the delay to 0.


--==-=-=
Content-Type: text/html

<p>
Juri Linkov &lt;juri@HIDDEN&gt; writes:<br />
</p>

<p>
<blockquote class="gmail_quote" style="border-left:#5555EE solid 0.2em;margin: 0em;padding-left: 0.85em;font-family: monospace;unicode-bidi: isolate;display: box;">

<div><blockquote class="gmail_quote" style="border-left:#5555EE solid 0.2em;margin: 0em;padding-left: 0.85em;font-family: monospace;unicode-bidi: isolate;display: box;">

<div>I think Stefan and Juri should chime in with their experience about<br />
this, since as I've seen, they both want to replace some custom cursor<br />
code with the new mode in their configuration.<br />

</div></blockquote>

</div></blockquote>
</p>

<p>
<blockquote class="gmail_quote" style="border-left:#5555EE solid 0.2em;margin: 0em;padding-left: 0.85em;font-family: monospace;unicode-bidi: isolate;display: box;">

<div>I tried the patch with 'run-with-idle-timer',<br />
and even the delay 0.1 is noticeable and causes<br />
the feeling that Emacs became sluggish<br />
and can't update the cursor immediately.<br />

</div></blockquote>
</p>

<p>
I think with 0.005 is most that fine, it's not immediate but also not<br />
too lazy IMO.<br />
</p>

<p>
Anyways the user can change the delay to 0.<br />
</p>

--==-=-=--

--=-=-=
Content-Type: text/plain



-- 
                                          - E.G via GNU Emacs and Org.

--=-=-=--




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

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


Received: (at 77224) by debbugs.gnu.org; 27 Mar 2025 18:27:33 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Mar 27 14:27:33 2025
Received: from localhost ([127.0.0.1]:51315 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1txrwz-0000n6-Db
	for submit <at> debbugs.gnu.org; Thu, 27 Mar 2025 14:27:33 -0400
Received: from mail-ot1-x341.google.com ([2607:f8b0:4864:20::341]:61825)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <eg642616@HIDDEN>)
 id 1txrww-0000mp-FN
 for 77224 <at> debbugs.gnu.org; Thu, 27 Mar 2025 14:27:31 -0400
Received: by mail-ot1-x341.google.com with SMTP id
 46e09a7af769-72c03d237a7so609844a34.3
 for <77224 <at> debbugs.gnu.org>; Thu, 27 Mar 2025 11:27:30 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1743100044; x=1743704844; darn=debbugs.gnu.org;
 h=mime-version:user-agent:message-id:date:references:in-reply-to
 :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to;
 bh=y/7u6oSjsS9xyxdFZ8ZUEQXgnfOIkPtylYGI6tvkwpk=;
 b=JQFf8ELj+wBNHHgaqXGHasAbWAOULCNYu5OcYDHAYTL6C1zzs7T6whPxtc9AZ3oLJ5
 bTHktB50lqzBNR3IsnPsI/KkmtSU09d0kuquAouKFd1d+fHrjBiUM8ZHZljrTXdBE6KY
 L4NfYjGgJ5MpeFwGIuoXuP25vt8gJNrwuSHvaRgvcqmcDvJcb3e1RrNxPSczv1k+FtPI
 dyrcrLvV7kzdOaOoYCbJOOpiXqPC4wXB1wy/ke+NNNhf81q/ahTCJa+696BrNm8rITsp
 vsD8tTE0HEJwEGaC6aNJxOshY0PcdXxmvMpweVgIKnJLdd6CkjJwPOOqTEwFHN111lLV
 qdvg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1743100044; x=1743704844;
 h=mime-version:user-agent:message-id:date:references:in-reply-to
 :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date
 :message-id:reply-to;
 bh=y/7u6oSjsS9xyxdFZ8ZUEQXgnfOIkPtylYGI6tvkwpk=;
 b=sgy7Z4I1rk/yiQjYjvp0yVwKhUdfONHS1WA6Qy2Z2uckUK/4zclAfk2AWzUCtdKa8o
 bE/SL4jCOddAFBMLHD69E88WX52mV2fvadqsbUXGAudn2MDlah3LBUgKS3/tQgXi2nzq
 C1TDt6fESfQwT/osxbjjsmRREMEYD4cUyWjBOeew/lmRE9fnf0RBZzWbTZKDYrlu5BHD
 G52hPb34cMDf7j5bagIUIMgacSZJ3Ne+MXwGdTDFubDva2jT02chUAunM4v934vBuXcp
 3LGWorKG+AX2agPPGvIci8J4YCttHkKJFZ9QK/ahwYwn00fUxIBqt4WYpLd4M5yIPxM5
 JNVw==
X-Forwarded-Encrypted: i=1;
 AJvYcCXjmRJfH+KREVqn6Zq1vPwaSeCMtsLXiyoh2xvt3PLRcw6l4rUWawI1sMhk7Qiv+Vx6bBBXfQ==@debbugs.gnu.org
X-Gm-Message-State: AOJu0YyFz0ZuUicEkV5FRtvvnCMOw0L7nv1IX/t0a6bzPdK9S5FRrVva
 hKB9RkHMd7MBSm3h2W/jemNivx6Xy8iZdEWlrLqb930aHwkqvtL1N95Wt/4t
X-Gm-Gg: ASbGnctMNqnJMphztQeJZqqTJwSR7fILpz2d7d+JRfXHYSqoiBGZQWUrWSccZXR/hpj
 2k6072IJ8yf92OxbGr4H9E8c7Q8DRRmju9tTWt1npmIJf1RGlYM8/VrcxQiKNJ8lERz4iYz8Nmh
 TFW8ukICncHFH19brITRBR+AKR6ga8Z473OJVorapyxBhAVFrydux5Sn6dv5t3ge70r/ex/QuJM
 JYy+wcJg8jhlayQglwA2GFjPtndomszGWjhE6ArLagXvMOSncIznPvAoXohL48sFyYWzmcs791j
 WpnmkZUWP0wX
X-Google-Smtp-Source: AGHT+IHeXC9tzsASZ/kNhKdvEW3rQ4u5thPQH9+2XEi7kni0QJKSB5HBANUju9c8pOUfQjN5CywapQ==
X-Received: by 2002:a05:6830:d15:b0:72b:872f:efc8 with SMTP id
 46e09a7af769-72c4ca44954mr3689117a34.24.1743100044178; 
 Thu, 27 Mar 2025 11:27:24 -0700 (PDT)
Received: from fedora ([2806:10ae:e:5fce::1]) by smtp.gmail.com with ESMTPSA id
 46e09a7af769-72c58267f54sm78126a34.55.2025.03.27.11.27.23
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 27 Mar 2025 11:27:23 -0700 (PDT)
From: =?utf-8?Q?Elijah_Gabe_P=C3=A9rez?= <eg642616@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#77224: [PATCH] New minor mode 'cursor-indicators-mode'
In-Reply-To: <86pli2befe.fsf@HIDDEN>
References: <87iknzxski.fsf@HIDDEN> <87o6xq6fud.fsf@HIDDEN>
 <875xjymh93.fsf@HIDDEN> <87ikny2rio.fsf@HIDDEN>
 <86o6xpe2cx.fsf@HIDDEN> <87o6xobdcc.fsf@HIDDEN>
 <875xjwyzvt.fsf@HIDDEN> <8634f0dkhq.fsf@HIDDEN>
 <875xjvcn4o.fsf@HIDDEN> <877c4b81nk.fsf@HIDDEN>
 <86ecyidg2d.fsf@HIDDEN> <87h63ekdxe.fsf@HIDDEN>
 <86cye2d8t6.fsf@HIDDEN> <87a596a29y.fsf@HIDDEN>
 <86tt7ebfnc.fsf@HIDDEN> <877c4aa0m8.fsf@HIDDEN>
 <86pli2befe.fsf@HIDDEN>
Date: Thu, 27 Mar 2025 12:27:22 -0600
Message-ID: <87pli2z5v9.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/31.0.50
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-Spam-Score: 0.3 (/)
X-Debbugs-Envelope-To: 77224
Cc: Daniel Mendler <mail@HIDDEN>, juri@HIDDEN,
 77224 <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: -0.7 (/)

--=-=-=
Content-Type: multipart/alternative; boundary="==-=-="

--==-=-=
Content-Type: text/plain

Eli Zaretskii <eliz@HIDDEN> writes:
>> > Anyway, I think making the cursor change from a mode hook is a better
>> > solution.

>> As has been mentioned, the problem is that not every scenario is covered
>> by hooks, while the PCH is a potentially universal solution which can
>> check arbitrary conditions. But if hooks work sufficiently well for most
>> scenarios, then why not.

> If there are cases that this indication supports but there's no mode
> hook for them, let's discuss those cases one by one and see how to
> solve them.  I see overwrite-mode, read-only-mode, and input-method
> activation, all of which have hooks, AFAIR.

But the problem with using hooks is that modes sometimes defines a
specific name for hook or use different hooks for that, for example
overwrite-mode only defines overwrite-mode-hook, however input-method
defines input-method-activate-hook and input-method-deactivate-hook or
mark/region have activate-mark-hook and deactivate-mark-hook.


--==-=-=
Content-Type: text/html

<p>
Eli Zaretskii &lt;eliz@HIDDEN&gt; writes:<br />
<blockquote class="gmail_quote" style="border-left:#5555EE solid 0.2em;margin: 0em;padding-left: 0.85em;font-family: monospace;unicode-bidi: isolate;display: box;">

<div><blockquote class="gmail_quote" style="border-left:#5555EE solid 0.2em;margin: 0em;padding-left: 0.85em;font-family: monospace;unicode-bidi: isolate;display: box;">

<div><blockquote class="gmail_quote" style="border-left:#5555EE solid 0.2em;margin: 0em;padding-left: 0.85em;font-family: monospace;unicode-bidi: isolate;display: box;">

<div>Anyway, I think making the cursor change from a mode hook is a better<br />
solution.<br />

</div></blockquote>

</div></blockquote>

</div></blockquote>
</p>

<p>
<blockquote class="gmail_quote" style="border-left:#5555EE solid 0.2em;margin: 0em;padding-left: 0.85em;font-family: monospace;unicode-bidi: isolate;display: box;">

<div><blockquote class="gmail_quote" style="border-left:#5555EE solid 0.2em;margin: 0em;padding-left: 0.85em;font-family: monospace;unicode-bidi: isolate;display: box;">

<div>As has been mentioned, the problem is that not every scenario is covered<br />
by hooks, while the PCH is a potentially universal solution which can<br />
check arbitrary conditions. But if hooks work sufficiently well for most<br />
scenarios, then why not.<br />

</div></blockquote>

</div></blockquote>
</p>

<p>
<blockquote class="gmail_quote" style="border-left:#5555EE solid 0.2em;margin: 0em;padding-left: 0.85em;font-family: monospace;unicode-bidi: isolate;display: box;">

<div>If there are cases that this indication supports but there's no mode<br />
hook for them, let's discuss those cases one by one and see how to<br />
solve them.  I see overwrite-mode, read-only-mode, and input-method<br />
activation, all of which have hooks, AFAIR.<br />

</div></blockquote>
</p>

<p>
But the problem with using hooks is that modes sometimes defines a<br />
specific name for hook or use different hooks for that, for example<br />
overwrite-mode only defines overwrite-mode-hook, however input-method<br />
defines input-method-activate-hook and input-method-deactivate-hook or<br />
mark/region have activate-mark-hook and deactivate-mark-hook.<br />
</p>

--==-=-=--

--=-=-=
Content-Type: text/plain



-- 
                                          - E.G via GNU Emacs and Org.

--=-=-=--




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

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


Received: (at 77224) by debbugs.gnu.org; 27 Mar 2025 18:25:13 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Mar 27 14:25:13 2025
Received: from localhost ([127.0.0.1]:51296 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1txrui-0000d6-Ht
	for submit <at> debbugs.gnu.org; Thu, 27 Mar 2025 14:25:13 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:50338)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1txruf-0000Xe-Dc
 for 77224 <at> debbugs.gnu.org; Thu, 27 Mar 2025 14:25:10 -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 1txruW-0003Zw-12; Thu, 27 Mar 2025 14:25:00 -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=/uY1ow7ciAcJS2pWCJSW2/WMIkpzuAULx2KcjhFhuCo=; b=QdeiTD0bMbgp
 11FM7KAkWcSB+uaZMzOQukyYG6Ro/whNbJJSJXDtbYuQ2zWKL9TRgn5E3r3DvU4aQKERrFm64iOCD
 8ioAT4xaUzJPUUaL4mcGeMk3Hql63vO2sUMa8OlnHLlFgAYpwhQqhSrRJHvdDMWqB0fn402rtloQm
 U+EJPpoYqA8aNFBCetfV1LVbuHgLmMmtUImV8fVvKsnvtHNOrLhvM3kG868NNbHishOrJwCZGMn01
 VVoPaaKPUhDES5vNL1VQdc478zN5hxNHTVweTN5+/hLdKv3gbhGhFOsl1tpzG6ZwObIqqSN50vIoo
 ZdBa6SetNLGFMcqF0feJZA==;
Date: Thu, 27 Mar 2025 20:24:54 +0200
Message-Id: <86jz8ababt.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Juri Linkov <juri@HIDDEN>
In-Reply-To: <87semywfkr.fsf@HIDDEN> (message from Juri Linkov on
 Thu, 27 Mar 2025 19:45:56 +0200)
Subject: Re: bug#77224: [PATCH] New minor mode 'cursor-indicators-mode'
References: <87iknzxski.fsf@HIDDEN> <87o6xq6fud.fsf@HIDDEN>
 <875xjymh93.fsf@HIDDEN> <87ikny2rio.fsf@HIDDEN>
 <86o6xpe2cx.fsf@HIDDEN> <87o6xobdcc.fsf@HIDDEN>
 <875xjwyzvt.fsf@HIDDEN> <8634f0dkhq.fsf@HIDDEN>
 <875xjvcn4o.fsf@HIDDEN> <877c4b81nk.fsf@HIDDEN>
 <86ecyidg2d.fsf@HIDDEN> <87h63ekdxe.fsf@HIDDEN>
 <86cye2d8t6.fsf@HIDDEN> <87a596a29y.fsf@HIDDEN>
 <86tt7ebfnc.fsf@HIDDEN> <877c4aa0m8.fsf@HIDDEN>
 <87semywfkr.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 77224
Cc: mail@HIDDEN, eg642616@HIDDEN, 77224 <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: Juri Linkov <juri@HIDDEN>
> Cc: Eli Zaretskii <eliz@HIDDEN>,  eg642616@HIDDEN,  77224 <at> debbugs.gnu.org
> Date: Thu, 27 Mar 2025 19:45:56 +0200
> 
> > I think Stefan and Juri should chime in with their experience about
> > this, since as I've seen, they both want to replace some custom cursor
> > code with the new mode in their configuration.
> 
> I tried the patch with 'run-with-idle-timer',
> and even the delay 0.1 is noticeable and causes
> the feeling that Emacs became sluggish
> and can't update the cursor immediately.

What about the delay of zero?




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

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


Received: (at 77224) by debbugs.gnu.org; 27 Mar 2025 18:00:16 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Mar 27 14:00:16 2025
Received: from localhost ([127.0.0.1]:51252 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1txrWZ-0006iU-RP
	for submit <at> debbugs.gnu.org; Thu, 27 Mar 2025 14:00:16 -0400
Received: from relay1-d.mail.gandi.net ([2001:4b98:dc4:8::221]:44827)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <juri@HIDDEN>) id 1txrWW-0006bG-Jg
 for 77224 <at> debbugs.gnu.org; Thu, 27 Mar 2025 14:00:13 -0400
Received: by mail.gandi.net (Postfix) with ESMTPSA id 860164433D;
 Thu, 27 Mar 2025 18:00:03 +0000 (UTC)
From: Juri Linkov <juri@HIDDEN>
To: Daniel Mendler <mail@HIDDEN>
Subject: Re: bug#77224: [PATCH] New minor mode 'cursor-indicators-mode'
In-Reply-To: <877c4aa0m8.fsf@HIDDEN>
Organization: LINKOV.NET
References: <87iknzxski.fsf@HIDDEN> <87o6xq6fud.fsf@HIDDEN>
 <875xjymh93.fsf@HIDDEN> <87ikny2rio.fsf@HIDDEN>
 <86o6xpe2cx.fsf@HIDDEN> <87o6xobdcc.fsf@HIDDEN>
 <875xjwyzvt.fsf@HIDDEN> <8634f0dkhq.fsf@HIDDEN>
 <875xjvcn4o.fsf@HIDDEN> <877c4b81nk.fsf@HIDDEN>
 <86ecyidg2d.fsf@HIDDEN> <87h63ekdxe.fsf@HIDDEN>
 <86cye2d8t6.fsf@HIDDEN> <87a596a29y.fsf@HIDDEN>
 <86tt7ebfnc.fsf@HIDDEN> <877c4aa0m8.fsf@HIDDEN>
Date: Thu, 27 Mar 2025 19:45:56 +0200
Message-ID: <87semywfkr.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/31.0.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain
X-GND-State: clean
X-GND-Score: -100
X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdduieeltdejucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuifetpfffkfdpucggtfgfnhhsuhgsshgtrhhisggvnecuuegrihhlohhuthemuceftddunecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvfevufgjohhffffkfgggtgesthdtredttdertdenucfhrhhomheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqeenucggtffrrghtthgvrhhnpeffgeetfeevlefhleejfeeuheeiudeitdffhfdutdekfeffgffhveehteegueekheenucfkphepledurdduvdelrddutdehrdduudejnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepledurdduvdelrddutdehrdduudejpdhhvghlohepmhgrihhlrdhgrghnughirdhnvghtpdhmrghilhhfrhhomhepjhhurhhisehlihhnkhhovhdrnhgvthdpnhgspghrtghpthhtohepgedprhgtphhtthhopeejjedvvdegseguvggssghughhsrdhgnhhurdhorhhgpdhrtghpthhtohepvghgieegvdeiudeisehgmhgrihhlrdgtohhmpdhrtghpthhtohepvghlihiisehgnhhurdhorhhgpdhrtghpthhtohepmhgrihhlsegurghnihgvlhdqmhgvnhgulhgvrhdruggv
X-GND-Sasl: juri@HIDDEN
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 77224
Cc: 77224 <at> debbugs.gnu.org, Eli Zaretskii <eliz@HIDDEN>, eg642616@HIDDEN
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 (-)

> I think Stefan and Juri should chime in with their experience about
> this, since as I've seen, they both want to replace some custom cursor
> code with the new mode in their configuration.

I tried the patch with 'run-with-idle-timer',
and even the delay 0.1 is noticeable and causes
the feeling that Emacs became sluggish
and can't update the cursor immediately.

So I'd prefer to use 'post-command-hook' that updates
the cursor immediately.  I already used this
for many years, and there were no problems.

As for adding more specific hooks, this is not simple to do
since the cursor color depends on the current buffer and
should be updated every time after switching to another buffer.
And even with adding it to the display-buffer hook
the complexity will explode.




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

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


Received: (at 77224) by debbugs.gnu.org; 27 Mar 2025 17:46:45 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Mar 27 13:46:45 2025
Received: from localhost ([127.0.0.1]:51219 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1txrJV-0005Og-1R
	for submit <at> debbugs.gnu.org; Thu, 27 Mar 2025 13:46:45 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:46028)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1txrJS-0005O9-P2
 for 77224 <at> debbugs.gnu.org; Thu, 27 Mar 2025 13:46: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 1txrJL-0006uB-NS; Thu, 27 Mar 2025 13:46:35 -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=5N86iZ5fOdK8Lx8vSj/fBLDvm5W9W4ICwgDg5QsJF9M=; b=RIcfGl1CYrKr9qVSSmoC
 z9ubBfwVmxEPlnw/ZSRx/C8d4V6080vbSKfOFaV/UaAV8QawijIVfDflM764ir5MxYVWlz0LAUjja
 TFqI+bRQKqbH4wyKCNJ7OTjYdfwDBbS/o4y5X8OMA/tgbJTp+710lLeSuc89AHeP50Kumw/DMsNfg
 53qK21bv+tu2GRM+MQmkj/2iyAdupAS6QEN+5dJVvjKV6bbcmfZCu4kLo9X6uNUKOsS0Wa0wnwiQN
 ChqsJrtg8lp/ZsYxLj5WIx00ruq+OIem23/pjqQV7Rq3++lVyWm0R7To/iRNJPZo74i9YoXqOnAL5
 +zP1oA5q4sPhfA==;
Date: Thu, 27 Mar 2025 19:46:34 +0200
Message-Id: <86msd6bc3p.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Elijah Gabe =?utf-8?Q?P=C3=A9rez?= <eg642616@HIDDEN>
In-Reply-To: <87zfh6z9g1.fsf@HIDDEN> (message from Elijah Gabe
 =?utf-8?Q?P=C3=A9rez?= on Thu, 27 Mar 2025 11:10:06 -0600)
Subject: Re: bug#77224: [PATCH] New minor mode 'cursor-indicators-mode'
References: <87iknzxski.fsf@HIDDEN> <87o6xq6fud.fsf@HIDDEN>
 <875xjymh93.fsf@HIDDEN> <87ikny2rio.fsf@HIDDEN>
 <86o6xpe2cx.fsf@HIDDEN> <87o6xobdcc.fsf@HIDDEN>
 <875xjwyzvt.fsf@HIDDEN> <8634f0dkhq.fsf@HIDDEN>
 <875xjvcn4o.fsf@HIDDEN> <877c4b81nk.fsf@HIDDEN>
 <86ecyidg2d.fsf@HIDDEN> <87h63ekdxe.fsf@HIDDEN>
 <86cye2d8t6.fsf@HIDDEN> <86a596d7l5.fsf@HIDDEN>
 <CACnP4NK+Zqgg3C3zFyBFi=dXVn=w-SOvtq9iJjfwbiP0K10-Hw@HIDDEN>
 <86y0wqbgwz.fsf@HIDDEN> <87zfh6z9g1.fsf@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 77224
Cc: mail@HIDDEN, 77224 <at> debbugs.gnu.org, juri@HIDDEN
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: Elijah Gabe Pérez <eg642616@HIDDEN>
> Cc: mail@HIDDEN,  juri@HIDDEN,  77224 <at> debbugs.gnu.org
> Date: Thu, 27 Mar 2025 11:10:06 -0600
> 
>  But what if user prefer using a lambda instead a function? For example for a specific mode or action
>  from a
>  key binding package such as evil or meow
> 
>  Sorry, I don't understand: what lambda? Aren't all the modes you want
>  to catch normal minor modes with a hook?
> 
> Not only minor mode, also functions (function symbols or anonymous ones).
> for example if user wants to change cursor appearance if a text at
> current cursor position have an overlay or whatever, can do it
> defining a function in their config:
> 
> (defun my/cursor-change ()
>   (string-prefix-p " *" (buffer-name)))
> 
> (setopt cursor-indicators-conditions `((my/cursor-change hollow "yellow")))
> 
> or
> 
> (setopt cursor-indicators-conditions `((,(lambda () (string-prefix-p " *" (buffer-name)))
>                                         hollow "yellow")))

We have buffer-list-update-hook and window-configuration-change-hook,
which I think should cover these.





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

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


Received: (at 77224) by debbugs.gnu.org; 27 Mar 2025 17:10:32 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Mar 27 13:10:32 2025
Received: from localhost ([127.0.0.1]:51136 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1txqkR-0007Ar-L8
	for submit <at> debbugs.gnu.org; Thu, 27 Mar 2025 13:10:32 -0400
Received: from mail-oi1-x243.google.com ([2607:f8b0:4864:20::243]:61697)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <eg642616@HIDDEN>)
 id 1txqkA-00072Z-Qb
 for 77224 <at> debbugs.gnu.org; Thu, 27 Mar 2025 13:10:18 -0400
Received: by mail-oi1-x243.google.com with SMTP id
 5614622812f47-3fa6c54cdb2so830183b6e.3
 for <77224 <at> debbugs.gnu.org>; Thu, 27 Mar 2025 10:10:14 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1743095409; x=1743700209; darn=debbugs.gnu.org;
 h=mime-version:user-agent:message-id:date:references:in-reply-to
 :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to;
 bh=pAr6HuZ30kpTiC+9rOTNNmm0ucFxb+umdhduVcSEUZo=;
 b=f8snBIGeDkt297uqb/rPR9PRHo7D31XxSTKXfa5VgTZHAMW3/wrpMvbg4k/iuLwnQK
 +Uo4ofkFmnK95gbOAh2ZKa+uTwREefHEc6JaBVUJILEjmJOO3+slaSxGwNoRtRyN1JrL
 eQ7kr7pwCGwRWwdOLBI8diZeFrr+DsLSopZTjI95jtLVbGHA1qsijADEr7qIq5+k+w6i
 2cZZjILzRZwvB0mZ7bzAHMxZgxkT9gUFBGfubsdfbBhU07wIL+R6IXi7VbY4UhvY1oti
 +Sx5BY04erQnopf2rizhLz+u9MGYKWtrTBmZdWAL7Ru049IxzvcA5gabj4lLqe2U5XbR
 EdTQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1743095409; x=1743700209;
 h=mime-version:user-agent:message-id:date:references:in-reply-to
 :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date
 :message-id:reply-to;
 bh=pAr6HuZ30kpTiC+9rOTNNmm0ucFxb+umdhduVcSEUZo=;
 b=mNJ9cHnLNMfC5EKaNTC9/K9DWnzr2T4uliBNHbozAJ+Go0ALcGBtQHA6Ml8Qhp2zqb
 xpzjxUJWFlLpc2GEfi4AqeX7ZeU46QlpM1enoX2T2lrMk3pyGD0ndHX+Ph4cK55hBbtl
 5lomvWm3vvBTgDd8NgMcmN4Aa4j71NKbDD6Qq6SthDUHcwBsISzbC2+eT5J33xeSgCfH
 N6IG36WpUuO3JoYHmrrmkdTJ5JH7rCR0OYu5752kNS82mhDR2V8VXJyx/dy0yMWvf9+a
 QZSxXeWKJdyHv38eKqsRCbI7DleNiBbdPeNbY1l/gbteevmJ/FZeKZh4mPkp4UoUa/vU
 fCyg==
X-Forwarded-Encrypted: i=1;
 AJvYcCVug1Ush69APpRS8L0EBGApIwCqXn5KHCisLRGwNcM8IuHXqrxSJMgjwH18DhY0rByDNVPv/A==@debbugs.gnu.org
X-Gm-Message-State: AOJu0YwnevfTu8vgGC7U9NPk0GefITCl7ZFwmeuns97Q3eagYljPIpI1
 tTPJ+15cHQ72jHM8RLPt4zOubwYViMChKo40ItWM4oNB1K6PdaoKlMAuQj5H
X-Gm-Gg: ASbGncs0+0RTIWEjoFAnfbhfZ991Cuj2YD1g31YtnMHGMsSJVdWHHL8+W/k2hkESYTt
 R2BeTxDYOgqmdUz8l9zGujf+ZGAzVz9HxVRNPoyUUiGcD79JYsfr9sM80f+tIUDvs5aYl8nmmeW
 6r7JrHekNmXN9Fsbbm9Ws52VwFLxKvSF1Ly4GFg3zZRNC9TGd5tKTXAF5j8k0zRRSN7WOstIU7z
 i6WK6/tMFZ7DubfHNwLKRKNk/UCtGnpSQmH3/qth1JifBjnfJJudPcSHpVi9r62GCrviOInKJfk
 GxFLz2ES4wno
X-Google-Smtp-Source: AGHT+IHwI/W/0AuTPfJXVTqTJDUtEUBjkly3f31RPEY1A2FcibWKcA1SEFXPC2gUzutwUlHPJWNv0Q==
X-Received: by 2002:a05:6808:1694:b0:3f7:d16c:e283 with SMTP id
 5614622812f47-3fefa5248c0mr2566957b6e.11.1743095408533; 
 Thu, 27 Mar 2025 10:10:08 -0700 (PDT)
Received: from fedora ([2806:10ae:e:5fce::1]) by smtp.gmail.com with ESMTPSA id
 006d021491bc7-602845008c9sm26043eaf.10.2025.03.27.10.10.07
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 27 Mar 2025 10:10:07 -0700 (PDT)
From: =?utf-8?Q?Elijah_Gabe_P=C3=A9rez?= <eg642616@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#77224: [PATCH] New minor mode 'cursor-indicators-mode'
In-Reply-To: <86y0wqbgwz.fsf@HIDDEN>
References: <87iknzxski.fsf@HIDDEN> <87o6xq6fud.fsf@HIDDEN>
 <875xjymh93.fsf@HIDDEN> <87ikny2rio.fsf@HIDDEN>
 <86o6xpe2cx.fsf@HIDDEN> <87o6xobdcc.fsf@HIDDEN>
 <875xjwyzvt.fsf@HIDDEN> <8634f0dkhq.fsf@HIDDEN>
 <875xjvcn4o.fsf@HIDDEN> <877c4b81nk.fsf@HIDDEN>
 <86ecyidg2d.fsf@HIDDEN> <87h63ekdxe.fsf@HIDDEN>
 <86cye2d8t6.fsf@HIDDEN> <86a596d7l5.fsf@HIDDEN>
 <CACnP4NK+Zqgg3C3zFyBFi=dXVn=w-SOvtq9iJjfwbiP0K10-Hw@HIDDEN>
 <86y0wqbgwz.fsf@HIDDEN>
Date: Thu, 27 Mar 2025 11:10:06 -0600
Message-ID: <87zfh6z9g1.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/31.0.50
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-Spam-Score: 0.3 (/)
X-Debbugs-Envelope-To: 77224
Cc: mail@HIDDEN, 77224 <at> debbugs.gnu.org, juri@HIDDEN
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.7 (/)

--=-=-=
Content-Type: multipart/alternative; boundary="==-=-="

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

Eli Zaretskii <eliz@HIDDEN> writes:

>> From: Elijah Gabe P=C3=A9rez <eg642616@HIDDEN>
>> Date: Thu, 27 Mar 2025 08:53:25 -0600
>> Cc: mail@HIDDEN, 77224 <at> debbugs.gnu.org,=20
>> 	Juri Linkov <juri@HIDDEN>

>> Eli Zaretskii <eliz@HIDDEN> writes:

>>  Btw, a possibly even better way is to modify the cursor looks from the
>>  hooks of the relevant commands, like overwrite-mode.  If some of them
>>  don't have a hook, we could add a hook.  This is better because it
>>  doesn't unnecessarily "punish" Emacs anywhere else, only the commands
>>  that could affect the cursor.

>> But what if user prefer using a lambda instead a function? For example f=
or a specific mode or action from a
>> key binding package such as evil or meow
> Sorry, I don't understand: what lambda?  Aren't all the modes you want
> to catch normal minor modes with a hook?

Not only minor mode, also functions (function symbols or anonymous ones).
for example if user wants to change cursor appearance if a text at
current cursor position have an overlay or whatever, can do it
defining a function in their config:

#+begin_src elisp
(defun my/cursor-change ()
  (string-prefix-p " *" (buffer-name)))

(setopt cursor-indicators-conditions `((my/cursor-change hollow "yellow")))
#+end_src

or

#+begin_src elisp
(setopt cursor-indicators-conditions `((,(lambda () (string-prefix-p " *" (=
buffer-name)))
                                        hollow "yellow")))
#+end_src

The current code only check if symbol is a variable or a function
symbol (since minor modes also defines a variable with same minor
mode name) or a lambda, and it must return =3Dnon-nil=3D.


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

<p>
Eli Zaretskii &lt;eliz@HIDDEN&gt; writes:<br />
</p>

<p>
<blockquote class=3D"gmail_quote" style=3D"border-left:#5555EE solid 0.2em;=
margin: 0em;padding-left: 0.85em;font-family: monospace;unicode-bidi: isola=
te;display: box;">

<div><blockquote class=3D"gmail_quote" style=3D"border-left:#5555EE solid 0=
.2em;margin: 0em;padding-left: 0.85em;font-family: monospace;unicode-bidi: =
isolate;display: box;">

<div>From: Elijah Gabe P=C3=A9rez &lt;eg642616@HIDDEN&gt;<br />
Date: Thu, 27 Mar 2025 08:53:25 -0600<br />
Cc: mail@HIDDEN, 77224 <at> debbugs.gnu.org,<br />
Juri Linkov &lt;juri@HIDDEN&gt;<br />

</div></blockquote>

</div></blockquote>
</p>

<p>
<blockquote class=3D"gmail_quote" style=3D"border-left:#5555EE solid 0.2em;=
margin: 0em;padding-left: 0.85em;font-family: monospace;unicode-bidi: isola=
te;display: box;">

<div><blockquote class=3D"gmail_quote" style=3D"border-left:#5555EE solid 0=
.2em;margin: 0em;padding-left: 0.85em;font-family: monospace;unicode-bidi: =
isolate;display: box;">

<div>Eli Zaretskii &lt;eliz@HIDDEN&gt; writes:<br />

</div></blockquote>

</div></blockquote>
</p>

<p>
<blockquote class=3D"gmail_quote" style=3D"border-left:#5555EE solid 0.2em;=
margin: 0em;padding-left: 0.85em;font-family: monospace;unicode-bidi: isola=
te;display: box;">

<div><blockquote class=3D"gmail_quote" style=3D"border-left:#5555EE solid 0=
.2em;margin: 0em;padding-left: 0.85em;font-family: monospace;unicode-bidi: =
isolate;display: box;">

<div>Btw, a possibly even better way is to modify the cursor looks from the=
<br />
hooks of the relevant commands, like overwrite-mode.  If some of them<br />
don't have a hook, we could add a hook.  This is better because it<br />
doesn't unnecessarily "punish" Emacs anywhere else, only the commands<br />
that could affect the cursor.<br />

</div></blockquote>

</div></blockquote>
</p>

<p>
<blockquote class=3D"gmail_quote" style=3D"border-left:#5555EE solid 0.2em;=
margin: 0em;padding-left: 0.85em;font-family: monospace;unicode-bidi: isola=
te;display: box;">

<div><blockquote class=3D"gmail_quote" style=3D"border-left:#5555EE solid 0=
.2em;margin: 0em;padding-left: 0.85em;font-family: monospace;unicode-bidi: =
isolate;display: box;">

<div>But what if user prefer using a lambda instead a function? For example=
 for a specific mode or action from a<br />
key binding package such as evil or meow<br />

</div></blockquote>
Sorry, I don't understand: what lambda?  Aren't all the modes you want<br />
to catch normal minor modes with a hook?<br />

</div></blockquote>
</p>

<p>
Not only minor mode, also functions (function symbols or anonymous ones).<b=
r />
for example if user wants to change cursor appearance if a text at<br />
current cursor position have an overlay or whatever, can do it<br />
defining a function in their config:<br />
</p>

<div class=3D"org-src-container">
<pre style=3D"color: #f8f8f2; background-color: #282a36; padding: 0.1em; bo=
rder-radius: 5px;" class=3D"src src-elisp"><span style=3D"color: #61bfff;">=
(</span><span style=3D"color: #ff79c6;">defun</span> <span style=3D"color: =
#50fa7b;">my/cursor-change</span> <span style=3D"color: #ff79c6;">()</span>
  <span style=3D"color: #ff79c6;">(</span>string-prefix-p <span style=3D"co=
lor: #f1fa8c;">" *"</span> <span style=3D"color: #50fa7b;">(</span>buffer-n=
ame<span style=3D"color: #50fa7b;">)</span><span style=3D"color: #ff79c6;">=
)</span><span style=3D"color: #61bfff;">)</span>

<span style=3D"color: #61bfff;">(</span><span style=3D"color: #ff79c6;">set=
opt</span> cursor-indicators-conditions `<span style=3D"color: #ff79c6;">(<=
/span><span style=3D"color: #50fa7b;">(</span>my/cursor-change hollow <span=
 style=3D"color: #f1fa8c;">"yellow"</span><span style=3D"color: #50fa7b;">)=
</span><span style=3D"color: #ff79c6;">)</span><span style=3D"color: #61bff=
f;">)</span>
</pre>
</div>

<p>
or<br />
</p>

<div class=3D"org-src-container">
<pre style=3D"color: #f8f8f2; background-color: #282a36; padding: 0.1em; bo=
rder-radius: 5px;" class=3D"src src-elisp"><span style=3D"color: #61bfff;">=
(</span><span style=3D"color: #ff79c6;">setopt</span> cursor-indicators-con=
ditions `<span style=3D"color: #ff79c6;">(</span><span style=3D"color: #50f=
a7b;">(</span>,<span style=3D"color: #bd93f9;">(</span><span style=3D"color=
: #ff79c6;">lambda</span> <span style=3D"color: #61bfff;">()</span> <span s=
tyle=3D"color: #61bfff;">(</span>string-prefix-p <span style=3D"color: #f1f=
a8c;">" *"</span> <span style=3D"color: #ff79c6;">(</span>buffer-name<span =
style=3D"color: #ff79c6;">)</span><span style=3D"color: #61bfff;">)</span><=
span style=3D"color: #bd93f9;">)</span>
                                        hollow <span style=3D"color: #f1fa8=
c;">"yellow"</span><span style=3D"color: #50fa7b;">)</span><span style=3D"c=
olor: #ff79c6;">)</span><span style=3D"color: #61bfff;">)</span>
</pre>
</div>

<p>
The current code only check if symbol is a variable or a function<br />
symbol (since minor modes also defines a variable with same minor<br />
mode name) or a lambda, and it must return <code>non-nil</code>.<br />
</p>

--==-=-=--

--=-=-=
Content-Type: text/plain



-- 
                                          - E.G via GNU Emacs and Org.

--=-=-=--




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

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


Received: (at 77224) by debbugs.gnu.org; 27 Mar 2025 16:56:35 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Mar 27 12:56:35 2025
Received: from localhost ([127.0.0.1]:51113 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1txqWw-0005io-0k
	for submit <at> debbugs.gnu.org; Thu, 27 Mar 2025 12:56:35 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:37904)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1txqWt-0005hy-Cr
 for 77224 <at> debbugs.gnu.org; Thu, 27 Mar 2025 12:56:31 -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 1txqWl-0008FR-P7; Thu, 27 Mar 2025 12:56:23 -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=8kfbPiaBz9uv83sIjKtvBAAfzbPZvxzKeIuybSLfolo=; b=KY07OtUwa+bK
 nugw655xZohK+PLdYpSCVXh2QShiRok1mX2zdoEUqXbXihZkmwWF3SYU2O96pRdim4YNJL9YcC0qW
 nvlXsOWM7BXJlutf7Ot2wcZPRCFAye8eyEBld8MIcOmD5go9fvJ8YSZYLdJh4yRGq6t3fZ1CBz7gv
 sT8d0KQNHdSsV/zlDtJZabsWcvzMxpCFruwddlw6uAG5IYpfcmAYjB1b7nSul27pUOKfWMFuCfNqP
 wvNo01kqFQ60klvquW4y99HoNzYrDO4yRoEu/4TRZQMBj8mCyjw6KpS65Bw6cPe46kXBsIIDThqyn
 tEJliBqjJLKcsT/FxMbTOQ==;
Date: Thu, 27 Mar 2025 18:56:21 +0200
Message-Id: <86pli2befe.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Daniel Mendler <mail@HIDDEN>
In-Reply-To: <877c4aa0m8.fsf@HIDDEN> (message from Daniel Mendler
 on Thu, 27 Mar 2025 17:39:59 +0100)
Subject: Re: bug#77224: [PATCH] New minor mode 'cursor-indicators-mode'
References: <87iknzxski.fsf@HIDDEN> <87o6xq6fud.fsf@HIDDEN>
 <875xjymh93.fsf@HIDDEN> <87ikny2rio.fsf@HIDDEN>
 <86o6xpe2cx.fsf@HIDDEN> <87o6xobdcc.fsf@HIDDEN>
 <875xjwyzvt.fsf@HIDDEN> <8634f0dkhq.fsf@HIDDEN>
 <875xjvcn4o.fsf@HIDDEN> <877c4b81nk.fsf@HIDDEN>
 <86ecyidg2d.fsf@HIDDEN> <87h63ekdxe.fsf@HIDDEN>
 <86cye2d8t6.fsf@HIDDEN> <87a596a29y.fsf@HIDDEN>
 <86tt7ebfnc.fsf@HIDDEN> <877c4aa0m8.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 77224
Cc: 77224 <at> debbugs.gnu.org, eg642616@HIDDEN, juri@HIDDEN
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: Daniel Mendler <mail@HIDDEN>
> Cc: eg642616@HIDDEN,  77224 <at> debbugs.gnu.org,  juri@HIDDEN
> Date: Thu, 27 Mar 2025 17:39:59 +0100
> 
> Eli Zaretskii <eliz@HIDDEN> writes:
> 
> > post-command-hook is run by the same loop that decides that Emacs is
> > idle and runs timers, so the difference in practice should be very
> > small if at all.
> 
> The `post-command-hook' is guaranteed to run after a command while the
> idle timer is delayed until no new events are in the queue.

No, the idle time is run immediately if there's no input.  Emacs
doesn't wait or delay the timer.

> > Anyway, I think making the cursor change from a mode hook is a better
> > solution.
> 
> As has been mentioned, the problem is that not every scenario is covered
> by hooks, while the PCH is a potentially universal solution which can
> check arbitrary conditions. But if hooks work sufficiently well for most
> scenarios, then why not.

If there are cases that this indication supports but there's no mode
hook for them, let's discuss those cases one by one and see how to
solve them.  I see overwrite-mode, read-only-mode, and input-method
activation, all of which have hooks, AFAIR.





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

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


Received: (at 77224) by debbugs.gnu.org; 27 Mar 2025 16:40:13 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Mar 27 12:40:12 2025
Received: from localhost ([127.0.0.1]:51073 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1txqH6-0003vO-6y
	for submit <at> debbugs.gnu.org; Thu, 27 Mar 2025 12:40:12 -0400
Received: from server.qxqx.de ([2a01:4f8:c012:9177::1]:34589 helo=mail.qxqx.de)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <mail@HIDDEN>)
 id 1txqH2-0003p3-Ks
 for 77224 <at> debbugs.gnu.org; Thu, 27 Mar 2025 12:40:10 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
 d=daniel-mendler.de; s=key; h=Content-Type:MIME-Version:Message-ID:Date:
 References:In-Reply-To:Subject:Cc:To:From:Sender:Reply-To:
 Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date:
 Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:
 List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=S7CASjzTyGJ5+hoYyjBAWTx6hXPwIc3E3j2BY2XgjB4=; b=NeG8sYr+y0KFd6HFaFgkFsD7wO
 DRv+wBdQ4KGYAeP2pXrH4Binlv9kNsN0WLuyg3i0n2XArKSgrmdcdvCNCGWGz1Oq3fMyL01SAnUsy
 taX64RALqCIZUe091Ma4ioVcqN13BEJAEI6TqyrET/r07TcRbIFzJ9TwVmZmRemWDd8Y=;
From: Daniel Mendler <mail@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#77224: [PATCH] New minor mode 'cursor-indicators-mode'
In-Reply-To: <86tt7ebfnc.fsf@HIDDEN> (Eli Zaretskii's message of "Thu, 27 Mar
 2025 18:29:59 +0200")
References: <87iknzxski.fsf@HIDDEN> <87o6xq6fud.fsf@HIDDEN>
 <875xjymh93.fsf@HIDDEN> <87ikny2rio.fsf@HIDDEN>
 <86o6xpe2cx.fsf@HIDDEN> <87o6xobdcc.fsf@HIDDEN>
 <875xjwyzvt.fsf@HIDDEN> <8634f0dkhq.fsf@HIDDEN>
 <875xjvcn4o.fsf@HIDDEN> <877c4b81nk.fsf@HIDDEN>
 <86ecyidg2d.fsf@HIDDEN> <87h63ekdxe.fsf@HIDDEN>
 <86cye2d8t6.fsf@HIDDEN> <87a596a29y.fsf@HIDDEN>
 <86tt7ebfnc.fsf@HIDDEN>
Date: Thu, 27 Mar 2025 17:39:59 +0100
Message-ID: <877c4aa0m8.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 77224
Cc: 77224 <at> debbugs.gnu.org, eg642616@HIDDEN, juri@HIDDEN
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.7 (-)

Eli Zaretskii <eliz@HIDDEN> writes:

>> From: Daniel Mendler <mail@HIDDEN>
>> Cc: eg642616@HIDDEN,  77224 <at> debbugs.gnu.org,  juri@HIDDEN
>> Date: Thu, 27 Mar 2025 17:04:09 +0100
>> 
>> Eli Zaretskii <eliz@HIDDEN> writes:
>> 
>> > I disagree that the cursor must change "immediately", in the rigorous
>> > sense of that word.  I think if it changes after 10 or 20 or 50
>> > milliseconds, that's "immediately" for any practical purpose.
>> 
>> No, 50ms are not acceptable for the user if they except an immediate
>> response to a key press.
>
> 50ms was just an example, and it is actually quite improbable to be
> that large.
>
> post-command-hook is run by the same loop that decides that Emacs is
> idle and runs timers, so the difference in practice should be very
> small if at all.

The `post-command-hook' is guaranteed to run after a command while the
idle timer is delayed until no new events are in the queue. This is why
I argue that the delay can be too large, such that it will become
noticeable.

>> Regarding Emacs sluggishness, the `cursor-indicators-mode' is an
>> optional mode. If it increases sluggishness unnacceptably (which it
>> won't), users can turn it off.
>
> Experience shows that many users turn on a lot of features which rely
> on post-command-hook, and then complain that Emacs is slow to respond.
> Telling them to turn off features they like doesn't really work.

I agree that this is a problem. However in this case the PCH will not
cause problems, as has also been noted by Drew and as has been shown by
CUA over the years. In contrast the idle timer will cause problems. I am
actually looking forward to using `cursor-indicators-mode', but if it
operates with an idle timer, I don't think it will indicate the editing
status reliably enough.

> Anyway, I think making the cursor change from a mode hook is a better
> solution.

As has been mentioned, the problem is that not every scenario is covered
by hooks, while the PCH is a potentially universal solution which can
check arbitrary conditions. But if hooks work sufficiently well for most
scenarios, then why not.

I think Stefan and Juri should chime in with their experience about
this, since as I've seen, they both want to replace some custom cursor
code with the new mode in their configuration.

Daniel




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

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


Received: (at 77224) by debbugs.gnu.org; 27 Mar 2025 16:30:19 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Mar 27 12:30:19 2025
Received: from localhost ([127.0.0.1]:51059 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1txq7W-0002jP-H4
	for submit <at> debbugs.gnu.org; Thu, 27 Mar 2025 12:30:19 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:60276)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1txq7P-0002di-GA
 for 77224 <at> debbugs.gnu.org; Thu, 27 Mar 2025 12:30:15 -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 1txq7H-0004sB-Rf; Thu, 27 Mar 2025 12:30:04 -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=cdG6dQqrFyPHrvjwgNRpqc6ZxyLSNFvWzUQoLWz2L4Q=; b=FluXTE3d9E6m
 Mn6mxFFjDAeAXjLAJjlf9y3t3YP38Kkz7NsqqAITxQyXpMFyDuz8rrlok2g+7SbAeabngYJ1b6leS
 Ed3GU5xc2KFIItDpOBDg3nLxzo9rn6WscGjVsar6jQwnX7Sq5HvONISWaS8EN8HRP7qBW5u5btE5f
 Cu21xZT9Qn4NlFZvSi6lboAaK9RTu+OcLoSPH56QC3LVA/XpZJnGE3MIDk0yzJr77RafCNrJgQ5X1
 C7BuzPEVLeECyu+AT0oSpcj0y1ZU8V3b4DRNUIVul/Obfn1RiCfhY0/I6XJgHt27IalFHNbC5MFYs
 1tIe77RenXe2E4XqV+wnUw==;
Date: Thu, 27 Mar 2025 18:29:59 +0200
Message-Id: <86tt7ebfnc.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Daniel Mendler <mail@HIDDEN>
In-Reply-To: <87a596a29y.fsf@HIDDEN> (message from Daniel Mendler
 on Thu, 27 Mar 2025 17:04:09 +0100)
Subject: Re: bug#77224: [PATCH] New minor mode 'cursor-indicators-mode'
References: <87iknzxski.fsf@HIDDEN> <87o6xq6fud.fsf@HIDDEN>
 <875xjymh93.fsf@HIDDEN> <87ikny2rio.fsf@HIDDEN>
 <86o6xpe2cx.fsf@HIDDEN> <87o6xobdcc.fsf@HIDDEN>
 <875xjwyzvt.fsf@HIDDEN> <8634f0dkhq.fsf@HIDDEN>
 <875xjvcn4o.fsf@HIDDEN> <877c4b81nk.fsf@HIDDEN>
 <86ecyidg2d.fsf@HIDDEN> <87h63ekdxe.fsf@HIDDEN>
 <86cye2d8t6.fsf@HIDDEN> <87a596a29y.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 77224
Cc: 77224 <at> debbugs.gnu.org, eg642616@HIDDEN, juri@HIDDEN
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: Daniel Mendler <mail@HIDDEN>
> Cc: eg642616@HIDDEN,  77224 <at> debbugs.gnu.org,  juri@HIDDEN
> Date: Thu, 27 Mar 2025 17:04:09 +0100
> 
> Eli Zaretskii <eliz@HIDDEN> writes:
> 
> > I disagree that the cursor must change "immediately", in the rigorous
> > sense of that word.  I think if it changes after 10 or 20 or 50
> > milliseconds, that's "immediately" for any practical purpose.
> 
> No, 50ms are not acceptable for the user if they except an immediate
> response to a key press.

50ms was just an example, and it is actually quite improbable to be
that large.

post-command-hook is run by the same loop that decides that Emacs is
idle and runs timers, so the difference in practice should be very
small if at all.

> Regarding Emacs sluggishness, the `cursor-indicators-mode' is an
> optional mode. If it increases sluggishness unnacceptably (which it
> won't), users can turn it off.

Experience shows that many users turn on a lot of features which rely
on post-command-hook, and then complain that Emacs is slow to respond.
Telling them to turn off features they like doesn't really work.

Anyway, I think making the cursor change from a mode hook is a better
solution.




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

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


Received: (at 77224) by debbugs.gnu.org; 27 Mar 2025 16:04:26 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Mar 27 12:04:25 2025
Received: from localhost ([127.0.0.1]:51006 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1txpiQ-0007bS-Jz
	for submit <at> debbugs.gnu.org; Thu, 27 Mar 2025 12:04:25 -0400
Received: from server.qxqx.de ([2a01:4f8:c012:9177::1]:53067 helo=mail.qxqx.de)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <mail@HIDDEN>)
 id 1txpiM-0007Zh-I3
 for 77224 <at> debbugs.gnu.org; Thu, 27 Mar 2025 12:04:20 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
 d=daniel-mendler.de; s=key; h=Content-Type:MIME-Version:Message-ID:Date:
 References:In-Reply-To:Subject:Cc:To:From:Sender:Reply-To:
 Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date:
 Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:
 List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=tqNVSYAhp3jy8ZjzelE5xoiWFxuzfkLq8XYxG88famM=; b=Wwo28GNR69lR/IPoTw6hywWdOM
 1pDC9hDLNWLlaH44+TkqYVtUyYQz1C5mTuLZd3kpGwX2H4+mnN+RUoG07E/k+PvIhZK7uOOdG85QL
 hcuE/85m4I/x96gFWu7kF6NGEMKznChYQ4J7aWvDK1g0CJt7edPtte00oI07ils9rlb8=;
From: Daniel Mendler <mail@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#77224: [PATCH] New minor mode 'cursor-indicators-mode'
In-Reply-To: <86cye2d8t6.fsf@HIDDEN> (Eli Zaretskii's message of "Thu, 27 Mar
 2025 13:14:45 +0200")
References: <87iknzxski.fsf@HIDDEN> <87o6xq6fud.fsf@HIDDEN>
 <875xjymh93.fsf@HIDDEN> <87ikny2rio.fsf@HIDDEN>
 <86o6xpe2cx.fsf@HIDDEN> <87o6xobdcc.fsf@HIDDEN>
 <875xjwyzvt.fsf@HIDDEN> <8634f0dkhq.fsf@HIDDEN>
 <875xjvcn4o.fsf@HIDDEN> <877c4b81nk.fsf@HIDDEN>
 <86ecyidg2d.fsf@HIDDEN> <87h63ekdxe.fsf@HIDDEN>
 <86cye2d8t6.fsf@HIDDEN>
Date: Thu, 27 Mar 2025 17:04:09 +0100
Message-ID: <87a596a29y.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 77224
Cc: 77224 <at> debbugs.gnu.org, eg642616@HIDDEN, juri@HIDDEN
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.7 (-)

Eli Zaretskii <eliz@HIDDEN> writes:

>> From: Daniel Mendler <mail@HIDDEN>
>> Cc: eg642616@HIDDEN,  77224 <at> debbugs.gnu.org,  juri@HIDDEN
>> Date: Thu, 27 Mar 2025 10:42:21 +0100
>> 
>> Eli Zaretskii <eliz@HIDDEN> writes:
>> 
>> >> The problem with the idle timer is that it might not run immediately.
>> >
>> > That depends on the value of the SECS argument to run-with-idle-timer,
>> > doesn't it.
>> 
>> No, there is no guarantee that the idle timer will run soon enough after
>> the given time if Emacs stays busy.
>
> If Emacs is busy, the post-command-hook will not run, either.  When a
> command exits, it return to the main loop, and unless the user types
> something before that, Emacs then becomes "idle".

There is a difference. When Emacs executes a command and hangs during
command execution it is expected that the cursor does not update
immediately. The cursor will however update after the command has
finished. The commands which we talk about regarding cursor changes are
usually executed quickly, like enabling some modes like `overwrite-mode'.

>> > Sorry, I object to adding stuff to post-command-hook in these cases.
>> > Emacs becomes very sluggish, and we should avoid that as much as we
>> > can.
>> 
>> I see your point about sluggishness and I am very careful myself to not
>> enable modes which add expensive computations to the
>> `post-command-hook'. Nevertheless in this case using the
>> `post-command-hook' is the right thing, such that the `cursor-type' is
>> changed effective immediately, as had been done before in CUA, see
>> `cua--post-command-handler-1'. The computation in this case is not
>> expensive.
>
> I disagree that the cursor must change "immediately", in the rigorous
> sense of that word.  I think if it changes after 10 or 20 or 50
> milliseconds, that's "immediately" for any practical purpose.

No, 50ms are not acceptable for the user if they except an immediate
response to a key press. I have seen bug reports to my packages where
people complained about latency in the range of 10 to 20ms.

The problem is also that idle timers are not bounded. If the user
continues on typing, Emacs won't become idle and the cursor can change
much later. This would look like a bug then.

Again - CUA also used a `post-command-hook'. Why not preserve this,
given that the mode is essentially extracted from CUA where it works
well? I see your point about using specialized hooks though (e.g.
`overwrite-mode-hook'), but this will make customization much more
difficult, and for some variables there might not be a hook.

Regarding Emacs sluggishness, the `cursor-indicators-mode' is an
optional mode. If it increases sluggishness unnacceptably (which it
won't), users can turn it off.

Daniel




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

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


Received: (at 77224) by debbugs.gnu.org; 27 Mar 2025 16:02:51 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Mar 27 12:02:51 2025
Received: from localhost ([127.0.0.1]:51002 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1txpgw-0007O9-SA
	for submit <at> debbugs.gnu.org; Thu, 27 Mar 2025 12:02:51 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:56028)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1txpgs-0007ML-OY
 for 77224 <at> debbugs.gnu.org; Thu, 27 Mar 2025 12:02:49 -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 1txpgl-0000tK-CO; Thu, 27 Mar 2025 12:02:39 -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=eQ0A8T3tuUHH5vv5sxh+XiUZUo/KqoyVsXSAgiq6vSg=; b=ZffZNs7Xt0D0vQLOpp1e
 9nzEfbc5kiF0Q+IZt1nndGdF98CLYamMwFlbQQeD30xVhkVez/77NXnMrLXfhFAV9e6Us7ykDNjBQ
 XVve656t9frUatqrzQMUFPgl3PwZHneciuDD4bWUjjg1s+on0+9i+aHXnWPBcxQRAf9qNOnE48Nf7
 eibvcJwu7Os7ExG39znxcr+R41VzXe1x9/DlH1+1ZSmKu7c8uc+HHEVXvC2O9aUIjNI21rlzXTSF8
 WnNQktRU6xe0fYVej3Pa+DbMCseMOJl6YPM9YTKtr0GQOzCg7fUAPAWFYS0KPIXCUUGtBcI3+BrAi
 patHfGsMKwD6Eg==;
Date: Thu, 27 Mar 2025 18:02:36 +0200
Message-Id: <86y0wqbgwz.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Elijah Gabe =?utf-8?Q?P=C3=A9rez?= <eg642616@HIDDEN>
In-Reply-To: <CACnP4NK+Zqgg3C3zFyBFi=dXVn=w-SOvtq9iJjfwbiP0K10-Hw@HIDDEN>
 (message from Elijah Gabe =?utf-8?Q?P=C3=A9rez?= on Thu, 27 Mar 2025
 08:53:25 -0600)
Subject: Re: bug#77224: [PATCH] New minor mode 'cursor-indicators-mode'
References: <87iknzxski.fsf@HIDDEN> <87o6xq6fud.fsf@HIDDEN>
 <875xjymh93.fsf@HIDDEN> <87ikny2rio.fsf@HIDDEN> <86o6xpe2cx.fsf@HIDDEN>
 <87o6xobdcc.fsf@HIDDEN> <875xjwyzvt.fsf@HIDDEN>
 <8634f0dkhq.fsf@HIDDEN> <875xjvcn4o.fsf@HIDDEN>
 <877c4b81nk.fsf@HIDDEN>
 <86ecyidg2d.fsf@HIDDEN> <87h63ekdxe.fsf@HIDDEN>
 <86cye2d8t6.fsf@HIDDEN> <86a596d7l5.fsf@HIDDEN>
 <CACnP4NK+Zqgg3C3zFyBFi=dXVn=w-SOvtq9iJjfwbiP0K10-Hw@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: 77224
Cc: mail@HIDDEN, juri@HIDDEN, 77224 <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: Elijah Gabe Pérez <eg642616@HIDDEN>
> Date: Thu, 27 Mar 2025 08:53:25 -0600
> Cc: mail@HIDDEN, 77224 <at> debbugs.gnu.org, 
> 	Juri Linkov <juri@HIDDEN>
> 
> Eli Zaretskii <eliz@HIDDEN> writes:
> 
>  Btw, a possibly even better way is to modify the cursor looks from the
>  hooks of the relevant commands, like overwrite-mode.  If some of them
>  don't have a hook, we could add a hook.  This is better because it
>  doesn't unnecessarily "punish" Emacs anywhere else, only the commands
>  that could affect the cursor.
> 
> But what if user prefer using a lambda instead a function? For example for a specific mode or action from a
> key binding package such as evil or meow

Sorry, I don't understand: what lambda?  Aren't all the modes you want
to catch normal minor modes with a hook?

> also i don't know if buffer-read-only have a proper hook.

read-only-mode does have a hook.




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

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


Received: (at 77224) by debbugs.gnu.org; 27 Mar 2025 15:45:57 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Mar 27 11:45:56 2025
Received: from localhost ([127.0.0.1]:50953 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1txpQZ-0004dl-J5
	for submit <at> debbugs.gnu.org; Thu, 27 Mar 2025 11:45:56 -0400
Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]:25384)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <drew.adams@HIDDEN>)
 id 1txpQW-0004d2-Ir
 for 77224 <at> debbugs.gnu.org; Thu, 27 Mar 2025 11:45:54 -0400
Received: from pps.filterd (m0246630.ppops.net [127.0.0.1])
 by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 52RFfrU0022236;
 Thu, 27 Mar 2025 15:45:48 GMT
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=cc
 :content-transfer-encoding:content-type:date:from:in-reply-to
 :message-id:mime-version:references:subject:to; s=
 corp-2023-11-20; bh=SPNhtk/4c2ztjTquh+9OI4zVfA0msckLaGRz+r7m1Cg=; b=
 Zt+zFUleSu0zXx1/NaApPnSlCZpZ9QAu3Nc1B4QSHNrJDSgw7ONFYYliu7ntflh2
 NvkEL/flTtzzmo9HIy7qJyBQpZj2mYOPPMyjXT/Zpvxvc+hDVvxZsLzyltu9QQ76
 i9zh+A5a05KbguQcaFWGePfcipeRgWm5C27vQ4WnC+lkdyVvrpIyzFf1ahADDprj
 HCdJ+PmhFIJUX+K9ZYVDnAB6W9t14ajsOoj4zNbD3pixgYNniU3TkCYIddPV90xZ
 TMgc9sYS6/mkqebNBndORB1A3CqqXrc9HpKGuzF47IyAGRu+bhuD0SzRPpGWeL59
 Uz/x2x05Y65bFusignx9DA==
Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com
 (iadpaimrmta03.appoci.oracle.com [130.35.103.27])
 by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 45hnd6cuck-1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK);
 Thu, 27 Mar 2025 15:45:48 +0000 (GMT)
Received: from pps.filterd
 (iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1])
 by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (8.18.1.2/8.18.1.2)
 with ESMTP id 52RFVQo3028708; Thu, 27 Mar 2025 15:45:47 GMT
Received: from nam02-sn1-obe.outbound.protection.outlook.com
 (mail-sn1nam02lp2046.outbound.protection.outlook.com [104.47.57.46])
 by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id
 45jj6vhvrb-1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK);
 Thu, 27 Mar 2025 15:45:47 +0000
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=WJI2HhSk+ew8DF3UVlbK2iptbP2CwWkHtPon780BEbYGjQf2S5wd1fE71qt0UdvX+kaO8EVTHOfBGEf9FzIuL53jTZ526ARoZI2SYkWCJxuUpfeCWb4381xbz7E6yZ/ul+hxA772kvkJ8NdUcB5w1EwfCmBTrfYTM4lo01EM8du7auuSj/qiu69eTdf+Bv2yWqdm/kldCpCTRYmRoeBdsdfm1MoAaFhVDTO71oeCpVAsnG64awcS2R0jJ1q5nJMl0EPdtCO6ASvqqArsLq37+WSRKI/Svp1Z3gDNuxC3Z1ZZ1rzrpvLK4iXIYzsc6zx9ttC+6VndmFrvaAHKSfW4VQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; 
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=SPNhtk/4c2ztjTquh+9OI4zVfA0msckLaGRz+r7m1Cg=;
 b=OQLUQrzf5CN1oGI+qYf7qISuHrrSRLOcueuIV2aO9g0a72FMWFOL2HZbfyo5m1AVSp/I20rEjIsrsQDxEIbpV5GJVEF8zluHEdns+4WgD6IingEWyt8k5yalksKbE3XsiL61D4T3oVZOsoLjk+Lhbh0Gqh83FT55qnLNpefwlPQylGu++RCZev34dvOPoiNgbjl3Nw/pzPckxEytIuhd+zzAvXZ7079etsnatga5kGeDVMoxs66umsghAs1sRRHPqXpPxM8RFxH0ateMCwV06AuztAlVNxXV0yYTX1/g/3R6jK/V2oPvVa+qkLNjY7FPD001Y7Rdv7gstR4EUTDRkA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com;
 dkim=pass header.d=oracle.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=SPNhtk/4c2ztjTquh+9OI4zVfA0msckLaGRz+r7m1Cg=;
 b=KAWzyjINm2VYA0W9m4u+wBiF8Bu+pb23nuchBAlKByMNl4E1A7wudiT5BDb2ZAopBaW887W3lXc9RPpuYaVN9s3YcVQPvV7YWrroY1NKPFWT4rC1ZBK/Rqua8t0pZQnDdGY+5pd0MpVWQg6fg220zm+Ak9F6H8FjlLNYNTsEz74=
Received: from DS7PR10MB5232.namprd10.prod.outlook.com (2603:10b6:5:3aa::24)
 by PH8PR10MB6315.namprd10.prod.outlook.com (2603:10b6:510:1ce::14) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8534.44; Thu, 27 Mar
 2025 15:45:45 +0000
Received: from DS7PR10MB5232.namprd10.prod.outlook.com
 ([fe80::8303:658f:14f8:2324]) by DS7PR10MB5232.namprd10.prod.outlook.com
 ([fe80::8303:658f:14f8:2324%5]) with mapi id 15.20.8534.043; Thu, 27 Mar 2025
 15:45:45 +0000
From: Drew Adams <drew.adams@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>, "mail@HIDDEN"
 <mail@HIDDEN>
Subject: RE: [External] : bug#77224: [PATCH] New minor mode
 'cursor-indicators-mode'
Thread-Topic: [External] : bug#77224: [PATCH] New minor mode
 'cursor-indicators-mode'
Thread-Index: AQHbnw1eQoMma3FWQ0OswldzO6qz5LOHHQ4Q
Date: Thu, 27 Mar 2025 15:45:44 +0000
Message-ID: <DS7PR10MB52326F98F2354808AD425838F3A12@HIDDEN>
References: <87iknzxski.fsf@HIDDEN> <87o6xq6fud.fsf@HIDDEN>
 <875xjymh93.fsf@HIDDEN> <87ikny2rio.fsf@HIDDEN>
 <86o6xpe2cx.fsf@HIDDEN> <87o6xobdcc.fsf@HIDDEN>
 <875xjwyzvt.fsf@HIDDEN> <8634f0dkhq.fsf@HIDDEN>
 <875xjvcn4o.fsf@HIDDEN> <877c4b81nk.fsf@HIDDEN>
 <86ecyidg2d.fsf@HIDDEN> <87h63ekdxe.fsf@HIDDEN>
 <86cye2d8t6.fsf@HIDDEN> <86a596d7l5.fsf@HIDDEN>
In-Reply-To: <86a596d7l5.fsf@HIDDEN>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: DS7PR10MB5232:EE_|PH8PR10MB6315:EE_
x-ms-office365-filtering-correlation-id: f7630142-444b-4f69-32df-08dd6d466ff7
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam: BCL:0; ARA:13230040|366016|376014|1800799024|38070700018;
x-microsoft-antispam-message-info: =?us-ascii?Q?fkdNRUZhBacVcEJGB2PsLoI3OrbK/Hmr7XZisvzaoDcG8hbugLSwyrGsdjcm?=
 =?us-ascii?Q?uuyDIfVlPuM3S8qWuGmPoVICETkxuzZncffYTpJHwxKJd9ycQ/jza8YdRvdl?=
 =?us-ascii?Q?UWlNkyRiETCewMIB4tbr78z3Yp427h3+6vQwi+G0YT3ZYr3VIaLrdw1dI8hM?=
 =?us-ascii?Q?XILtdl5INObf6YOxqwBbhNEzlMeJdfLg40Ux6enTuLBMII5HK1UiQ7lhgaOb?=
 =?us-ascii?Q?LBLKwbPUxDs4yys381uBKULoYe5gg/0qdjqz4ElPBiM0L3Bawxlwzz1AA2fK?=
 =?us-ascii?Q?pe4g1ESujuCMMOXPOIK9DAXM3ojjDO8pXt2sG2E86nZwDt5C/dmQ0AxsSIu2?=
 =?us-ascii?Q?Fbq+bv1kGgub1NhyVPzFvVGMXfvtu0GhpiebTLee86dDmRPmSeEQEandynGx?=
 =?us-ascii?Q?Oskie5vuk1MGSm1ldtDUtlr2S4WUCO2T5lgLINCcsL/fLE+NvVNCdCLO4H13?=
 =?us-ascii?Q?G6S4z9OLkkIaABw3l90CvVfFGKbInrrpxvbg4lFZJ37SvdCrp5RGrUbIBaoa?=
 =?us-ascii?Q?Y0z20Wh1QHWCTwBI0x0IDC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xuQ=3D=3D?=
x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:;
 IPV:NLI; SFV:NSPM; H:DS7PR10MB5232.namprd10.prod.outlook.com; PTR:; CAT:NONE;
 SFS:(13230040)(366016)(376014)(1800799024)(38070700018); DIR:OUT; SFP:1101; 
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?/Ms/TAy+MeK4YuND5+Peop+BkQVJWIWg4LL0iWcrD40Y93ceFQR9sRUKiXjX?=
 =?us-ascii?Q?z/oc+u4lOrt6BlsABDiSteijRZVfoSQlXBlTR9pT7wzn7uqwmPNgks1icrTs?=
 =?us-ascii?Q?yTKObszVRdYllSLgDt4s8iwGovoS+IS+QwnlbWFU1KVeCYJhk2hbzOkoEBWN?=
 =?us-ascii?Q?MdH5bCU/QAk/HAJUzlwpr7cmJgClZsmhBSmkOaK+16JGlGVnKpaIgMP4Sy8l?=
 =?us-ascii?Q?Mh89Hui3VzRmICyX9SGTUIC/hloaWxGIj0PfTVLoEBtt8wCDzbjos/OUlIeR?=
 =?us-ascii?Q?slSwmiK3TJuOGtcnqKMjq1w+KHaisnT5oHH+UqYvVUigjwCoAOEUx/4iBL/6?=
 =?us-ascii?Q?cxjAxv+0/5yCbREk3bfo4VDvzkbnAKhLrUvUjzBs8uEwd3gyOd1lpTv22pXP?=
 =?us-ascii?Q?lsuLu4/SURuN8OLPSPKhu42E7nX3YCXm7DcfdTrYrwGyAEOqFoYaWpfiULq5?=
 =?us-ascii?Q?U5qR6gV4rNGP/MX8vAFBq9o6JNKfTfTEynSvoCXqHup56BsDrfqm6x8CDSZY?=
 =?us-ascii?Q?JhB6VBHT4NdM5HY5bWtN3/VLdYKWTSH+R05UriAMQcn3WA8eZc4aErCieYYa?=
 =?us-ascii?Q?E9/xETakUcxrlx8FANfnNUuVPsDjCidqx/AklmA9v0KM7XXRaAJIY3P5R/oU?=
 =?us-ascii?Q?4XRnhigsTF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Ap6uyTfdHWokakiFnni6If8bX7lYeXTvfwf9+TAzK4?=
 =?us-ascii?Q?DFT8LswsjhkMh4Eaj5LxTykwRtHAYsT3coVNVy8R?=
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: UbeUEXNq6JjQ2hDBwEhBgiGRhqw5p2FZwK5MYFlnL9SodATrXNurV2LyycgzAkSGOe8bsgJuX+oTphDvBYZr2fABGXk9DG3I0MHhTOAR216KJRVyPohuHQT6ZYHoeuQl0j8VONV0gkQ4XsxzDGDCZfsf7s7iKfjqYtLOvwV+RVuIq76jHiJEwFdaMbvrNKkCBYCWvAznvE6IAZzQMgCpyWy0YzeSnzm8weyp+Yw+WcQvPIusEBxqnt8NhwnmtRTCfvXA/wqtx3Xsf74tg2CR2E3sjU1lxS8yKxj258leW5qRuAAZDzMwY2X/p7vg/LGiL1N8zglfpeBMO04jPBLN478TUaZf3WboHK/+6xFKr0Oxpot9myjMJdBU0qivi8PA3Z2bRwtq2o6tEllD9DIAB4LDA0juFOg/H+4m3WWvQggPZM1WDbUJCFmtz8wGHZMYHr4/zHvk3eGg3c0gFHOzSqD2g2+e61iFvEBuxG7Acn0mK5mB6gXOG3BwkPF6rOBAfJY8ts5TXG1GwMYdcI2JdweeCbDCFHKuLPPeNcx63wQ777T8VASRzj+m9qyIn9kS/vr8P2Q6fVFB2Ml3rtOkP2Ipva9Vh2XJZ9mvsbQjJjA=
X-OriginatorOrg: oracle.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: DS7PR10MB5232.namprd10.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: f7630142-444b-4f69-32df-08dd6d466ff7
X-MS-Exchange-CrossTenant-originalarrivaltime: 27 Mar 2025 15:45:45.0012 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: ACKzeG7ruEPCmn+q96IlmNETiWV3yds50zZVORYcH2EJ3hSaB/P7buDLI/93PjK6glOsQxjyalsEYQbXWmcRsQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH8PR10MB6315
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1095,Hydra:6.0.680,FMLib:17.12.68.34
 definitions=2025-03-27_02,2025-03-26_02,2024-11-22_01
X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0
 bulkscore=0 suspectscore=0
 adultscore=0 malwarescore=0 spamscore=0 mlxlogscore=999 mlxscore=0
 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2502280000
 definitions=main-2503270107
X-Proofpoint-ORIG-GUID: 95xZM2sZEUf8X-pHmg-UDOVqOOnVsWW-
X-Proofpoint-GUID: 95xZM2sZEUf8X-pHmg-UDOVqOOnVsWW-
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 77224
Cc: "77224 <at> debbugs.gnu.org" <77224 <at> debbugs.gnu.org>,
 "eg642616@HIDDEN" <eg642616@HIDDEN>, "juri@HIDDEN" <juri@HIDDEN>
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.7 (-)

> > > I see your point about sluggishness and I am very careful myself to n=
ot
> > > enable modes which add expensive computations to the
> > > `post-command-hook'. Nevertheless in this case using the
> > > `post-command-hook' is the right thing, such that the `cursor-type' i=
s
> > > changed effective immediately, as had been done before in CUA, see
> > > `cua--post-command-handler-1'. The computation in this case is not
> > > expensive.
> >
> > I disagree that the cursor must change "immediately", in the rigorous
> > sense of that word.  I think if it changes after 10 or 20 or 50
> > milliseconds, that's "immediately" for any practical purpose.
>=20
> Btw, a possibly even better way is to modify the cursor looks from the
> hooks of the relevant commands, like overwrite-mode.  If some of them
> don't have a hook, we could add a hook.  This is better because it
> doesn't unnecessarily "punish" Emacs anywhere else, only the commands
> that could affect the cursor.
>=20
> Does this make sense?

It does make sense, to me.
However, FWIW (haven't read all of this thread):

Based on input from Juri and others many moon ago, library `cursor-chg.el' =
has used pre(post)-command-hook since 2006 to optionally change the cursor =
shape for overwrite/read-only, idleness, and/or use of an input method. Min=
or mode `change-cursor-mode' does all but the idleness, which is done by `c=
urchg-toggle-cursor-when-idle'.

I agree with the general motivation not to overuse pre(post)-command-hook, =
but FWIW I haven't noticed any problems with the use made of it in this cas=
e.

https://www.emacswiki.org/emacs/ChangingCursorDynamically

https://www.emacswiki.org/emacs/download/cursor-chg.el





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

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


Received: (at 77224) by debbugs.gnu.org; 27 Mar 2025 14:53:51 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Mar 27 10:53:51 2025
Received: from localhost ([127.0.0.1]:50781 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1txoc8-0003tZ-T4
	for submit <at> debbugs.gnu.org; Thu, 27 Mar 2025 10:53:50 -0400
Received: from mail-qv1-xf41.google.com ([2607:f8b0:4864:20::f41]:61498)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <eg642616@HIDDEN>)
 id 1txoc4-0003sE-3t
 for 77224 <at> debbugs.gnu.org; Thu, 27 Mar 2025 10:53:47 -0400
Received: by mail-qv1-xf41.google.com with SMTP id
 6a1803df08f44-6e41e17645dso9781306d6.2
 for <77224 <at> debbugs.gnu.org>; Thu, 27 Mar 2025 07:53:44 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1743087218; x=1743692018; 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=wxY5BoFvWy+7xUdZC7oSpueOhpYjhebcTTrMgihzESQ=;
 b=BWbduz18b4NG4ljXcnG6mk2S3ZTkZpxLpUSvQziUa77zP5FKYzPuiN/Ij5cg7CHJxt
 1II9e2ynxy5NZG+QtNtppjAAvCZydDOYmthmx+5dR9LOsJMgk6xY9qu7plNsq/NITwVH
 gZqiN1gk+jM8+2nj+7xkuTG2IMQh6O9ajFnTpM9u1roxgUOuZg9nRfumBP32/u6JUuxo
 cjv2QLn5+cvfXwS4q23Oo4+x5poI2yEKdXl0qRyIwipM/sD4TQxY4yhvLcGN5OwhKkSs
 IjMB8wWKuK/x/vaxL5vmDaFwUS+MbWRLc4hkMUECN0lwvZEUdYC5pAm90w7nFpZM44d8
 4MFg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1743087218; x=1743692018;
 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=wxY5BoFvWy+7xUdZC7oSpueOhpYjhebcTTrMgihzESQ=;
 b=xF57rU8S7Ey5FwwaEk4EBXsvmN+YzuLMTWYdaRtD9iRLxRDj9OXPgSKI/Kv3sb8fPi
 CPU0eMGcerXRbAAw1iRguzfTkaW6qONAVIB8FrouAUmd/p0uskqDj+kDPu8mo5FkDx3n
 AqXwpjTaYg2n3VHGyne2j6YS1YDrFE4s016Ny/g+j8cw6QrMDTB+ONMeirIvyBnW649e
 81M88cN1kam6RbFIu/wcIeEKCazMRXaGtkvuEKOUe9ej9l2aEn1qBePrWB4+fX48oO66
 9CydAdO4ZPUC3Z6c9xmhCUrgwPm5oVlXqfIiEJG7qieXuREyPQI3Xnuh+UQoPyos3Z94
 npag==
X-Forwarded-Encrypted: i=1;
 AJvYcCWfhiCe9eCpAlNjZR9jkv4xZn3fLkz+yp01XfHeKHqg99b+cxtToFXz1x3rSRZDt4p4H3vssQ==@debbugs.gnu.org
X-Gm-Message-State: AOJu0Yw16Y5hVW59ismzXAgDT5SDSOt0vZ+BOtwLBTeJHOk8UsOeTHog
 Lw4N/k/y5m0QAuvG4uMEgsf1+OzkRMpA3EeIuoRtfHY3NeXhGfl7AKe4Pak4vq0NiNKVZnsOvrd
 B92ut9sqL2B5tNyC7OXFaD/BKe0METSJD
X-Gm-Gg: ASbGncsurjLP9Q/GlB/XZVbYc6dgaJtJanIqNUlrvXryKcgfi+DC9Qw3s3PYUhhLvrA
 8gZUN4G4gGGxyGNhc6idR9jacUWKQP2lqtdSBlrx2ZetEsz9P/93UBT3UONjKVjqaW5EBPc3itT
 fqM5pOtNX+nJaA+o/1GEYPqlgaUmDQocDJXiqS6pJdxUKsVIyZz5T1p0Y7
X-Google-Smtp-Source: AGHT+IH444NnQ1kevV6AHxSNe8D1hiLOHrQf25LJwCSNWUt+L1nAF6MlhxKnZkQTlcWD/068bzR44ppMzy0Pr6samLg=
X-Received: by 2002:a05:6214:5194:b0:6ea:d393:962c with SMTP id
 6a1803df08f44-6ed2390f966mr39958806d6.30.1743087218338; Thu, 27 Mar 2025
 07:53:38 -0700 (PDT)
MIME-Version: 1.0
References: <87iknzxski.fsf@HIDDEN> <87o6xq6fud.fsf@HIDDEN>
 <875xjymh93.fsf@HIDDEN> <87ikny2rio.fsf@HIDDEN> <86o6xpe2cx.fsf@HIDDEN>
 <87o6xobdcc.fsf@HIDDEN> <875xjwyzvt.fsf@HIDDEN>
 <8634f0dkhq.fsf@HIDDEN> <875xjvcn4o.fsf@HIDDEN>
 <877c4b81nk.fsf@HIDDEN>
 <86ecyidg2d.fsf@HIDDEN> <87h63ekdxe.fsf@HIDDEN>
 <86cye2d8t6.fsf@HIDDEN> <86a596d7l5.fsf@HIDDEN>
In-Reply-To: <86a596d7l5.fsf@HIDDEN>
From: =?UTF-8?Q?Elijah_Gabe_P=C3=A9rez?= <eg642616@HIDDEN>
Date: Thu, 27 Mar 2025 08:53:25 -0600
X-Gm-Features: AQ5f1JqqOGY0xQQ3wsEG8i-NFC8zquDwG8vIdKiyIhs8dwWTgSwUzZmNtqabvNE
Message-ID: <CACnP4NK+Zqgg3C3zFyBFi=dXVn=w-SOvtq9iJjfwbiP0K10-Hw@HIDDEN>
Subject: Re: bug#77224: [PATCH] New minor mode 'cursor-indicators-mode'
To: Eli Zaretskii <eliz@HIDDEN>
Content-Type: multipart/alternative; boundary="0000000000007634490631541e34"
X-Spam-Score: 0.3 (/)
X-Debbugs-Envelope-To: 77224
Cc: mail@HIDDEN, Juri Linkov <juri@HIDDEN>,
 77224 <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: -0.7 (/)

--0000000000007634490631541e34
Content-Type: text/plain; charset="UTF-8"

Eli Zaretskii <eliz@HIDDEN> writes:

> Btw, a possibly even better way is to modify the cursor looks from the
> hooks of the relevant commands, like overwrite-mode.  If some of them
> don't have a hook, we could add a hook.  This is better because it
> doesn't unnecessarily "punish" Emacs anywhere else, only the commands
> that could affect the cursor.
>

But what if user prefer using a lambda instead a function? For example for
a specific mode or action from a key binding package such as evil or meow,
also i don't know if buffer-read-only have a proper hook.

>

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

<div dir=3D"auto"><div><div class=3D"gmail_quote"><div dir=3D"ltr" class=3D=
"gmail_attr">Eli Zaretskii &lt;<a href=3D"mailto:eliz@HIDDEN" target=3D"_b=
lank" rel=3D"noreferrer">eliz@HIDDEN</a>&gt; writes:</div><blockquote clas=
s=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;pad=
ding-left:1ex">
Btw, a possibly even better way is to modify the cursor looks from the<br>
hooks of the relevant commands, like overwrite-mode.=C2=A0 If some of them<=
br>
don&#39;t have a hook, we could add a hook.=C2=A0 This is better because it=
<br>
doesn&#39;t unnecessarily &quot;punish&quot; Emacs anywhere else, only the =
commands<br>
that could affect the cursor.<br></blockquote></div></div><div dir=3D"auto"=
><br></div><div dir=3D"auto">But what if user prefer using a lambda instead=
 a function? For example for a specific mode or action from a key binding p=
ackage such as evil or meow, also i don&#39;t know if buffer-read-only have=
 a proper hook.</div><div dir=3D"auto"><div class=3D"gmail_quote"><blockquo=
te class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc so=
lid;padding-left:1ex"></blockquote></div></div><div dir=3D"auto"><div class=
=3D"gmail_quote"><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8=
ex;border-left:1px #ccc solid;padding-left:1ex">
</blockquote></div></div></div>

--0000000000007634490631541e34--




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

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


Received: (at 77224) by debbugs.gnu.org; 27 Mar 2025 11:41:26 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Mar 27 07:41:26 2025
Received: from localhost ([127.0.0.1]:47861 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1txlby-00033H-0P
	for submit <at> debbugs.gnu.org; Thu, 27 Mar 2025 07:41:26 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:51708)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1txlbs-00032N-K4
 for 77224 <at> debbugs.gnu.org; Thu, 27 Mar 2025 07:41:24 -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 1txlbl-0000M2-Uo; Thu, 27 Mar 2025 07:41:13 -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=s61E38v8kGhUvYGkbehDbKjxf4DWECI333URkFAAPvI=; b=p1Vp4Cy34woy
 K+VWr4eg+t2isml6RlLvsVHGzdcWBGkxRSdVG7xp5ksmzg6gDYG/7sTxCvgyFg5ElvEhd/G0XzUY7
 mbgCrffgC5aQXerNF8iEoD+lql2W4oJDO7tZs8ba8Ob3WVYHglDjX5q0aWOyX/J/LRYkyrNOKhDdq
 3/DFAaFc7zuO5D2onR0gdqg5jmQQq1yTaFtw7Sdpx79WjLwPgV7oZ/j8vMmqKJzk/xwPyhWcVTuw1
 0C3iKl9rtBob6svgaCUW5hn8YkYnPqeV+10HL2AbujjxRCEp07/VBXzKiUJaIJ0FByHZn8Nb1nLGl
 ILtnUC+R4YtBCRSWAAzh8g==;
Date: Thu, 27 Mar 2025 13:41:10 +0200
Message-Id: <86a596d7l5.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: mail@HIDDEN
In-Reply-To: <86cye2d8t6.fsf@HIDDEN> (message from Eli Zaretskii on Thu, 27
 Mar 2025 13:14:45 +0200)
Subject: Re: bug#77224: [PATCH] New minor mode 'cursor-indicators-mode'
References: <87iknzxski.fsf@HIDDEN> <87o6xq6fud.fsf@HIDDEN>
 <875xjymh93.fsf@HIDDEN> <87ikny2rio.fsf@HIDDEN>
 <86o6xpe2cx.fsf@HIDDEN> <87o6xobdcc.fsf@HIDDEN>
 <875xjwyzvt.fsf@HIDDEN> <8634f0dkhq.fsf@HIDDEN>
 <875xjvcn4o.fsf@HIDDEN> <877c4b81nk.fsf@HIDDEN>
 <86ecyidg2d.fsf@HIDDEN> <87h63ekdxe.fsf@HIDDEN>
 <86cye2d8t6.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 77224
Cc: 77224 <at> debbugs.gnu.org, eg642616@HIDDEN, juri@HIDDEN
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 (---)

> Cc: 77224 <at> debbugs.gnu.org, eg642616@HIDDEN, juri@HIDDEN
> Date: Thu, 27 Mar 2025 13:14:45 +0200
> From: Eli Zaretskii <eliz@HIDDEN>
> 
> > I see your point about sluggishness and I am very careful myself to not
> > enable modes which add expensive computations to the
> > `post-command-hook'. Nevertheless in this case using the
> > `post-command-hook' is the right thing, such that the `cursor-type' is
> > changed effective immediately, as had been done before in CUA, see
> > `cua--post-command-handler-1'. The computation in this case is not
> > expensive.
> 
> I disagree that the cursor must change "immediately", in the rigorous
> sense of that word.  I think if it changes after 10 or 20 or 50
> milliseconds, that's "immediately" for any practical purpose.

Btw, a possibly even better way is to modify the cursor looks from the
hooks of the relevant commands, like overwrite-mode.  If some of them
don't have a hook, we could add a hook.  This is better because it
doesn't unnecessarily "punish" Emacs anywhere else, only the commands
that could affect the cursor.

Does this make sense?




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

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


Received: (at 77224) by debbugs.gnu.org; 27 Mar 2025 11:14:58 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Mar 27 07:14:58 2025
Received: from localhost ([127.0.0.1]:47782 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1txlCL-0003qc-Uv
	for submit <at> debbugs.gnu.org; Thu, 27 Mar 2025 07:14:58 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:34434)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1txlCI-0003pN-M5
 for 77224 <at> debbugs.gnu.org; Thu, 27 Mar 2025 07:14:55 -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 1txlCB-0004Yy-VC; Thu, 27 Mar 2025 07:14:47 -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=b5bJ1yCqygWpnDQ8Zy0f85l7OqNBSAimReiII1hpNzQ=; b=n1vb2FX9v0Ea
 96gDao7wgDPkS7z8HH+vm0fqQbW1fks+vhYvh6GGGLu6CbRdAj8kFBUTjvyIbwG7LzkYSbozolI9z
 i3mG7yG38npDkJJtgf3BGgs1qJr/kl7bpMRzm0TyupARFG8LBOh4h8uE5sLcFqJDCX2wtJetSrluF
 VjC9YTcgfZoJjcKQVPvn0VhTgGA6IzA1DzgZDd6CY3KGLv9EYHokG91zW77X8ElLLeiM6RJOhadRg
 opm2rQPjuL+vM3WLzvNW/ADcH74/1P4DCP8oHp2+EjlPjyEY6tNGlN1mLJMUnyWNJhPykw4KNeFqk
 rnt9PAejwXeAxVcFdQMppw==;
Date: Thu, 27 Mar 2025 13:14:45 +0200
Message-Id: <86cye2d8t6.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Daniel Mendler <mail@HIDDEN>
In-Reply-To: <87h63ekdxe.fsf@HIDDEN> (message from Daniel Mendler
 on Thu, 27 Mar 2025 10:42:21 +0100)
Subject: Re: bug#77224: [PATCH] New minor mode 'cursor-indicators-mode'
References: <87iknzxski.fsf@HIDDEN> <87o6xq6fud.fsf@HIDDEN>
 <875xjymh93.fsf@HIDDEN> <87ikny2rio.fsf@HIDDEN>
 <86o6xpe2cx.fsf@HIDDEN> <87o6xobdcc.fsf@HIDDEN>
 <875xjwyzvt.fsf@HIDDEN> <8634f0dkhq.fsf@HIDDEN>
 <875xjvcn4o.fsf@HIDDEN> <877c4b81nk.fsf@HIDDEN>
 <86ecyidg2d.fsf@HIDDEN> <87h63ekdxe.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 77224
Cc: 77224 <at> debbugs.gnu.org, eg642616@HIDDEN, juri@HIDDEN
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: Daniel Mendler <mail@HIDDEN>
> Cc: eg642616@HIDDEN,  77224 <at> debbugs.gnu.org,  juri@HIDDEN
> Date: Thu, 27 Mar 2025 10:42:21 +0100
> 
> Eli Zaretskii <eliz@HIDDEN> writes:
> 
> >> The problem with the idle timer is that it might not run immediately.
> >
> > That depends on the value of the SECS argument to run-with-idle-timer,
> > doesn't it.
> 
> No, there is no guarantee that the idle timer will run soon enough after
> the given time if Emacs stays busy.

If Emacs is busy, the post-command-hook will not run, either.  When a
command exits, it return to the main loop, and unless the user types
something before that, Emacs then becomes "idle".

> > Sorry, I object to adding stuff to post-command-hook in these cases.
> > Emacs becomes very sluggish, and we should avoid that as much as we
> > can.
> 
> I see your point about sluggishness and I am very careful myself to not
> enable modes which add expensive computations to the
> `post-command-hook'. Nevertheless in this case using the
> `post-command-hook' is the right thing, such that the `cursor-type' is
> changed effective immediately, as had been done before in CUA, see
> `cua--post-command-handler-1'. The computation in this case is not
> expensive.

I disagree that the cursor must change "immediately", in the rigorous
sense of that word.  I think if it changes after 10 or 20 or 50
milliseconds, that's "immediately" for any practical purpose.




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

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


Received: (at 77224) by debbugs.gnu.org; 27 Mar 2025 09:42:32 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Mar 27 05:42:32 2025
Received: from localhost ([127.0.0.1]:47581 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1txjku-0005mS-0V
	for submit <at> debbugs.gnu.org; Thu, 27 Mar 2025 05:42:32 -0400
Received: from server.qxqx.de ([2a01:4f8:c012:9177::1]:39307 helo=mail.qxqx.de)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <mail@HIDDEN>)
 id 1txjks-0005lE-6i
 for 77224 <at> debbugs.gnu.org; Thu, 27 Mar 2025 05:42:30 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
 d=daniel-mendler.de; s=key; h=Content-Transfer-Encoding:Content-Type:
 MIME-Version:Message-ID:Date:References:In-Reply-To:Subject:Cc:To:From:Sender
 :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:
 Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:
 List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=3b2vce8KPq8hoMoKIGGRdnMviQtP3LYVEmCHxjTdf94=; b=iWa1PC1LHV9z8OMF2skU6yQHf4
 rBXUHj8KHcy9+WXu/zsdZtINT3/4gfWHw3yekfcrME3piAXPxKpspWMfdEmouoNt0X3YsPBerTwAo
 Tep/qbxheVWAZb3cLnJoWtdUzIDSsnvW8MiuKv2riwi4sEjvFJSBa+tQTwa+4g6YQ9Ds=;
From: Daniel Mendler <mail@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#77224: [PATCH] New minor mode 'cursor-indicators-mode'
In-Reply-To: <86ecyidg2d.fsf@HIDDEN> (Eli Zaretskii's message of "Thu, 27 Mar
 2025 10:38:02 +0200")
References: <87iknzxski.fsf@HIDDEN> <87o6xq6fud.fsf@HIDDEN>
 <875xjymh93.fsf@HIDDEN> <87ikny2rio.fsf@HIDDEN>
 <86o6xpe2cx.fsf@HIDDEN> <87o6xobdcc.fsf@HIDDEN>
 <875xjwyzvt.fsf@HIDDEN> <8634f0dkhq.fsf@HIDDEN>
 <875xjvcn4o.fsf@HIDDEN> <877c4b81nk.fsf@HIDDEN>
 <86ecyidg2d.fsf@HIDDEN>
Date: Thu, 27 Mar 2025 10:42:21 +0100
Message-ID: <87h63ekdxe.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 77224
Cc: 77224 <at> debbugs.gnu.org, eg642616@HIDDEN, juri@HIDDEN
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.7 (-)

Eli Zaretskii <eliz@HIDDEN> writes:

>> From: Daniel Mendler <mail@HIDDEN>
>> Cc: Eli Zaretskii <eliz@HIDDEN>,  77224 <at> debbugs.gnu.org,  Juri Linkov
>>  <juri@HIDDEN>
>> Date: Thu, 27 Mar 2025 06:48:15 +0100
>>=20
>> Elijah Gabe P=C3=A9rez <eg642616@HIDDEN> writes:
>>=20
>> >> Would it be better to use an idle timer instead?  post-command-hook
>> >> tends to make Emacs sluggish.
>> >
>> > Yeah, that is that what worried me when i decided to use that hook.
>> >
>> > I've fixed the patch to use only idle-timer instead.
>>=20
>> The problem with the idle timer is that it might not run immediately.
>
> That depends on the value of the SECS argument to run-with-idle-timer,
> doesn't it.

No, there is no guarantee that the idle timer will run soon enough after
the given time if Emacs stays busy.

>> However when the user changes the input method, overwrite mode or
>> similar, the users expects that the cursor reflects the change
>> immediately after the last key press and does not lag behind. Therefore
>> I think there is no alternative to the `post-command-hook'. It seems to
>> me that only a bunch of mode variables are checked and then
>> `cursor-type' is set. In CUA the cursor indicator is also updated in the
>> `post-command-hook'. So this should not be too costly?
>
> Sorry, I object to adding stuff to post-command-hook in these cases.
> Emacs becomes very sluggish, and we should avoid that as much as we
> can.

I see your point about sluggishness and I am very careful myself to not
enable modes which add expensive computations to the
`post-command-hook'. Nevertheless in this case using the
`post-command-hook' is the right thing, such that the `cursor-type' is
changed effective immediately, as had been done before in CUA, see
`cua--post-command-handler-1'. The computation in this case is not
expensive.

Daniel




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

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


Received: (at 77224) by debbugs.gnu.org; 27 Mar 2025 08:38:17 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Mar 27 04:38:17 2025
Received: from localhost ([127.0.0.1]:47352 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1txiki-0000vZ-Ef
	for submit <at> debbugs.gnu.org; Thu, 27 Mar 2025 04:38:17 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:50958)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1txike-0000uI-Ky
 for 77224 <at> debbugs.gnu.org; Thu, 27 Mar 2025 04:38:13 -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 1txikX-000265-Sc; Thu, 27 Mar 2025 04:38:05 -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=5beOnUPrzxOJny3vZrylTsXbRXsKu5oR0Z1q9CA1duA=; b=I0kio0m2kP21jszBdOnY
 jGJVHjYtr3u/aT+XM04QGHvXj5eqEzjotICnXFq8kMEJVC6DSI4zT6nhsl74fkl3Y6qJKRivGMz62
 Zf2tH77YcFK1vCB34SlXyVevm4ln5Fv7GBm1aliXhOpQVu1fWdoA6fJwxtuN6CCfuBPvIhCP5iRBk
 RJ1MBr/AhZCY8lHaDhQEtgj6bRheZbicObda5dUie5TXN33gFxRkSRQbpzhn8nlW8H0vxRQYiwGLM
 IDkdhoqsR0AzOIw69dBVETVKtBq/hmEYJePUz0uJuMN220roZMdmSQQT4Z0FQNVzgPFdhqdJX4Iwc
 HOm4MlkS3oJdsQ==;
Date: Thu, 27 Mar 2025 10:38:02 +0200
Message-Id: <86ecyidg2d.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Daniel Mendler <mail@HIDDEN>
In-Reply-To: <877c4b81nk.fsf@HIDDEN> (message from Daniel Mendler
 on Thu, 27 Mar 2025 06:48:15 +0100)
Subject: Re: bug#77224: [PATCH] New minor mode 'cursor-indicators-mode'
References: <87iknzxski.fsf@HIDDEN> <87o6xq6fud.fsf@HIDDEN>
 <875xjymh93.fsf@HIDDEN> <87ikny2rio.fsf@HIDDEN>
 <86o6xpe2cx.fsf@HIDDEN> <87o6xobdcc.fsf@HIDDEN>
 <875xjwyzvt.fsf@HIDDEN> <8634f0dkhq.fsf@HIDDEN>
 <875xjvcn4o.fsf@HIDDEN> <877c4b81nk.fsf@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 77224
Cc: 77224 <at> debbugs.gnu.org, eg642616@HIDDEN, juri@HIDDEN
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: Daniel Mendler <mail@HIDDEN>
> Cc: Eli Zaretskii <eliz@HIDDEN>,  77224 <at> debbugs.gnu.org,  Juri Linkov
>  <juri@HIDDEN>
> Date: Thu, 27 Mar 2025 06:48:15 +0100
> 
> Elijah Gabe Pérez <eg642616@HIDDEN> writes:
> 
> >> Would it be better to use an idle timer instead?  post-command-hook
> >> tends to make Emacs sluggish.
> >
> > Yeah, that is that what worried me when i decided to use that hook.
> >
> > I've fixed the patch to use only idle-timer instead.
> 
> The problem with the idle timer is that it might not run immediately.

That depends on the value of the SECS argument to run-with-idle-timer,
doesn't it.

> However when the user changes the input method, overwrite mode or
> similar, the users expects that the cursor reflects the change
> immediately after the last key press and does not lag behind. Therefore
> I think there is no alternative to the `post-command-hook'. It seems to
> me that only a bunch of mode variables are checked and then
> `cursor-type' is set. In CUA the cursor indicator is also updated in the
> `post-command-hook'. So this should not be too costly?

Sorry, I object to adding stuff to post-command-hook in these cases.
Emacs becomes very sluggish, and we should avoid that as much as we
can.




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

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


Received: (at 77224) by debbugs.gnu.org; 27 Mar 2025 05:48:28 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Mar 27 01:48:27 2025
Received: from localhost ([127.0.0.1]:46749 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1txg6M-0006kf-6R
	for submit <at> debbugs.gnu.org; Thu, 27 Mar 2025 01:48:27 -0400
Received: from server.qxqx.de ([2a01:4f8:c012:9177::1]:55919 helo=mail.qxqx.de)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <mail@HIDDEN>)
 id 1txg6J-0006jO-Ew
 for 77224 <at> debbugs.gnu.org; Thu, 27 Mar 2025 01:48:25 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
 d=daniel-mendler.de; s=key; h=Content-Transfer-Encoding:Content-Type:
 MIME-Version:Message-ID:Date:References:In-Reply-To:Subject:Cc:To:From:Sender
 :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:
 Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:
 List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=AWiZdf+esAl3vmTRbB6BYnk6udggjyh6gtZXwNdUBSU=; b=pzFPZ2L7karvvmwr8IzO5qx/m7
 LGh9bSaZ3UKNDE0cofkn580Uu+ROyNkQGzpjZ8dofwV34I6aiF+vvZFjca5rEF5O5FXZW/HVNfNRr
 W52MKNAs5u4EtCRS0855iFb/nNQslnD2jfU0PZHvjkSOxfHbKfRVz1+4sYqofX0gO+nE=;
From: Daniel Mendler <mail@HIDDEN>
To: Elijah Gabe =?utf-8?Q?P=C3=A9rez?= <eg642616@HIDDEN>
Subject: Re: bug#77224: [PATCH] New minor mode 'cursor-indicators-mode'
In-Reply-To: <875xjvcn4o.fsf@HIDDEN> ("Elijah Gabe =?utf-8?Q?P=C3=A9rez?=
 =?utf-8?Q?=22's?= message of "Wed, 26 Mar 2025 18:50:47 -0600")
References: <87iknzxski.fsf@HIDDEN> <87o6xq6fud.fsf@HIDDEN>
 <875xjymh93.fsf@HIDDEN> <87ikny2rio.fsf@HIDDEN>
 <86o6xpe2cx.fsf@HIDDEN> <87o6xobdcc.fsf@HIDDEN>
 <875xjwyzvt.fsf@HIDDEN> <8634f0dkhq.fsf@HIDDEN>
 <875xjvcn4o.fsf@HIDDEN>
Date: Thu, 27 Mar 2025 06:48:15 +0100
Message-ID: <877c4b81nk.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 77224
Cc: 77224 <at> debbugs.gnu.org, Eli Zaretskii <eliz@HIDDEN>,
 Juri Linkov <juri@HIDDEN>
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.7 (-)

Elijah Gabe P=C3=A9rez <eg642616@HIDDEN> writes:

> Eli Zaretskii <eliz@HIDDEN> writes:
>
>>> From: Juri Linkov <juri@HIDDEN>
>>> Cc: Eli Zaretskii <eliz@HIDDEN>,  77224 <at> debbugs.gnu.org
>>> Date: Wed, 26 Mar 2025 09:58:06 +0200
>
>>> > I've updated the patch following Juri suggestions.
>>> > Now all the conditions are inside a single defcustom.
>
>>> Thanks!  I tested that everything works nicely.
>>> There is only one small problem for repeat-mode:
>
>>> > +        (add-hook 'post-command-hook #'cursor-indicators--update-ind=
ications)
>
>>> It would be better to use a large value DEPTH for add-hook
>>> to add the hook to the end.  The problem is that repeat-mode
>>> also uses the same hook 'post-command-hook'.  So the cursor
>>> indication hook should be called afterwards as the last hook.
>
>> Would it be better to use an idle timer instead?  post-command-hook
>> tends to make Emacs sluggish.
>
> Yeah, that is that what worried me when i decided to use that hook.
>
> I've fixed the patch to use only idle-timer instead.

The problem with the idle timer is that it might not run immediately.
However when the user changes the input method, overwrite mode or
similar, the users expects that the cursor reflects the change
immediately after the last key press and does not lag behind. Therefore
I think there is no alternative to the `post-command-hook'. It seems to
me that only a bunch of mode variables are checked and then
`cursor-type' is set. In CUA the cursor indicator is also updated in the
`post-command-hook'. So this should not be too costly?

Daniel




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

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


Received: (at 77224) by debbugs.gnu.org; 27 Mar 2025 02:52:29 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Mar 26 22:52:29 2025
Received: from localhost ([127.0.0.1]:45668 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1txdM3-0005VF-LF
	for submit <at> debbugs.gnu.org; Wed, 26 Mar 2025 22:52:29 -0400
Received: from mail-oo1-xc41.google.com ([2607:f8b0:4864:20::c41]:53714)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <eg642616@HIDDEN>)
 id 1txdM0-0005Ti-0e
 for 77224 <at> debbugs.gnu.org; Wed, 26 Mar 2025 22:52:25 -0400
Received: by mail-oo1-xc41.google.com with SMTP id
 006d021491bc7-601b1132110so332449eaf.3
 for <77224 <at> debbugs.gnu.org>; Wed, 26 Mar 2025 19:52:23 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1743043938; x=1743648738; darn=debbugs.gnu.org;
 h=mime-version:user-agent:message-id:date:references:in-reply-to
 :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to;
 bh=2bHIyP0JWXA/qlab1DPj+VlansYYd2gz7avX0f/NNVI=;
 b=blrr7cOHEjonOwwsKA2nrlm7UMLwy93Yr98Bd4konIYlE1Tp7O5fSkvbTFRk/3voEA
 tLWdKEc3sBsU0x2qyl6mA2RL8r/cbihSQ7SNvqmWd3WbuylX7BNEFty8gJm05eZumLCB
 tBxJzFvGMDL+i1yN36QfJTQAy+L8WnZFIajfkbSD9WZfUlMw18k/BF02k+i1Dm+jrXlj
 QAirIA7WmieRpboZECgG8cpTtM/XcpmP3Q5qpyRZZHh/t9SWk9u6r/UZcyc2NPWiqaTb
 3qUvtoLtKKxIiGhTDk51T9nIm5k9sBzd3QTX9nyLICv4c4YdUVv73L7hP9vbC0qNuWxo
 kbdA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1743043938; x=1743648738;
 h=mime-version:user-agent:message-id:date:references:in-reply-to
 :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date
 :message-id:reply-to;
 bh=2bHIyP0JWXA/qlab1DPj+VlansYYd2gz7avX0f/NNVI=;
 b=wsxcY0hB3BgcT6G+SyVFgyWkoFW8kkf/MMxubJp7DkiBku0+pfKBLN5kGFeSS43IPe
 1URajHADVMmTE0kD/0BxzkeVmiCeVz9qK6jurlt4n7lamJqSf/yrS73Vxg0+xxZzXdCx
 Jat9X8IKA+bP/qO4M0wZbfXhQzt3LHgROxg4oYnq8o6VO7TAoUwZT/yvJhLWcA4B+ziK
 dNS9gS2pXW6W8fYJIRXQCEOiIhrP0Aa0rPOoKhkj9k+30366LYqribIkmrDisNQ0qrFN
 yu5PTMHWvyfOrTHn9zFY8JZNJdNFg2p+yJb0DReKtuWHTkOOPE7TkMY3PObxaIeT2V6e
 6ToA==
X-Gm-Message-State: AOJu0YyAmv0jFgyNVIqh56spz4wSH1qwucy88hiEMDUJGglvljnBozAg
 P2MxdRS4nGooJ7f6TyIHwfZwLxs3JQw5GgkBj8hhagZJLxKLR61K
X-Gm-Gg: ASbGncvPbahMQXG/6ajkoCeidMM9zgRvYi4aNdASqoFp0qvjMnewKtEvtFDz4hljGbx
 8dBGzo1zj00s+hHciGvjp4fgNQXZUg756ZGMzkfOabFYRi7MUx2Dg3aUkha4iZ4Drn4J/TUsHyr
 4++RPY3NMudXs2RAkDdA8or/exsHdi6X1GH4Iki9aPyVzV9QjSztgUZaFRCWwmARImXtJHYcoWC
 q0y7xNPCBSxITLbbBLCLjC6gkbWXFcFR+265WmYzJ1vSqTm35Ci0KKIihX98mHqjisIdqvTcK2e
 aHlYhX+0lUMF
X-Google-Smtp-Source: AGHT+IHv3S2wFWT7AVmFYLHCx8BBlqJx34NQFdZAMQCZWMitqYH7jTq1XQu/4VC//dwquB09UlbJmw==
X-Received: by 2002:a05:6870:d113:b0:29d:c764:f873 with SMTP id
 586e51a60fabf-2c84819d07emr1147638fac.31.1743043937676; 
 Wed, 26 Mar 2025 19:52:17 -0700 (PDT)
Received: from fedora ([2806:10ae:e:5fce::1]) by smtp.gmail.com with ESMTPSA id
 586e51a60fabf-2c77f05ec85sm3413184fac.32.2025.03.26.19.52.16
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 26 Mar 2025 19:52:16 -0700 (PDT)
From: =?utf-8?Q?Elijah_Gabe_P=C3=A9rez?= <eg642616@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#77224: [PATCH] New minor mode 'cursor-indicators-mode'
In-Reply-To: <875xjvcn4o.fsf@HIDDEN>
References: <87iknzxski.fsf@HIDDEN> <87o6xq6fud.fsf@HIDDEN>
 <875xjymh93.fsf@HIDDEN> <87ikny2rio.fsf@HIDDEN>
 <86o6xpe2cx.fsf@HIDDEN> <87o6xobdcc.fsf@HIDDEN>
 <875xjwyzvt.fsf@HIDDEN> <8634f0dkhq.fsf@HIDDEN>
 <875xjvcn4o.fsf@HIDDEN>
Date: Wed, 26 Mar 2025 20:52:15 -0600
Message-ID: <87r02jb2xs.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/31.0.50
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-Spam-Score: 0.3 (/)
X-Debbugs-Envelope-To: 77224
Cc: 77224 <at> debbugs.gnu.org, Juri Linkov <juri@HIDDEN>
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.7 (/)

--=-=-=
Content-Type: multipart/alternative; boundary="==-=-="

--==-=-=
Content-Type: text/plain

I forgot to update commit message properly.
Sending fixed patch.




--==-=-=
Content-Type: text/html

<p>
I forgot to update commit message properly.<br />
Sending fixed patch.<br />
</p>

--==-=-=--

--=-=-=
Content-Type: text/x-patch; charset=utf-8
Content-Disposition: attachment;
 filename=0001-New-package-cursor-indicators-mode-Bug-77224.patch
Content-Transfer-Encoding: quoted-printable

From 09400072236d8297b2cf8af644bfeeaa8c63593e Mon Sep 17 00:00:00 2001
From: =3D?UTF-8?q?El=3DC3=3DADas=3D20Gabriel=3D20P=3DC3=3DA9rez?=3D <eg6426=
16@HIDDEN>
Date: Sat, 22 Mar 2025 22:56:01 -0600
Subject: [PATCH] New package 'cursor-indicators-mode' (Bug#77224)

This minor mode changes the cursor appearance to indicate
buffers states, such as if overwrite-mode is active or current
buffer is read-only.
Acts similar to 'cua-enable-cursor-indications'
* etc/NEWS: Document new package.
* lisp/cursor-indicators.el: New file.
---
 etc/NEWS                  |  10 +++
 lisp/cursor-indicators.el | 167 ++++++++++++++++++++++++++++++++++++++
 2 files changed, 177 insertions(+)
 create mode 100644 lisp/cursor-indicators.el

diff --git a/etc/NEWS b/etc/NEWS
index cc63d03eafe..2745d467722 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -1566,6 +1566,16 @@ This user option replaces 'follow-mode-prefix', whic=
h had to be set
 before loading Follow mode.  This new option allows you to change the
 prefix even after it was loaded, using 'customize-option' or 'setopt'.
=20
+---
+*** New package 'cursor-indicators-mode'
+This provides a new minor mode, 'cursor-indicators-mode'.
+This mode changes cursor appearance (color and/or type) to indicate
+different buffer states according to 'cursor-indicators-conditions'.
+The mode have cursor indicators out the box for:
+- Overwrite mode
+- Read-only buffers
+- Input method activation
+
 ---
 *** cdl.el is now obsolete.
 Use 'shell-command' and 'shell-command-on-region' instead.
diff --git a/lisp/cursor-indicators.el b/lisp/cursor-indicators.el
new file mode 100644
index 00000000000..c9122ae864b
--- /dev/null
+++ b/lisp/cursor-indicators.el
@@ -0,0 +1,167 @@
+;;; cursor-indicators.el --- Cursor indicators for some states  -*- lexica=
l-binding: t; -*-
+
+;; Copyright (C) 2025 Free Software Foundation, Inc.
+
+;; Version: 1.0.0
+;; Author: El=C3=ADas Gabriel P=C3=A9rez <eg642616@HIDDEN>
+;; Package-Requires: ((emacs "26.1") (compat "30"))
+
+;; This program is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; This program is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with this program.  If not, see <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+;; This package allows changes cursor appearance (color and/or type) to
+;; indicate different buffer states such as if current buffer is
+;; read-only or if overwrite mode is currently active.
+;;
+;; Usage:
+;; For use this mode enable: cursor-indicators-mode.
+;; By default it will set cursor color if overwrite mode is currently
+;; active, if buffer is read-only or if input method is active.
+;;
+;; To change this behavior customize `cursor-indicators-conditions'.
+;; For example, change cursor type to bar when there is a region active:
+;; (setopt cursor-indicators-conditions '((use-region-p . bar)))
+;; Or change both cursor color and type when current buffer have a
+;; specific name:
+;; (setopt cursor-indicators-conditions `((,(lambda () (string-prefix-p " =
*" (buffer-name)))
+;;                                         hollow "yellow")))
+
+;;; Code:
+(require 'map)
+(require 'compat)
+
+;;; User options
+
+(defcustom cursor-indicators-conditions
+  '((overwrite-mode . "red")
+    (buffer-read-only . "green")
+    (current-input-method . "blue"))
+  "Alist of conditions to which cursor should change its appearence.
+Only used when `cursor-indicators-mode' is enabled.
+
+Each element is an alist entry in one of these forms:
+  (CONDITION . COLOR)     Change cursor color
+  (CONDITION . TYPE)      Change cursor type
+  (CONDITION TYPE COLOR)  Change cursor color and type
+
+CONDITION must be a function (without arguments) or a variable that
+must return non-nil.  If variable shares name with a function,
+the variable will be used instead.
+COLOR is a string specifying the cursor color.
+TYPE specifies cursor type.
+
+Valid cursor types are:
+  `box'    - Filled box
+  `bar'    - Vertical bar
+  `hbar'   - Horizontal bar
+  `hollow' - Hollow box
+
+Each element in this alist takes predominance according to its order.
+
+If none of the conditions return non-nil, the cursor will use default
+cursor type and color."
+  :group 'cursor
+  :version "31.1"
+  :type '(alist :key-type
+                (choice :tag "Condition"
+                        (const :tag "Overwrite mode" overwrite-mode)
+                        (const :tag "Read-only mode" buffer-read-only)
+                        (const :tag "Repeat mode" repeat-in-progress)
+                        (const :tag "Activated input method" current-input=
-method)
+                        ;; User-defined conditions
+                        (function :tag "Variable")
+                        (variable :tag "Function"))
+                :value-type
+                (choice
+                 (color :tag "Color")
+                 (choice :tag "Type"
+                         (const :tag "Filled box" box)
+                         (const :tag "Vertical bar" bar)
+                         (const :tag "Horizontal bar" hbar)
+                         (const :tag "Hollow box" hollow))
+                 (group :tag "Color and Type"
+                        (choice :tag "Type"
+                                (const :tag "Filled box" box)
+                                (const :tag "Vertical bar" bar)
+                                (const :tag "Horizontal bar" hbar)
+                                (const :tag "Hollow box" hollow))
+                        (color :tag "Color")))))
+
+;;; Internal Code
+
+(defvar cursor-indicators--default-cursor-color (frame-parameter nil 'curs=
or-color))
+(defvar cursor-indicators--idle-timer nil)
+
+(defun cursor-indicators--change-cursor (key val)
+  "Helper function to `cursor-indicators--update-indications'."
+  ;; Check if KEY is non-nil
+  (when (or (and (symbolp key) (boundp key) (symbol-value key))
+            (and (interpreted-function-p key) (funcall key))
+            (and (functionp key) (symbolp key) (not (boundp key)) (funcall=
 key)))
+    (cond
+     ;; Set cursor color
+     ((and (stringp val) (not (equal val (frame-parameter nil 'cursor-colo=
r))))
+      (set-cursor-color val)
+      (setq-local cursor-type (default-value 'cursor-type))) ; Set to defa=
ult cursor type
+     ;; Set cursor type
+     ((and (symbolp val) (not (eq val (default-value 'cursor-type))))
+      (setq-local cursor-type val)
+      (set-cursor-color cursor-indicators--default-cursor-color)) ; Set to=
 default cursor color
+     ;; Set cursor color and type
+     ((consp val)
+      (let ((type (car val))
+            (color (cadr val)))
+        (when (and (symbolp type) (not (eq type (default-value 'cursor-typ=
e)))
+                   (stringp color) (not (equal color (frame-parameter nil =
'cursor-color))))
+          (set-cursor-color color)
+          (setq-local cursor-type type)))))
+    ;; And exit from loop.
+    (throw 'c-i-exit t)))
+
+(defun cursor-indicators--update-indications ()
+  ;; C-I-EXIT is used here for exit from loop.
+  (when (and cursor-type
+             (not (catch 'c-i-exit (map-do #'cursor-indicators--change-cur=
sor cursor-indicators-conditions))))
+    (setq-local cursor-type (default-value 'cursor-type))
+    (set-cursor-color cursor-indicators--default-cursor-color)))
+
+(defun cursor-indicators--remove-idle-timer ()
+  "Stop and Remove idle time set."
+  (when cursor-indicators--idle-timer
+    (cancel-timer cursor-indicators--idle-timer)
+    (setq cursor-indicators--idle-timer nil)))
+
+(defvar cursor-indicators-idle-time 0.1
+  "Time used for set an idle-timer.")
+
+;;;###autoload
+(define-minor-mode cursor-indicators-mode
+  "Change cursor type and/or face for indications.
+When enabled, this mode changes the cursor appearance to indicate
+different buffer states."
+  :group 'cursor
+  :version "31.1"
+  :global t
+  (if cursor-indicators-mode
+      (progn
+        (cursor-indicators--remove-idle-timer)
+        (setq cursor-indicators--idle-timer
+              (run-with-idle-timer cursor-indicators-idle-time t
+                                   #'cursor-indicators--update-indications=
)))
+    (cursor-indicators--remove-idle-timer)
+    (set-cursor-color cursor-indicators--default-cursor-color)
+    (setq-local cursor-type (default-value 'cursor-type))))
+
+(provide 'cursor-indicators)
+;;; cursor-indicators.el ends here
--=20
2.49.0


--=-=-=
Content-Type: text/plain


-- 
                                          - E.G via GNU Emacs and Org.

--=-=-=--




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

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


Received: (at 77224) by debbugs.gnu.org; 27 Mar 2025 00:51:03 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Mar 26 20:51:03 2025
Received: from localhost ([127.0.0.1]:45085 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1txbSX-000417-1J
	for submit <at> debbugs.gnu.org; Wed, 26 Mar 2025 20:51:03 -0400
Received: from mail-ot1-x343.google.com ([2607:f8b0:4864:20::343]:45398)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <eg642616@HIDDEN>)
 id 1txbSR-0003z3-Uy
 for 77224 <at> debbugs.gnu.org; Wed, 26 Mar 2025 20:50:58 -0400
Received: by mail-ot1-x343.google.com with SMTP id
 46e09a7af769-72bbc03d436so312311a34.3
 for <77224 <at> debbugs.gnu.org>; Wed, 26 Mar 2025 17:50:55 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1743036650; x=1743641450; darn=debbugs.gnu.org;
 h=mime-version:user-agent:message-id:date:references:in-reply-to
 :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to;
 bh=EHw0Jv2o5da++rqVMNLI5gn8XdXmoMlN/3lsYbWbw/0=;
 b=OQgxMDl9Y442f1AwP/IRZxR4m6m/ArfccK9nIc25ZrPYj7ukoszyY9tgwE74WLTJdu
 GIcGhUNW68b2hCcjerMKsibpw8bx8NVxxqM+awJZ6hxVflEnUGq9Uzulm2DWSHUmHZma
 H2SOB5XcTft0bDHegiuICe7iOPofaK5bwT3ZHzX0518h3XSChvtGV0Z3m0kRjx2bAsrG
 pVaz6/symreXzYnL0aAoqQbHGoXPATl9nr6j5x4i2Co2OXeMl0cc9GeFQh0iMQlf1/D7
 9vglG0SxIzPRwqdOhCe9laIwALNi4tBcEA4ctYRwyUzKZ7hN/8i3p/r17DNbwaN9QMUj
 u5hQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1743036650; x=1743641450;
 h=mime-version:user-agent:message-id:date:references:in-reply-to
 :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date
 :message-id:reply-to;
 bh=EHw0Jv2o5da++rqVMNLI5gn8XdXmoMlN/3lsYbWbw/0=;
 b=ilcDAEUAHhyyoFP1691uBCfJOb8ViKraE1c4KujfqPKM5YSxdXVzq7ZEW6ptmcvREO
 CDR6aHXRie7SY8ph5Y8QH6tBtTJk7XFpDkpVJbHepiyEgNSbQ2LGW/CTUzJcMf9aKpt1
 Zr4yuskPyMuakgTygo+y+l8x8MjEcGoJOjE05VhV1Ju96yACbXMhJBxjwzvPx+ZRo9M+
 KkhqgPmf5NAVBVG13vFeIBpcgh8ygyRr+FPTW2zrDYL5FjTiGVBbyI/+M3QBkCXHfqPt
 emLTIquONrR1T/s5MABoXYDwFLD/MvuaFpt2Zp+gv5rEjFt9ejPthtJI18hrhj62RFzV
 z4Yg==
X-Forwarded-Encrypted: i=1;
 AJvYcCU/l8LTOT27MB61+2LyM2ssvTiQ6ZSeFIf5eyijR/SIH/kRHJFkeyBsJpRQTeeEwDobvZQ1cQ==@debbugs.gnu.org
X-Gm-Message-State: AOJu0YzT+4Phdap/9dcTgJ4nJ1NUo/ssFRHO8WG1lKhkk4LJ1sQqJZuF
 t5xMnbN+zbMcTZDoP+iMjlT+dp78936ofVUeiHBFR7Oe9z2byVNjo1LUA7HS
X-Gm-Gg: ASbGnculocek8tA4JlYl+Fm6bp02lNqzy+Q06EC1rRVg0yNx5JRkATaUE7nVah6uY4P
 Z419UtLC8wiNppBAPgRyDZIdDElwhrt3Id+6nSNcpar9gGN/Y2nwB3yjZUXVx2LL808DZtnuMhu
 8XgKP25KmkCe9ka9nzyft4tm/PPzxtmJ1S98odiRM/Fht7nW6Qy9JZZT7Dc2HXmW6aBPA22ZIHl
 eI1MzvQMs+xYIgsrLX2hLZzXRBlXP9Pnlcubupb9f0OeDjNfrrlPUEmScSFklQWPVIo9tFVS1js
 Kari86sGJO39
X-Google-Smtp-Source: AGHT+IGub5PsrLLmfVF4ho4QfyDrtDNiz/ruUyGMgb/MxDlE92kKBGcI62uSknf0Z+d4jlK5JYX13w==
X-Received: by 2002:a05:6830:f93:b0:727:3303:7ea8 with SMTP id
 46e09a7af769-72c4ca166f8mr1256333a34.25.1743036649513; 
 Wed, 26 Mar 2025 17:50:49 -0700 (PDT)
Received: from fedora ([2806:10ae:e:5fce::1]) by smtp.gmail.com with ESMTPSA id
 46e09a7af769-72c0ac7b8aasm2520187a34.62.2025.03.26.17.50.48
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 26 Mar 2025 17:50:48 -0700 (PDT)
From: =?utf-8?Q?Elijah_Gabe_P=C3=A9rez?= <eg642616@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#77224: [PATCH] New minor mode 'cursor-indicators-mode'
In-Reply-To: <8634f0dkhq.fsf@HIDDEN>
References: <87iknzxski.fsf@HIDDEN> <87o6xq6fud.fsf@HIDDEN>
 <875xjymh93.fsf@HIDDEN> <87ikny2rio.fsf@HIDDEN>
 <86o6xpe2cx.fsf@HIDDEN> <87o6xobdcc.fsf@HIDDEN>
 <875xjwyzvt.fsf@HIDDEN> <8634f0dkhq.fsf@HIDDEN>
Date: Wed, 26 Mar 2025 18:50:47 -0600
Message-ID: <875xjvcn4o.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/31.0.50
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-Spam-Score: 0.3 (/)
X-Debbugs-Envelope-To: 77224
Cc: 77224 <at> debbugs.gnu.org, Juri Linkov <juri@HIDDEN>
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.7 (/)

--=-=-=
Content-Type: multipart/alternative; boundary="==-=-="

--==-=-=
Content-Type: text/plain

Eli Zaretskii <eliz@HIDDEN> writes:

>> From: Juri Linkov <juri@HIDDEN>
>> Cc: Eli Zaretskii <eliz@HIDDEN>,  77224 <at> debbugs.gnu.org
>> Date: Wed, 26 Mar 2025 09:58:06 +0200

>> > I've updated the patch following Juri suggestions.
>> > Now all the conditions are inside a single defcustom.

>> Thanks!  I tested that everything works nicely.
>> There is only one small problem for repeat-mode:

>> > +        (add-hook 'post-command-hook #'cursor-indicators--update-indications)

>> It would be better to use a large value DEPTH for add-hook
>> to add the hook to the end.  The problem is that repeat-mode
>> also uses the same hook 'post-command-hook'.  So the cursor
>> indication hook should be called afterwards as the last hook.

> Would it be better to use an idle timer instead?  post-command-hook
> tends to make Emacs sluggish.

Yeah, that is that what worried me when i decided to use that hook.

I've fixed the patch to use only idle-timer instead.




--==-=-=
Content-Type: text/html

<p>
Eli Zaretskii &lt;eliz@HIDDEN&gt; writes:<br />
</p>

<p>
<blockquote class="gmail_quote" style="border-left:#5555EE solid 0.2em;margin: 0em;padding-left: 0.85em;font-family: monospace;unicode-bidi: isolate;display: box;">

<div><blockquote class="gmail_quote" style="border-left:#5555EE solid 0.2em;margin: 0em;padding-left: 0.85em;font-family: monospace;unicode-bidi: isolate;display: box;">

<div>From: Juri Linkov &lt;juri@HIDDEN&gt;<br />
Cc: Eli Zaretskii &lt;eliz@HIDDEN&gt;,  77224 <at> debbugs.gnu.org<br />
Date: Wed, 26 Mar 2025 09:58:06 +0200<br />

</div></blockquote>

</div></blockquote>
</p>

<p>
<blockquote class="gmail_quote" style="border-left:#5555EE solid 0.2em;margin: 0em;padding-left: 0.85em;font-family: monospace;unicode-bidi: isolate;display: box;">

<div><blockquote class="gmail_quote" style="border-left:#5555EE solid 0.2em;margin: 0em;padding-left: 0.85em;font-family: monospace;unicode-bidi: isolate;display: box;">

<div><blockquote class="gmail_quote" style="border-left:#5555EE solid 0.2em;margin: 0em;padding-left: 0.85em;font-family: monospace;unicode-bidi: isolate;display: box;">

<div>I've updated the patch following Juri suggestions.<br />
Now all the conditions are inside a single defcustom.<br />

</div></blockquote>

</div></blockquote>

</div></blockquote>
</p>

<p>
<blockquote class="gmail_quote" style="border-left:#5555EE solid 0.2em;margin: 0em;padding-left: 0.85em;font-family: monospace;unicode-bidi: isolate;display: box;">

<div><blockquote class="gmail_quote" style="border-left:#5555EE solid 0.2em;margin: 0em;padding-left: 0.85em;font-family: monospace;unicode-bidi: isolate;display: box;">

<div>Thanks!  I tested that everything works nicely.<br />
There is only one small problem for repeat-mode:<br />

</div></blockquote>

</div></blockquote>
</p>

<p>
<blockquote class="gmail_quote" style="border-left:#5555EE solid 0.2em;margin: 0em;padding-left: 0.85em;font-family: monospace;unicode-bidi: isolate;display: box;">

<div><blockquote class="gmail_quote" style="border-left:#5555EE solid 0.2em;margin: 0em;padding-left: 0.85em;font-family: monospace;unicode-bidi: isolate;display: box;">

<div><blockquote class="gmail_quote" style="border-left:#5555EE solid 0.2em;margin: 0em;padding-left: 0.85em;font-family: monospace;unicode-bidi: isolate;display: box;">

<div>+        (add-hook 'post-command-hook #'cursor-indicators&#x2013;update-indications)<br />

</div></blockquote>

</div></blockquote>

</div></blockquote>
</p>

<p>
<blockquote class="gmail_quote" style="border-left:#5555EE solid 0.2em;margin: 0em;padding-left: 0.85em;font-family: monospace;unicode-bidi: isolate;display: box;">

<div><blockquote class="gmail_quote" style="border-left:#5555EE solid 0.2em;margin: 0em;padding-left: 0.85em;font-family: monospace;unicode-bidi: isolate;display: box;">

<div>It would be better to use a large value DEPTH for add-hook<br />
to add the hook to the end.  The problem is that repeat-mode<br />
also uses the same hook 'post-command-hook'.  So the cursor<br />
indication hook should be called afterwards as the last hook.<br />

</div></blockquote>

</div></blockquote>
</p>

<p>
<blockquote class="gmail_quote" style="border-left:#5555EE solid 0.2em;margin: 0em;padding-left: 0.85em;font-family: monospace;unicode-bidi: isolate;display: box;">

<div>Would it be better to use an idle timer instead?  post-command-hook<br />
tends to make Emacs sluggish.<br />

</div></blockquote>
</p>

<p>
Yeah, that is that what worried me when i decided to use that hook.<br />
</p>

<p>
I've fixed the patch to use only idle-timer instead.<br />
</p>

--==-=-=--

--=-=-=
Content-Type: text/x-patch; charset=utf-8
Content-Disposition: attachment;
 filename=0001-New-minor-mode-cursor-indicators-mode.patch
Content-Transfer-Encoding: quoted-printable

From 03099d0bfe4f2e56444973d9eb1c93ec7896465d Mon Sep 17 00:00:00 2001
From: =3D?UTF-8?q?El=3DC3=3DADas=3D20Gabriel=3D20P=3DC3=3DA9rez?=3D <eg6426=
16@HIDDEN>
Date: Sat, 22 Mar 2025 22:56:01 -0600
Subject: [PATCH] New minor mode 'cursor-indicators-mode'

This minor mode changes the cursor appearance to indicate
buffers states, such as if overwrite-mode is active or current
buffer is read-only. (Bug#77224)
Acts similar to 'cua-enable-cursor-indications'
* etc/NEWS: Document changes.
* lisp/cursor-indicators.el
(cursor-indicators-conditions): New user option.
(cursor-indicators--default-cursor-color)
(cursor-indicators--idle-timer)
(cursor-indicators-idle-time): New use internal variables.
(cursor-indicators--update-indications)
(cursor-indicators--remove-idle-timer)
(cursor-indicators--change-cursor): New use internal functions.
(cursor-indicators-mode): New minor mode definition.
---
 etc/NEWS                  |   9 +++
 lisp/cursor-indicators.el | 153 ++++++++++++++++++++++++++++++++++++++
 2 files changed, 162 insertions(+)
 create mode 100644 lisp/cursor-indicators.el

diff --git a/etc/NEWS b/etc/NEWS
index cc63d03eafe..e87afc8c1b6 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -1566,6 +1566,15 @@ This user option replaces 'follow-mode-prefix', whic=
h had to be set
 before loading Follow mode.  This new option allows you to change the
 prefix even after it was loaded, using 'customize-option' or 'setopt'.
=20
+---
+*** New minor mode 'cursor-indicators-mode'
+This mode changes cursor appearance (color and/or type) to indicate
+different buffer states according to 'cursor-indicators-conditions'.
+The mode have cursor indicators out the box for:
+- Overwrite mode
+- Read-only buffers
+- Input method activation
+
 ---
 *** cdl.el is now obsolete.
 Use 'shell-command' and 'shell-command-on-region' instead.
diff --git a/lisp/cursor-indicators.el b/lisp/cursor-indicators.el
new file mode 100644
index 00000000000..64db160f390
--- /dev/null
+++ b/lisp/cursor-indicators.el
@@ -0,0 +1,153 @@
+;;; cursor-indicators.el --- Cursor indicators for some states  -*- lexica=
l-binding: t; -*-
+
+;; Copyright (C) 2025 Free Software Foundation, Inc.
+
+;; Version: 1.0.0
+;; Author: El=C3=ADas Gabriel P=C3=A9rez <eg642616@HIDDEN>
+;; Package-Requires: ((emacs "26.1") (compat "30.0.1.0"))
+
+;; This program is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; This program is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with this program.  If not, see <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+;; This package changes cursor appearance (color and/or type) to indicate
+;; different buffer states.
+
+;;; Code:
+(require 'map)
+(require 'compat)
+
+;;; User options
+
+(defcustom cursor-indicators-conditions
+  '((overwrite-mode . "red")
+    (buffer-read-only . "green")
+    (current-input-method . "blue"))
+  "Alist of conditions to which cursor should change its appearence.
+Only used when `cursor-indicators-mode' is enabled.
+
+Each element is an alist entry in one of these forms:
+  (CONDITION . COLOR)     Change cursor color
+  (CONDITION . TYPE)      Change cursor type
+  (CONDITION TYPE COLOR)  Change cursor color and type
+
+CONDITION must be a function (without arguments) or a variable that
+must return non-nil.
+COLOR is a string specifying the cursor color.
+TYPE specifies cursor type.
+
+Colors can be any valid color name or hex RGB value.
+Valid cursor types are:
+  `box'    - Filled box
+  `bar'    - Vertical bar
+  `hbar'   - Horizontal bar
+  `hollow' - Hollow box
+
+Each element in this alist takes predominance according to its order.
+
+If none of the conditions return non-nil, the cursor will use default
+cursor type and color."
+  :group 'cursor
+  :version "31.1"
+  :type '(alist :key-type
+                (choice :tag "Condition"
+                        (const :tag "Overwrite mode" overwrite-mode)
+                        (const :tag "Read-only mode" buffer-read-only)
+                        (const :tag "Repeat mode" repeat-in-progress)
+                        (const :tag "Activated input method" current-input=
-method)
+                        ;; User-defined conditions
+                        (function :tag "Variable")
+                        (variable :tag "Function"))
+                :value-type
+                (choice
+                 (color :tag "Color")
+                 (choice :tag "Type"
+                         (const :tag "Filled box" box)
+                         (const :tag "Vertical bar" bar)
+                         (const :tag "Horizontal bar" hbar)
+                         (const :tag "Hollow box" hollow))
+                 (group :tag "Color and Type"
+                        (choice :tag "Type"
+                                (const :tag "Filled box" box)
+                                (const :tag "Vertical bar" bar)
+                                (const :tag "Horizontal bar" hbar)
+                                (const :tag "Hollow box" hollow))
+                        (color :tag "Color")))))
+
+;;; Internal Code
+
+(defvar cursor-indicators--default-cursor-color (frame-parameter nil 'curs=
or-color))
+(defvar cursor-indicators--idle-timer nil)
+
+(defun cursor-indicators--change-cursor (key val)
+  "Helper function to `cursor-indicators--update-indications'."
+  ;; Check if KEY is non-nil
+  (when (or (and (symbolp key) (boundp key) (symbol-value key))
+            (and (interpreted-function-p key) (funcall key))
+            (and (functionp key) (symbolp key) (not (boundp key)) (funcall=
 key)))
+    (cond
+     ;; Set cursor color
+     ((and (stringp val) (not (equal val (frame-parameter nil 'cursor-colo=
r))))
+      (set-cursor-color val)
+      (setq-local cursor-type (default-value 'cursor-type))) ; Set to defa=
ult cursor type
+     ;; Set cursor type
+     ((and (symbolp val) (not (eq val (default-value 'cursor-type))))
+      (setq-local cursor-type val)
+      (set-cursor-color cursor-indicators--default-cursor-color)) ; Set to=
 default cursor color
+     ;; Set cursor color and type
+     ((consp val)
+      (let ((type (car val))
+            (color (cadr val)))
+        (when (and (symbolp type) (not (eq type (default-value 'cursor-typ=
e)))
+                   (stringp color) (not (equal color (frame-parameter nil =
'cursor-color))))
+          (set-cursor-color color)
+          (setq-local cursor-type type)))))
+    ;; And exit from loop.
+    (throw 'c-i-exit t)))
+
+(defun cursor-indicators--update-indications ()
+  ;; C-I-EXIT is used here for exit from loop.
+  (when (and cursor-type
+             (not (catch 'c-i-exit (map-do #'cursor-indicators--change-cur=
sor cursor-indicators-conditions))))
+    (setq-local cursor-type (default-value 'cursor-type))
+    (set-cursor-color cursor-indicators--default-cursor-color)))
+
+(defun cursor-indicators--remove-idle-timer ()
+  "Stop and Remove idle time set."
+  (when cursor-indicators--idle-timer
+    (cancel-timer cursor-indicators--idle-timer)
+    (setq cursor-indicators--idle-timer nil)))
+
+(defvar cursor-indicators-idle-time 0.1
+  "Time used for set an idle-timer.")
+
+;;;###autoload
+(define-minor-mode cursor-indicators-mode
+  "Change cursor type and/or face for indications.
+When enabled, this mode changes the cursor appearance to indicate
+different buffer states."
+  :group 'cursor
+  :version "31.1"
+  :global t
+  (if cursor-indicators-mode
+      (progn
+        (cursor-indicators--remove-idle-timer)
+        (setq cursor-indicators--idle-timer
+              (run-with-idle-timer cursor-indicators-idle-time t
+                                   #'cursor-indicators--update-indications=
)))
+    (cursor-indicators--remove-idle-timer)
+    (set-cursor-color cursor-indicators--default-cursor-color)
+    (setq-local cursor-type (default-value 'cursor-type))))
+
+(provide 'cursor-indicators)
+;;; cursor-indicators.el ends here
--=20
2.49.0


--=-=-=
Content-Type: text/plain


-- 
                                          - E.G via GNU Emacs and Org.

--=-=-=--




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

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


Received: (at 77224) by debbugs.gnu.org; 26 Mar 2025 12:50:27 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Mar 26 08:50:27 2025
Received: from localhost ([127.0.0.1]:41978 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1txQDD-0004Vi-8x
	for submit <at> debbugs.gnu.org; Wed, 26 Mar 2025 08:50:27 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:51862)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1txQD9-0004VU-Pf
 for 77224 <at> debbugs.gnu.org; Wed, 26 Mar 2025 08:50:24 -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 1txQD4-0002HQ-0j; Wed, 26 Mar 2025 08:50:18 -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=0CLpxbDVsbakKuoz6Xcu8YL0g2M7kLTQks86uV5xVjw=; b=Hm+4iVtcZmM9
 V8hPBST2XUdoysGC1DF56HDk91DfMJB7dvOVhqfYLWjZbncbq+wCbZGYKI9+xLJ6SdSKp/q3YEDbg
 RekqtvwSFayWy29SJX2Qd+MpoU3m7/8wfn3dR+SAu4dDCKcLzoJ58ilWqsjL9dcv2CTbDaRcM+NUy
 MJR0lS4cB7rdkjFTY7rlZxKDoL2Jj2AdVEaKTV/Dp/6kIBZiRMabsBQ5xhfX2JDNf/vx4IO3aRnQB
 jsXdfDDAlaGaoyxADng7gbb6YPTzcBV++W05roREz1UUt68qCJtLtLDMGVk9713c4WcoR7mPrG3jn
 jQjMSSfpppC8z/JRjoyG/A==;
Date: Wed, 26 Mar 2025 14:50:09 +0200
Message-Id: <8634f0dkhq.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Juri Linkov <juri@HIDDEN>
In-Reply-To: <875xjwyzvt.fsf@HIDDEN> (message from Juri Linkov on
 Wed, 26 Mar 2025 09:58:06 +0200)
Subject: Re: bug#77224: [PATCH] New minor mode 'cursor-indicators-mode'
References: <87iknzxski.fsf@HIDDEN> <87o6xq6fud.fsf@HIDDEN>
 <875xjymh93.fsf@HIDDEN> <87ikny2rio.fsf@HIDDEN>
 <86o6xpe2cx.fsf@HIDDEN> <87o6xobdcc.fsf@HIDDEN>
 <875xjwyzvt.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 77224
Cc: 77224 <at> debbugs.gnu.org, eg642616@HIDDEN
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: Juri Linkov <juri@HIDDEN>
> Cc: Eli Zaretskii <eliz@HIDDEN>,  77224 <at> debbugs.gnu.org
> Date: Wed, 26 Mar 2025 09:58:06 +0200
> 
> > I've updated the patch following Juri suggestions.
> > Now all the conditions are inside a single defcustom.
> 
> Thanks!  I tested that everything works nicely.
> There is only one small problem for repeat-mode:
> 
> > +        (add-hook 'post-command-hook #'cursor-indicators--update-indications)
> 
> It would be better to use a large value DEPTH for add-hook
> to add the hook to the end.  The problem is that repeat-mode
> also uses the same hook 'post-command-hook'.  So the cursor
> indication hook should be called afterwards as the last hook.

Would it be better to use an idle timer instead?  post-command-hook
tends to make Emacs sluggish.




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

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


Received: (at 77224) by debbugs.gnu.org; 26 Mar 2025 08:16:23 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Mar 26 04:16:23 2025
Received: from localhost ([127.0.0.1]:41200 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1txLvy-0004Ie-PP
	for submit <at> debbugs.gnu.org; Wed, 26 Mar 2025 04:16:23 -0400
Received: from relay9-d.mail.gandi.net ([217.70.183.199]:35069)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <juri@HIDDEN>) id 1txLvs-0004IF-Og
 for 77224 <at> debbugs.gnu.org; Wed, 26 Mar 2025 04:16:20 -0400
Received: by mail.gandi.net (Postfix) with ESMTPSA id A016A443E1;
 Wed, 26 Mar 2025 08:16:08 +0000 (UTC)
From: Juri Linkov <juri@HIDDEN>
To: Elijah Gabe =?iso-8859-1?Q?P=E9rez?= <eg642616@HIDDEN>
Subject: Re: bug#77224: [PATCH] New minor mode 'cursor-indicators-mode'
In-Reply-To: <87o6xobdcc.fsf@HIDDEN>
Organization: LINKOV.NET
References: <87iknzxski.fsf@HIDDEN> <87o6xq6fud.fsf@HIDDEN>
 <875xjymh93.fsf@HIDDEN> <87ikny2rio.fsf@HIDDEN>
 <86o6xpe2cx.fsf@HIDDEN> <87o6xobdcc.fsf@HIDDEN>
Date: Wed, 26 Mar 2025 09:58:06 +0200
Message-ID: <875xjwyzvt.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/31.0.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain
X-GND-State: clean
X-GND-Score: -100
X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdduieehtddvucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuifetpfffkfdpucggtfgfnhhsuhgsshgtrhhisggvnecuuegrihhlohhuthemuceftddunecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvfevufgjohhffffkfgggtgesthdtredttdertdenucfhrhhomheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqeenucggtffrrghtthgvrhhnpeffgeetfeevlefhleejfeeuheeiudeitdffhfdutdekfeffgffhveehteegueekheenucfkphepledurdduvdelrddutdehrdduudejnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepledurdduvdelrddutdehrdduudejpdhhvghlohepmhgrihhlrdhgrghnughirdhnvghtpdhmrghilhhfrhhomhepjhhurhhisehlihhnkhhovhdrnhgvthdpnhgspghrtghpthhtohepfedprhgtphhtthhopeejjedvvdegseguvggssghughhsrdhgnhhurdhorhhgpdhrtghpthhtohepvghlihiisehgnhhurdhorhhgpdhrtghpthhtohepvghgieegvdeiudeisehgmhgrihhlrdgtohhm
X-GND-Sasl: juri@HIDDEN
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 77224
Cc: 77224 <at> debbugs.gnu.org, Eli Zaretskii <eliz@HIDDEN>
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.7 (-)

> I've updated the patch following Juri suggestions.
> Now all the conditions are inside a single defcustom.

Thanks!  I tested that everything works nicely.
There is only one small problem for repeat-mode:

> +        (add-hook 'post-command-hook #'cursor-indicators--update-indications)

It would be better to use a large value DEPTH for add-hook
to add the hook to the end.  The problem is that repeat-mode
also uses the same hook 'post-command-hook'.  So the cursor
indication hook should be called afterwards as the last hook.




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

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


Received: (at 77224) by debbugs.gnu.org; 26 Mar 2025 05:01:08 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Mar 26 01:01:08 2025
Received: from localhost ([127.0.0.1]:40856 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1txIt1-00038B-Lh
	for submit <at> debbugs.gnu.org; Wed, 26 Mar 2025 01:01:08 -0400
Received: from mail-oi1-x243.google.com ([2607:f8b0:4864:20::243]:61857)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <eg642616@HIDDEN>)
 id 1txIsy-00037U-En
 for 77224 <at> debbugs.gnu.org; Wed, 26 Mar 2025 01:01:05 -0400
Received: by mail-oi1-x243.google.com with SMTP id
 5614622812f47-3fa6c54cdb2so5528332b6e.3
 for <77224 <at> debbugs.gnu.org>; Tue, 25 Mar 2025 22:01:04 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1742965258; x=1743570058; darn=debbugs.gnu.org;
 h=mime-version:user-agent:message-id:date:references:in-reply-to
 :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to;
 bh=dE8ffj+xIXWLB9zedBabIuwfUW5qVJ7n4dM0/e03yIE=;
 b=ALweFWNpw+31LZmZoEpMewWboQDeDiLRbGGtfzQoZrrJT+CGe2/LTN3rmfbchajANX
 Eukmw6ywa8yD7yYW0+9wtI3wcsAAE5STcxX9+3jgXTlwXH5HWuzsObJKjVpGOgXcSUjf
 89gNG34vb3rrmplQ2MfFIYCkK7WZOsTtl1+DuDOyr3D+Cx2fscFdbhy6YmPearSfuRZT
 a66mVqFJHjO5OR4VG+Xelx60St5JgsYreT96ZMJPjCuB6E/rrDlj+M0GTcp4gMB9rqhX
 DfxRCu+yYwd4QN80yVhtnBtpEjmSwhX4U9hwRjx6di5j+wMFFGO/gZeW0JVj7Q946gQE
 iP+g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1742965258; x=1743570058;
 h=mime-version:user-agent:message-id:date:references:in-reply-to
 :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date
 :message-id:reply-to;
 bh=dE8ffj+xIXWLB9zedBabIuwfUW5qVJ7n4dM0/e03yIE=;
 b=LIEnRhK6OUOu/B9TObX/EXy3waksrNmChUm8W5GO08fmpSvM71LIZ+DVVhBzUq5f8M
 63SsVYZK1RrbYP8RU6mUJZxPaMA3xEHClRhLqgvQuNsM5ce2k7UIQeNzE7qprAYr74a/
 1zJnojOehkLSAIazDmrHK/u++JiejVHtmquHBLgoIpNHdBo8V41vE1UuHngeS4Vr73ik
 yDeDz7oUsIjsmDoNc9cH1zMu40MngRVZDGAo1nalvLSesqoIyK3m0UZfaBnjosQik5im
 cA1aQNYmdC0tAVDMrLdC9DWDbac3yOVnxUfjXRNX3OhVimluag0sjoDk5AJMZylU5nu9
 CyZw==
X-Gm-Message-State: AOJu0YzACJKVCSw6FS3AHriQYFHRCBzH2pjPe348mLWGzUKM2xXWa59g
 UySpZ350zJG1ww1P3DyGTA10MltMz30OnaCvvbJuEkiqLHbZCPecPN0BPzgY
X-Gm-Gg: ASbGnctbYZXxYNfqcYA5O0Rccy0LjMTUjOTroGfrnlErff3yTasCbPBlui2OCIQuEG7
 ZvZEwsUyZrAKkm13xwXOaf4pCZmciG+7hKtUR2+sAUGI5tw807YLO/57+NslqplJgHBsq5KpaRy
 hMh7VSVr3Hltw7iGxhCpN7QJVusMZh3W1mSUl0nMq3UGjHBfmnF8m7t1d1MBmaQ4wUZf/uChefu
 kfzxKP8IShZm3TyY+N2udtGUeXkiCWIH1nu9OFs1CvNXtd8wpgbsd2J3mWmoLJeT9mptqOOEVeY
 b+OyQLCnt89C
X-Google-Smtp-Source: AGHT+IFOhF4JbDJ1JR8OgYbh0zY831SWgytcxaV3A8VUQb5vW/mhufrVTOoDGayZjfG4AlTFeqTsVw==
X-Received: by 2002:a05:6808:14c6:b0:3f9:1fee:8055 with SMTP id
 5614622812f47-3febf723a8cmr12388458b6e.15.1742965257895; 
 Tue, 25 Mar 2025 22:00:57 -0700 (PDT)
Received: from fedora ([2806:10ae:e:5fce::1]) by smtp.gmail.com with ESMTPSA id
 006d021491bc7-60234759a2fsm1740327eaf.21.2025.03.25.22.00.56
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 25 Mar 2025 22:00:57 -0700 (PDT)
From: =?utf-8?Q?Elijah_Gabe_P=C3=A9rez?= <eg642616@HIDDEN>
To: Rudolf Schlatte <rudi@HIDDEN>
Subject: Re: bug#77224: [PATCH] New minor mode 'cursor-indicators-mode'
In-Reply-To: <m2h63hwnqf.fsf@HIDDEN>
References: <87iknzxski.fsf@HIDDEN> <87o6xq6fud.fsf@HIDDEN>
 <875xjymh93.fsf@HIDDEN> <87ikny2rio.fsf@HIDDEN>
 <871pula7sn.fsf@HIDDEN>
 <m2h63hwnqf.fsf@HIDDEN>
Date: Tue, 25 Mar 2025 23:00:56 -0600
Message-ID: <87ldssbd2v.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/31.0.50
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-Spam-Score: 0.3 (/)
X-Debbugs-Envelope-To: 77224
Cc: 77224 <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: -0.7 (/)

--=-=-=
Content-Type: multipart/alternative; boundary="==-=-="

--==-=-=
Content-Type: text/plain

Rudolf Schlatte <rudi@HIDDEN> writes:

> Juri Linkov <juri@HIDDEN> writes:

>>> +*** New minor mode 'cursor-indicators-mode'
>>> +This mode changes cursor appearance (color and/or type) to indicate
>>> +different buffer states.  This mode have cursor indicators for:
>>> +- Overwrite mode
>>> +- Read-only buffers
>>> +- Repeat mode
>>> +- Input method activation

>> What if users want to add more conditions?
>> Could you try to create only one defcustom that
>> contains a list of default conditions
>> plus a possible user-defined conditions.
>> For example:

>> #+begin_src emacs-lisp
>> (defcustom cursor-indicators nil
>>   :type `(alist :key-type
>>                   (choice :tag "Condition"
>>                     (const :tag "Overwrite mode" overwrite)
>>                     (const :tag "Read-only mode" read-only)
>>                     (const :tag "Repeat mode" repeat-in-progress)
>>                     (const :tag "Activated input method" input-method)
>>                     (function :tag "Matcher function")) ;; User-defined condition
>>                 :value-type
>>                   (choice
>>                     (const :tag "None (do not change cursor)" nil)
>>                     (color :tag "Color")
>>                     (choice :tag "Type"
>>                             (const :tag "Filled box" box)
>>                             (const :tag "Vertical bar" bar)
>>                             (const :tag "Horizontal bar" hbar)
>>                             (const :tag "Hollow box" hollow))
>>                     (cons :tag "Color and Type"
>>                           (choice :tag "Type"
>>                                   (const :tag "Filled box" box)
>>                                   (const :tag "Vertical bar" bar)
>>                                   (const :tag "Horizontal bar" hbar)
>>                                   (const :tag "Hollow box" hollow))
>>                           (color :tag "Color")))))
>> #+end_src


>> Then I could replace:

>> #+begin_src emacs-lisp
>> (defun my-change-cursor (&rest _)
>>   "Change cursor color and type depending on insertion mode and input method."
>>   (set-cursor-color
>>    (cond (repeat-in-progress   "blue")
>>          (current-input-method "red3")
>>          (t                    "black")))
>>   (setq-default cursor-type
>>    (cond (overwrite-mode       'box)
>>          (t                    'bar))))
>> #+end_src


>> with just

>> #+begin_src emacs-lisp
>> (setopt cursor-indicators '((repeat-in-progress   "blue")
>>                             (current-input-method "red3")
>>                             (overwrite-mode       'box)
>>                             (default              'bar)))
>> #+end_src

> I set the following hooks, which makes the cursor unobtrusive while I'm
> selecting text (C-SPC then moving cursor).  Could this also fit in the
> above framework?

> (deactivate-mark-hook . (lambda () (setq cursor-type t)))
> (activate-mark-hook . (lambda () (setq cursor-type 'bar)))

Yeah, you can set it as something like this.

#+begin_src elisp
  (setopt cursor-indicators-conditions '((use-region-p . "purple")))
#+end_src


--==-=-=
Content-Type: text/html

<p>
Rudolf Schlatte &lt;rudi@HIDDEN&gt; writes:<br />
</p>

<p>
<blockquote class="gmail_quote" style="border-left:#5555EE solid 0.2em;margin: 0em;padding-left: 0.85em;font-family: monospace;unicode-bidi: isolate;display: box;">

<div>Juri Linkov &lt;juri@HIDDEN&gt; writes:<br />

</div></blockquote>
</p>

<p>
<blockquote class="gmail_quote" style="border-left:#5555EE solid 0.2em;margin: 0em;padding-left: 0.85em;font-family: monospace;unicode-bidi: isolate;display: box;">

<div><blockquote class="gmail_quote" style="border-left:#5555EE solid 0.2em;margin: 0em;padding-left: 0.85em;font-family: monospace;unicode-bidi: isolate;display: box;">

<div><blockquote class="gmail_quote" style="border-left:#5555EE solid 0.2em;margin: 0em;padding-left: 0.85em;font-family: monospace;unicode-bidi: isolate;display: box;">

<div>+*** New minor mode 'cursor-indicators-mode'<br />
+This mode changes cursor appearance (color and/or type) to indicate<br />
+different buffer states.  This mode have cursor indicators for:<br />
+- Overwrite mode<br />
+- Read-only buffers<br />
+- Repeat mode<br />
+- Input method activation<br />

</div></blockquote>

</div></blockquote>

</div></blockquote>
</p>

<p>
<blockquote class="gmail_quote" style="border-left:#5555EE solid 0.2em;margin: 0em;padding-left: 0.85em;font-family: monospace;unicode-bidi: isolate;display: box;">

<div><blockquote class="gmail_quote" style="border-left:#5555EE solid 0.2em;margin: 0em;padding-left: 0.85em;font-family: monospace;unicode-bidi: isolate;display: box;">

<div>What if users want to add more conditions?<br />
Could you try to create only one defcustom that<br />
contains a list of default conditions<br />
plus a possible user-defined conditions.<br />
For example:<br />

</div></blockquote>

</div></blockquote>
</p>

<p>
<blockquote class="gmail_quote" style="border-left:#5555EE solid 0.2em;margin: 0em;padding-left: 0.85em;font-family: monospace;unicode-bidi: isolate;display: box;">

<div><blockquote class="gmail_quote" style="border-left:#5555EE solid 0.2em;margin: 0em;padding-left: 0.85em;font-family: monospace;unicode-bidi: isolate;display: box;">

<div>#+begin<sub>src</sub> emacs-lisp<br />
(defcustom cursor-indicators nil<br />
:type `(alist :key-type<br />
(choice :tag "Condition"<br />
(const :tag "Overwrite mode" overwrite)<br />
(const :tag "Read-only mode" read-only)<br />
(const :tag "Repeat mode" repeat-in-progress)<br />
(const :tag "Activated input method" input-method)<br />
(function :tag "Matcher function")) ;; User-defined condition<br />
:value-type<br />
(choice<br />
(const :tag "None (do not change cursor)" nil)<br />
(color :tag "Color")<br />
(choice :tag "Type"<br />
(const :tag "Filled box" box)<br />
(const :tag "Vertical bar" bar)<br />
(const :tag "Horizontal bar" hbar)<br />
(const :tag "Hollow box" hollow))<br />
(cons :tag "Color and Type"<br />
(choice :tag "Type"<br />
(const :tag "Filled box" box)<br />
(const :tag "Vertical bar" bar)<br />
(const :tag "Horizontal bar" hbar)<br />
(const :tag "Hollow box" hollow))<br />
(color :tag "Color")))))<br />
#+end<sub>src</sub><br />

</div></blockquote>

</div></blockquote>
</p>


<p>
<blockquote class="gmail_quote" style="border-left:#5555EE solid 0.2em;margin: 0em;padding-left: 0.85em;font-family: monospace;unicode-bidi: isolate;display: box;">

<div><blockquote class="gmail_quote" style="border-left:#5555EE solid 0.2em;margin: 0em;padding-left: 0.85em;font-family: monospace;unicode-bidi: isolate;display: box;">

<div>Then I could replace:<br />

</div></blockquote>

</div></blockquote>
</p>

<p>
<blockquote class="gmail_quote" style="border-left:#5555EE solid 0.2em;margin: 0em;padding-left: 0.85em;font-family: monospace;unicode-bidi: isolate;display: box;">

<div><blockquote class="gmail_quote" style="border-left:#5555EE solid 0.2em;margin: 0em;padding-left: 0.85em;font-family: monospace;unicode-bidi: isolate;display: box;">

<div>#+begin<sub>src</sub> emacs-lisp<br />
(defun my-change-cursor (&amp;rest _)<br />
"Change cursor color and type depending on insertion mode and input method."<br />
(set-cursor-color<br />
(cond (repeat-in-progress   "blue")<br />
(current-input-method "red3")<br />
(t                    "black")))<br />
(setq-default cursor-type<br />
(cond (overwrite-mode       'box)<br />
(t                    'bar))))<br />
#+end<sub>src</sub><br />

</div></blockquote>

</div></blockquote>
</p>


<p>
<blockquote class="gmail_quote" style="border-left:#5555EE solid 0.2em;margin: 0em;padding-left: 0.85em;font-family: monospace;unicode-bidi: isolate;display: box;">

<div><blockquote class="gmail_quote" style="border-left:#5555EE solid 0.2em;margin: 0em;padding-left: 0.85em;font-family: monospace;unicode-bidi: isolate;display: box;">

<div>with just<br />

</div></blockquote>

</div></blockquote>
</p>

<p>
<blockquote class="gmail_quote" style="border-left:#5555EE solid 0.2em;margin: 0em;padding-left: 0.85em;font-family: monospace;unicode-bidi: isolate;display: box;">

<div><blockquote class="gmail_quote" style="border-left:#5555EE solid 0.2em;margin: 0em;padding-left: 0.85em;font-family: monospace;unicode-bidi: isolate;display: box;">

<div>#+begin<sub>src</sub> emacs-lisp<br />
(setopt cursor-indicators '((repeat-in-progress   "blue")<br />
(current-input-method "red3")<br />
(overwrite-mode       'box)<br />
(default              'bar)))<br />
#+end<sub>src</sub><br />

</div></blockquote>

</div></blockquote>
</p>

<p>
<blockquote class="gmail_quote" style="border-left:#5555EE solid 0.2em;margin: 0em;padding-left: 0.85em;font-family: monospace;unicode-bidi: isolate;display: box;">

<div>I set the following hooks, which makes the cursor unobtrusive while I'm<br />
selecting text (C-SPC then moving cursor).  Could this also fit in the<br />
above framework?<br />

</div></blockquote>
</p>

<p>
<blockquote class="gmail_quote" style="border-left:#5555EE solid 0.2em;margin: 0em;padding-left: 0.85em;font-family: monospace;unicode-bidi: isolate;display: box;">

<div>(deactivate-mark-hook . (lambda () (setq cursor-type t)))<br />
(activate-mark-hook . (lambda () (setq cursor-type 'bar)))<br />

</div></blockquote>
</p>

<p>
Yeah, you can set it as something like this.<br />
</p>

<div class="org-src-container">
<pre style="color: #FCFCFA; background-color: #2D2A2E; padding: 0.1em; border-radius: 5px;" class="src src-elisp"><span style="color: #AB9DF2;">(</span><span style="color: #FF6188;">setopt</span> cursor-indicators-conditions '<span style="color: #78DCE8;">(</span><span style="color: #FC9867;">(</span>use-region-p . <span style="color: #FFD866;">"&#9210;purple"</span><span style="color: #FC9867;">)</span><span style="color: #78DCE8;">)</span><span style="color: #AB9DF2;">)</span>
</pre>
</div>

--==-=-=--

--=-=-=
Content-Type: text/plain



-- 
                                          - E.G via GNU Emacs and Org.

--=-=-=--




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

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


Received: (at 77224) by debbugs.gnu.org; 26 Mar 2025 04:55:29 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Mar 26 00:55:28 2025
Received: from localhost ([127.0.0.1]:40849 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1txInY-0002rD-3e
	for submit <at> debbugs.gnu.org; Wed, 26 Mar 2025 00:55:28 -0400
Received: from mail-oa1-x43.google.com ([2001:4860:4864:20::43]:58657)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <eg642616@HIDDEN>)
 id 1txInU-0002qU-40
 for 77224 <at> debbugs.gnu.org; Wed, 26 Mar 2025 00:55:25 -0400
Received: by mail-oa1-x43.google.com with SMTP id
 586e51a60fabf-2c759bf1b2eso3352242fac.1
 for <77224 <at> debbugs.gnu.org>; Tue, 25 Mar 2025 21:55:24 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1742964918; x=1743569718; darn=debbugs.gnu.org;
 h=mime-version:user-agent:message-id:date:references:in-reply-to
 :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to;
 bh=fJZTtYRiQ4ozjLGDMf31il2vtA4/cyFitZzuQmVWfq0=;
 b=cXsVFYEm97Of9ViUgDh/Unhk4w8lhyrY7hzGJ6oyeHOyvkHtluhDChGI9cBhDdSOD8
 mthFInO3M+naMOPxjAZJiuzOZ5mmZTI3em0eEXq9+y2Oa/9Iu3e4D+6EnaKEu3odfJX4
 sgHrE42yCIy9koSRzQrenZiZ8CHamEF4qnKrSxGe2/zMhM430HslTuDiTWVvVcM+sJoJ
 A5V9igj5B2ly8j0T1KSD7j3K69BYOXOrYC/Pr2jlPwkfOu9ukJBOpeZVX3n+/tGTsIgv
 vb5MpOeUqLUP2j/DvJBezE1Gj7EWg8+Vta/gV/pYmJy1TQ0U7sAYQqXpHfCAg5dz/N7b
 W/Ug==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1742964918; x=1743569718;
 h=mime-version:user-agent:message-id:date:references:in-reply-to
 :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date
 :message-id:reply-to;
 bh=fJZTtYRiQ4ozjLGDMf31il2vtA4/cyFitZzuQmVWfq0=;
 b=uzpbpVN0f2OMCvthYvtXKIjuL5pVEY/2eI2qlZOpAj8xM6eKwZKRUctJ4KCX7bGlUO
 6dWX7XRqWw5zC6+dqz8M2zP2uCeqB4FSxPD8GZIGvZuQiBna84WiH8Dh8DoS86+f0NlY
 rDuN7PMWhX384oJLZnGJpeQuIuLLmm64idNvq8PmCk9aP8EFskNsD7lC1kZJMh9zGRxJ
 voeJRoqMOMKLKi4+A+3o+hBsDnmK/7t/IxcSVQRovRZSgXnNKLQHxkiTVYmsMkrpAy2E
 nfhVUHHf/wn0SZWkxRJj7DLupgxofDry6y6AbSRHix5/zccYiw/z5q80YyMpw6fXQG2d
 gQCQ==
X-Gm-Message-State: AOJu0YxUpe6dfT5KncqcwtogOLr6uOoqG9xH8aOuODYf+NrvZ7jiGx08
 jUJSuxYz2/cQ2wd2rZfbRiNlN2Y4KaxqTyNuEOft4K4iV6HFmCXijSLi/o9o
X-Gm-Gg: ASbGncvZKhGqMgUKBxVVGiQLQIaY+yo1o52Nm94HP5mT2twm9xSUZtImcpwADQ9bgaO
 yX5WogdCIiMKE/h8MeTbUPDa4o3sQOf2HjLzVzjYku9k2iATqC1GOBxLQFMkZB+lb/wICEn8BV6
 RAJpPcGUlVf/d2ypRCFVuIc7IKoSgI7G3mUQoUUesr2zsLBhpLmwibeHRKlmYvHPXy9GQVd3SNv
 sA25eMPYjnt29eP2jmfh62ZroYvyidRDjcDabcpI3ONRkIy7QfLWNM4M+MUcEf7vPOkmiqdgDdD
 vFHZKFqJEs1l
X-Google-Smtp-Source: AGHT+IHQcguYjv0+1KQB5CQ7Ohw87RBKbVpxIc5bULOrkP6U4alKM9lYj9k9mB58eaO92Rw47y3U+g==
X-Received: by 2002:a05:6871:5310:b0:2c2:561c:47e3 with SMTP id
 586e51a60fabf-2c78032a79amr11647285fac.21.1742964917599; 
 Tue, 25 Mar 2025 21:55:17 -0700 (PDT)
Received: from fedora ([2806:10ae:e:5fce::1]) by smtp.gmail.com with ESMTPSA id
 586e51a60fabf-2c77ebc9f40sm2859234fac.3.2025.03.25.21.55.16
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 25 Mar 2025 21:55:16 -0700 (PDT)
From: =?utf-8?Q?Elijah_Gabe_P=C3=A9rez?= <eg642616@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#77224: [PATCH] New minor mode 'cursor-indicators-mode'
In-Reply-To: <86o6xpe2cx.fsf@HIDDEN>
References: <87iknzxski.fsf@HIDDEN> <87o6xq6fud.fsf@HIDDEN>
 <875xjymh93.fsf@HIDDEN> <87ikny2rio.fsf@HIDDEN>
 <86o6xpe2cx.fsf@HIDDEN>
Date: Tue, 25 Mar 2025 22:55:15 -0600
Message-ID: <87o6xobdcc.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/31.0.50
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-Spam-Score: 0.3 (/)
X-Debbugs-Envelope-To: 77224
Cc: , 77224 <at> debbugs.gnu.org, juri@HIDDEN
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.7 (/)

--=-=-=
Content-Type: multipart/alternative; boundary="==-=-="

--==-=-=
Content-Type: text/plain

I've updated the patch following Juri suggestions.
Now all the conditions are inside a single =defcustom=.

I've added only basic colors that a basic TTY can support, and a
=Package-Requires= tag in case this package should also be included in
ELPA.

This version now can handle functions as conditions (lambdas and function
symbols).




--==-=-=
Content-Type: text/html

<p>
I've updated the patch following Juri suggestions.<br />
Now all the conditions are inside a single <code>defcustom</code>.<br />
</p>

<p>
I've added only basic colors that a basic TTY can support, and a<br />
<code>Package-Requires</code> tag in case this package should also be included in<br />
ELPA.<br />
</p>

<p>
This version now can handle functions as conditions (lambdas and function<br />
symbols).<br />
</p>

--==-=-=--

--=-=-=
Content-Type: text/x-patch; charset=utf-8
Content-Disposition: attachment;
 filename=0001-New-minor-mode-cursor-indicators-mode.patch
Content-Transfer-Encoding: quoted-printable

From 2d89262880a47628cb47d803cedc6f04fd1f70d4 Mon Sep 17 00:00:00 2001
From: =3D?UTF-8?q?El=3DC3=3DADas=3D20Gabriel=3D20P=3DC3=3DA9rez?=3D <eg6426=
16@HIDDEN>
Date: Sat, 22 Mar 2025 22:56:01 -0600
Subject: [PATCH] New minor mode 'cursor-indicators-mode'

This minor mode changes the cursor appearance to indicate
buffers states, such as if overwrite-mode is active or current
buffer is read-only. (Bug#77224)
Acts similar to 'cua-enable-cursor-indications'
* etc/NEWS: Document changes.
* lisp/cursor-indicators.el
(cursor-indicators-conditions): New user option.
(cursor-indicators--default-cursor-color): New use internal variable.
(cursor-indicators--update-indications)
(cursor-indicators--change-cursor): New use internal function.
(cursor-indicators-mode): New minor mode definition.
---
 etc/NEWS                  |   9 +++
 lisp/cursor-indicators.el | 139 ++++++++++++++++++++++++++++++++++++++
 2 files changed, 148 insertions(+)
 create mode 100644 lisp/cursor-indicators.el

diff --git a/etc/NEWS b/etc/NEWS
index cc63d03eafe..e87afc8c1b6 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -1566,6 +1566,15 @@ This user option replaces 'follow-mode-prefix', whic=
h had to be set
 before loading Follow mode.  This new option allows you to change the
 prefix even after it was loaded, using 'customize-option' or 'setopt'.
=20
+---
+*** New minor mode 'cursor-indicators-mode'
+This mode changes cursor appearance (color and/or type) to indicate
+different buffer states according to 'cursor-indicators-conditions'.
+The mode have cursor indicators out the box for:
+- Overwrite mode
+- Read-only buffers
+- Input method activation
+
 ---
 *** cdl.el is now obsolete.
 Use 'shell-command' and 'shell-command-on-region' instead.
diff --git a/lisp/cursor-indicators.el b/lisp/cursor-indicators.el
new file mode 100644
index 00000000000..bbd33e7c634
--- /dev/null
+++ b/lisp/cursor-indicators.el
@@ -0,0 +1,139 @@
+;;; cursor-indicators.el --- Cursor indicators for some states  -*- lexica=
l-binding: t; -*-
+
+;; Copyright (C) 2025 Free Software Foundation, Inc.
+
+;; Version: 1.0.0
+;; Author: El=C3=ADas Gabriel P=C3=A9rez <eg642616@HIDDEN>
+;; Package-Requires: ((emacs "26.1"))
+
+;; This program is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; This program is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with this program.  If not, see <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+;; This package changes cursor appearance (color and/or type) to indicate
+;; different buffer states.
+
+;;; Code:
+(require 'map)
+
+;;; User options
+
+(defcustom cursor-indicators-conditions
+  '((overwrite-mode . box)
+    (buffer-read-only . "green")
+    (current-input-method . "blue"))
+  "Alist of conditions to which cursor should change its appearence.
+Only used when `cursor-indicators-mode' is enabled.
+
+Each element is an alist entry in one of these forms:
+  (CONDITION . COLOR)     Change cursor color
+  (CONDITION . TYPE)      Change cursor type
+  (CONDITION TYPE COLOR)  Change cursor color and type
+
+CONDITION must be a function (without arguments) or a variable that
+must return non-nil.
+COLOR is a string specifying the cursor color.
+TYPE specifies cursor type.
+
+Colors can be any valid color name or hex RGB value.
+Valid cursor types are:
+  `box'    - Filled box
+  `bar'    - Vertical bar
+  `hbar'   - Horizontal bar
+  `hollow' - Hollow box
+
+Each element in this alist takes predominance according to its order.
+
+If none of the conditions return non-nil, the cursor will use default
+cursor type and color."
+  :group 'cursor
+  :version "31.1"
+  :type '(alist :key-type
+                (choice :tag "Condition"
+                        (const :tag "Overwrite mode" overwrite-mode)
+                        (const :tag "Read-only mode" buffer-read-only)
+                        (const :tag "Repeat mode" repeat-in-progress)
+                        (const :tag "Activated input method" current-input=
-method)
+                        ;; User-defined conditions
+                        (function :tag "Variable")
+                        (variable :tag "Function"))
+                :value-type
+                (choice
+                 (color :tag "Color")
+                 (choice :tag "Type"
+                         (const :tag "Filled box" box)
+                         (const :tag "Vertical bar" bar)
+                         (const :tag "Horizontal bar" hbar)
+                         (const :tag "Hollow box" hollow))
+                 (group :tag "Color and Type"
+                        (choice :tag "Type"
+                                (const :tag "Filled box" box)
+                                (const :tag "Vertical bar" bar)
+                                (const :tag "Horizontal bar" hbar)
+                                (const :tag "Hollow box" hollow))
+                        (color :tag "Color")))))
+
+;;; Internal Code
+
+(defvar cursor-indicators--default-cursor-color (frame-parameter nil 'curs=
or-color))
+
+(defun cursor-indicators--change-cursor (key val)
+  ;; Check if KEY is non-nil
+  (when (or (and (symbolp key) (boundp key) (symbol-value key))
+            (and (interpreted-function-p key) (funcall key))
+            (and (functionp key) (symbolp key) (not (boundp key)) (funcall=
 key)))
+    (cond
+     ;; Set cursor color
+     ((and (stringp val) (not (equal val (frame-parameter nil 'cursor-colo=
r))))
+      (set-cursor-color val)
+      (setq-local cursor-type (default-value 'cursor-type))) ; Set to defa=
ult cursor type
+     ;; Set cursor type
+     ((and (symbolp val) (not (eq val (default-value 'cursor-type))))
+      (setq-local cursor-type val)
+      (set-cursor-color cursor-indicators--default-cursor-color)) ; Set to=
 default cursor color
+     ;; Set cursor color and type
+     ((consp val)
+      (let ((type (car val))
+            (color (cadr val)))
+        (when (and (symbolp type) (not (eq type (default-value 'cursor-typ=
e)))
+                   (stringp color) (not (equal color (frame-parameter nil =
'cursor-color))))
+          (set-cursor-color color)
+          (setq-local cursor-type type)))))
+    ;; And exit from loop.
+    (throw 'c-i-exit t)))
+
+(defun cursor-indicators--update-indications ()
+  ;; C-I-EXIT is used here for exit from loop.
+  (when (and cursor-type
+             (not (catch 'c-i-exit (map-do #'cursor-indicators--change-cur=
sor cursor-indicators-conditions))))
+    (setq-local cursor-type (default-value 'cursor-type))
+    (set-cursor-color cursor-indicators--default-cursor-color)))
+
+;;;###autoload
+(define-minor-mode cursor-indicators-mode
+  "Change cursor type and/or face for indications.
+When enabled, this mode changes the cursor appearance to indicate
+different buffer states."
+  :group 'cursor
+  :version "31.1"
+  :global t
+  (if cursor-indicators-mode
+      (progn
+        (add-hook 'post-command-hook #'cursor-indicators--update-indicatio=
ns)
+        (cursor-indicators--update-indications))
+    (remove-hook 'post-command-hook #'cursor-indicators--update-indication=
s)
+    (set-cursor-color cursor-indicators--default-cursor-color)
+    (setq-local cursor-type (default-value 'cursor-type))))
+
+(provide 'cursor-indicators)
+;;; cursor-indicators.el ends here
--=20
2.49.0


--=-=-=
Content-Type: text/plain


-- 
                                          - E.G via GNU Emacs and Org.

--=-=-=--




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

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


Received: (at 77224) by debbugs.gnu.org; 25 Mar 2025 12:12:14 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Mar 25 08:12:14 2025
Received: from localhost ([127.0.0.1]:36660 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tx38g-0007lU-70
	for submit <at> debbugs.gnu.org; Tue, 25 Mar 2025 08:12:14 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:34910)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1tx38b-0007l5-N2
 for 77224 <at> debbugs.gnu.org; Tue, 25 Mar 2025 08:12:11 -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 1tx38T-0001BN-UJ; Tue, 25 Mar 2025 08:12:02 -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=AZnr6eYsc7tQmD8NezzdEoVmNCaUqc3+AuwDVwWA1IA=; b=FD8HjQO6W9keVYee5NYX
 w2sB9IOkfItv31QfJqPI3YLDwKGA0pgKknb68LbKg9wK32ZpDC+1QXJ9lnlvbQzO3eYDx/Lp/Yecc
 SRZQbuNsRyWPrlOd49P6QQswBQlEofoW3pYRqbQF/TrjQKYk1qWHoF0EFs/dlh1kaly90H8Bq1zxH
 EOZlzq2M57MEKcoBkAyWGs5kS/zdL8kBxiAlekbmggB9PXvPPFDoVIsxyrK8NNbwXxD2b9L9QnZ6r
 dHyw55H7eUL+9YtHCW6a1oljGaBl3VUUHx0cg32/L511qDg13QXsYU1PzIviW2ZZqBcsHaaFD7k9A
 f4eLfDOnv2zIiQ==;
Date: Tue, 25 Mar 2025 14:11:58 +0200
Message-Id: <86o6xpe2cx.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Elijah Gabe =?utf-8?Q?P=C3=A9rez?= <eg642616@HIDDEN>
In-Reply-To: <87ikny2rio.fsf@HIDDEN> (message from Elijah Gabe
 =?utf-8?Q?P=C3=A9rez?= on Mon, 24 Mar 2025 12:49:19 -0600)
Subject: Re: bug#77224: [PATCH] New minor mode 'cursor-indicators-mode'
References: <87iknzxski.fsf@HIDDEN> <87o6xq6fud.fsf@HIDDEN>
 <875xjymh93.fsf@HIDDEN> <87ikny2rio.fsf@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 77224
Cc: 77224 <at> debbugs.gnu.org, shipmints@HIDDEN, juri@HIDDEN
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 (---)

> Cc: 77224 <at> debbugs.gnu.org, shipmints@HIDDEN, Juri Linkov <juri@HIDDEN>
> From: Elijah Gabe Pérez <eg642616@HIDDEN>
> Date: Mon, 24 Mar 2025 12:49:19 -0600
> 
> Ship Mints <shipmints@HIDDEN> writes:
> 
>  I think you need to update your configuration to not use tabs in lisp code–your patch is filled with tabs.
>  Standard elisp is this (see emacs/.dir-locals.el for other settings):
>  (emacs-lisp-mode . ((indent-tabs-mode . nil) …
> 
> Yeah, i forgot to untabify the whole file.

Thanks.

> +(defcustom cursor-indicators-overwrite-indicator "red3"

Using literal color names might be problematic on terminals that don't
support enough colors, unless you are extra careful to select colors
that are supported everywhere.  Alternatively, the default value could
be different for different numbers of supported colors.

Also, what happens if an Emacs session has both GUI frames (with lots
of colors) and TTY frames with a small number of colors -- does each
frame get its own color?

> +  "Cursor indicator used when overwrite mode is set, if non-nil.

That "if non-nil" part can potentially confuse, because it isn't clear
whether it refers to the value of the variable or to "overwrite mode".
Better say this the other way around:

  If non-nil, the cursor indication to use when overwrite mode is set.

(Note that I also slightly reworded the rest of this sentence, for
clarity.)

Suggest to make the same changes for other user options in this file.

> +(defcustom cursor-indicators-repeat-indicator "blue"
> +  "Cursor indicator used when `repeat-in-progress' is non-nil.

repeat-in-progress is an obscure variable, which is also not visible
until repeat.el is loaded.  Please reword this to be in user-level
terms, like "when a command is repeated due to `repeat-mode'" or
something similar.

Please also add the :version tag to each and every new defcustom.

> +(defcustom cursor-indicators-input-method-indicator "dark magenta"
> +  "Cursor indicator used when input method is activated now.
                                                           ^^^
What do you mean by "now"?

> +(define-minor-mode cursor-indicators-mode
> +  "Change cursor type and/or face for indications.

  "Change cursor type and/or face to indicate various minor modes."

> +When enabled, this mode changes the cursor appearance to indicate
> +overwrite mode or read-only buffers."
   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
That is not the full list of indications.




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

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


Received: (at submit) by debbugs.gnu.org; 25 Mar 2025 07:53:21 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Mar 25 03:53:21 2025
Received: from localhost ([127.0.0.1]:35982 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1twz68-0002x4-VP
	for submit <at> debbugs.gnu.org; Tue, 25 Mar 2025 03:53:21 -0400
Received: from lists.gnu.org ([2001:470:142::17]:50316)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <geb-bug-gnu-emacs@HIDDEN>)
 id 1twz66-0002wn-RJ
 for submit <at> debbugs.gnu.org; Tue, 25 Mar 2025 03:53:19 -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 <geb-bug-gnu-emacs@HIDDEN>)
 id 1twz60-0006Q6-8F
 for bug-gnu-emacs@HIDDEN; Tue, 25 Mar 2025 03:53:12 -0400
Received: from ciao.gmane.io ([116.202.254.214])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <geb-bug-gnu-emacs@HIDDEN>)
 id 1twz5y-0001Pv-3Y
 for bug-gnu-emacs@HIDDEN; Tue, 25 Mar 2025 03:53:11 -0400
Received: from list by ciao.gmane.io with local (Exim 4.92)
 (envelope-from <geb-bug-gnu-emacs@HIDDEN>)
 id 1twz5u-00074e-B7
 for bug-gnu-emacs@HIDDEN; Tue, 25 Mar 2025 08:53:06 +0100
X-Injected-Via-Gmane: http://gmane.org/
To: bug-gnu-emacs@HIDDEN
From: Rudolf Schlatte <rudi@HIDDEN>
Subject: Re: bug#77224: [PATCH] New minor mode 'cursor-indicators-mode'
Date: Tue, 25 Mar 2025 08:52:56 +0100
Message-ID: <m2h63hwnqf.fsf@HIDDEN>
References: <87iknzxski.fsf@HIDDEN> <87o6xq6fud.fsf@HIDDEN>
 <875xjymh93.fsf@HIDDEN> <87ikny2rio.fsf@HIDDEN>
 <871pula7sn.fsf@HIDDEN>
Mime-Version: 1.0
Content-Type: text/plain
User-Agent: Gnus/5.13 (Gnus v5.13)
Cancel-Lock: sha1:sPdbSBJhMZMbp/5fSFpyt5B+a/U=
Received-SPF: pass client-ip=116.202.254.214;
 envelope-from=geb-bug-gnu-emacs@HIDDEN; helo=ciao.gmane.io
X-Spam_score_int: -18
X-Spam_score: -1.9
X-Spam_bar: -
X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9,
 HEADER_FROM_DIFFERENT_DOMAINS=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001,
 RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: 0.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: -1.0 (-)

Juri Linkov <juri@HIDDEN> writes:

>> +*** New minor mode 'cursor-indicators-mode'
>> +This mode changes cursor appearance (color and/or type) to indicate
>> +different buffer states.  This mode have cursor indicators for:
>> +- Overwrite mode
>> +- Read-only buffers
>> +- Repeat mode
>> +- Input method activation
>
> What if users want to add more conditions?
> Could you try to create only one defcustom that
> contains a list of default conditions
> plus a possible user-defined conditions.
> For example:
>
> #+begin_src emacs-lisp
> (defcustom cursor-indicators nil
>   :type `(alist :key-type
>                   (choice :tag "Condition"
>                     (const :tag "Overwrite mode" overwrite)
>                     (const :tag "Read-only mode" read-only)
>                     (const :tag "Repeat mode" repeat-in-progress)
>                     (const :tag "Activated input method" input-method)
>                     (function :tag "Matcher function")) ;; User-defined condition
>                 :value-type
>                   (choice
>                     (const :tag "None (do not change cursor)" nil)
>                     (color :tag "Color")
>                     (choice :tag "Type"
>                             (const :tag "Filled box" box)
>                             (const :tag "Vertical bar" bar)
>                             (const :tag "Horizontal bar" hbar)
>                             (const :tag "Hollow box" hollow))
>                     (cons :tag "Color and Type"
>                           (choice :tag "Type"
>                                   (const :tag "Filled box" box)
>                                   (const :tag "Vertical bar" bar)
>                                   (const :tag "Horizontal bar" hbar)
>                                   (const :tag "Hollow box" hollow))
>                           (color :tag "Color")))))
> #+end_src
>
>
> Then I could replace:
>
> #+begin_src emacs-lisp
> (defun my-change-cursor (&rest _)
>   "Change cursor color and type depending on insertion mode and input method."
>   (set-cursor-color
>    (cond (repeat-in-progress   "blue")
>          (current-input-method "red3")
>          (t                    "black")))
>   (setq-default cursor-type
>    (cond (overwrite-mode       'box)
>          (t                    'bar))))
> #+end_src
>
>
> with just
>
> #+begin_src emacs-lisp
> (setopt cursor-indicators '((repeat-in-progress   "blue")
>                             (current-input-method "red3")
>                             (overwrite-mode       'box)
>                             (default              'bar)))
> #+end_src

I set the following hooks, which makes the cursor unobtrusive while I'm
selecting text (C-SPC then moving cursor).  Could this also fit in the
above framework?

(deactivate-mark-hook . (lambda () (setq cursor-type t)))
(activate-mark-hook . (lambda () (setq cursor-type 'bar)))





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

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


Received: (at 77224) by debbugs.gnu.org; 25 Mar 2025 07:34:41 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Mar 25 03:34:41 2025
Received: from localhost ([127.0.0.1]:35920 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1twyo5-00023h-7f
	for submit <at> debbugs.gnu.org; Tue, 25 Mar 2025 03:34:41 -0400
Received: from relay3-d.mail.gandi.net ([2001:4b98:dc4:8::223]:46273)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <juri@HIDDEN>) id 1twyo2-00023P-QX
 for 77224 <at> debbugs.gnu.org; Tue, 25 Mar 2025 03:34:39 -0400
Received: by mail.gandi.net (Postfix) with ESMTPSA id 4CF7D20487;
 Tue, 25 Mar 2025 07:34:28 +0000 (UTC)
From: Juri Linkov <juri@HIDDEN>
To: Elijah Gabe =?iso-8859-1?Q?P=E9rez?= <eg642616@HIDDEN>
Subject: Re: bug#77224: [PATCH] New minor mode 'cursor-indicators-mode'
In-Reply-To: <87ikny2rio.fsf@HIDDEN>
Organization: LINKOV.NET
References: <87iknzxski.fsf@HIDDEN> <87o6xq6fud.fsf@HIDDEN>
 <875xjymh93.fsf@HIDDEN> <87ikny2rio.fsf@HIDDEN>
Date: Tue, 25 Mar 2025 09:34:08 +0200
Message-ID: <871pula7sn.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/31.0.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain
X-GND-State: clean
X-GND-Score: -100
X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdduiedvtdeiucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuifetpfffkfdpucggtfgfnhhsuhgsshgtrhhisggvnecuuegrihhlohhuthemuceftddunecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvfevufgjohhffffkfgggtgesthdtredttdertdenucfhrhhomheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqeenucggtffrrghtthgvrhhnpeffgeetfeevlefhleejfeeuheeiudeitdffhfdutdekfeffgffhveehteegueekheenucfkphepledurdduvdelrddutdehrdduudejnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepledurdduvdelrddutdehrdduudejpdhhvghlohepmhgrihhlrdhgrghnughirdhnvghtpdhmrghilhhfrhhomhepjhhurhhisehlihhnkhhovhdrnhgvthdpnhgspghrtghpthhtohepfedprhgtphhtthhopehshhhiphhmihhnthhssehgmhgrihhlrdgtohhmpdhrtghpthhtohepjeejvddvgeesuggvsggsuhhgshdrghhnuhdrohhrghdprhgtphhtthhopegvgheigedvieduieesghhmrghilhdrtghomh
X-GND-Sasl: juri@HIDDEN
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 77224
Cc: 77224 <at> debbugs.gnu.org, shipmints@HIDDEN
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.7 (-)

> +*** New minor mode 'cursor-indicators-mode'
> +This mode changes cursor appearance (color and/or type) to indicate
> +different buffer states.  This mode have cursor indicators for:
> +- Overwrite mode
> +- Read-only buffers
> +- Repeat mode
> +- Input method activation

What if users want to add more conditions?
Could you try to create only one defcustom that
contains a list of default conditions
plus a possible user-defined conditions.
For example:

#+begin_src emacs-lisp
(defcustom cursor-indicators nil
  :type `(alist :key-type
                  (choice :tag "Condition"
                    (const :tag "Overwrite mode" overwrite)
                    (const :tag "Read-only mode" read-only)
                    (const :tag "Repeat mode" repeat-in-progress)
                    (const :tag "Activated input method" input-method)
                    (function :tag "Matcher function")) ;; User-defined condition
                :value-type
                  (choice
                    (const :tag "None (do not change cursor)" nil)
                    (color :tag "Color")
                    (choice :tag "Type"
                            (const :tag "Filled box" box)
                            (const :tag "Vertical bar" bar)
                            (const :tag "Horizontal bar" hbar)
                            (const :tag "Hollow box" hollow))
                    (cons :tag "Color and Type"
                          (choice :tag "Type"
                                  (const :tag "Filled box" box)
                                  (const :tag "Vertical bar" bar)
                                  (const :tag "Horizontal bar" hbar)
                                  (const :tag "Hollow box" hollow))
                          (color :tag "Color")))))
#+end_src

Then I could replace:

#+begin_src emacs-lisp
(defun my-change-cursor (&rest _)
  "Change cursor color and type depending on insertion mode and input method."
  (set-cursor-color
   (cond (repeat-in-progress   "blue")
         (current-input-method "red3")
         (t                    "black")))
  (setq-default cursor-type
   (cond (overwrite-mode       'box)
         (t                    'bar))))
#+end_src

with just

#+begin_src emacs-lisp
(setopt cursor-indicators '((repeat-in-progress   "blue")
                            (current-input-method "red3")
                            (overwrite-mode       'box)
                            (default              'bar)))
#+end_src




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

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


Received: (at 77224) by debbugs.gnu.org; 24 Mar 2025 18:49:31 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Mar 24 14:49:31 2025
Received: from localhost ([127.0.0.1]:58398 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1twmra-0000BY-KV
	for submit <at> debbugs.gnu.org; Mon, 24 Mar 2025 14:49:31 -0400
Received: from mail-oi1-x243.google.com ([2607:f8b0:4864:20::243]:53687)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <eg642616@HIDDEN>)
 id 1twmrX-0000Af-Ks
 for 77224 <at> debbugs.gnu.org; Mon, 24 Mar 2025 14:49:28 -0400
Received: by mail-oi1-x243.google.com with SMTP id
 5614622812f47-3f6a92f234dso2670789b6e.3
 for <77224 <at> debbugs.gnu.org>; Mon, 24 Mar 2025 11:49:27 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1742842161; x=1743446961; darn=debbugs.gnu.org;
 h=mime-version:user-agent:message-id:date:references:in-reply-to
 :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to;
 bh=EI3/qq0DZK8fLacC2IwkKo9MQzm0N+GZH+dvuEnwkGs=;
 b=cXNbR0+OfTjsO9ZljolVD1TxS5x9ePm+rhvZW/JocyiSgvDUKR1JOsi1eBAfLWMhDE
 fH87YSNPg+dH5kUI9klFfc4fB5PQKVS+0g6FefSmdg+yVgp54FDan2TfwkvvWwQGlvm9
 zEuYmySdso8ZG2t8u0LEgGgaOvB8I8Qa5xXobOUPG08DyzJ0dmwJ499TLUJtNIIw0l2C
 DQOxZij/DNVQ7qwa7Km+C3Q+IwbNcOl9yecX+U+Ozq+1exT2UP2HWKb3faZ8krk1W9N0
 NGg8ZoLhEdqsNZ3D9vktVSikx/Np40zrCQ4NU/fs9r5PrSKnemD2XmLIduLdpajaK+Us
 mttQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1742842161; x=1743446961;
 h=mime-version:user-agent:message-id:date:references:in-reply-to
 :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date
 :message-id:reply-to;
 bh=EI3/qq0DZK8fLacC2IwkKo9MQzm0N+GZH+dvuEnwkGs=;
 b=XqmsEahTUuRa/XWud3c7CdZj3fhbJeMmtnR9Cpd34VxeQfDDeegjwjJHYPs1F99NgE
 aBQ6e44dySBWf4M9Y7cI24q9ur5GeR9gPA2ayhrgXUEqsB34ucCaGqw1eSmZnrjPG/VG
 +nfvjLE1o7RQETCLKSVqXYyeudi+Oi8Hu6zHvQ7atEm2TppcNFu38fB6bunuF69wZPUw
 9b66ak3f65lXSB/C0iTupoBk1Sb/uUVUy6LDe7KVvv093La0qXu6a3TIzo/XSQM4/tKt
 Kl+to2rBw6oLwJHEd4PRSJX9XDwsN5uHF3DuBZlCZH3iOumHYVHmd77McbEB72dli2vD
 LqfA==
X-Gm-Message-State: AOJu0Yyuotz8nc221slnlf0TddGz7VepZo/7l8e9RuLeI2oXG6mCL7FA
 d3V5kNd+YGD0ClCRTi1mApnbi7dDryZJe2o1RkIMGDT5XvrizAF/
X-Gm-Gg: ASbGncuJ0cUw1CxqGXJ8OU39T7hBaYRbjVG78ejHSAV8gYofq0Wb6ZSeePGVm9tvbn5
 P6EfSQwpH3du85ZOHFsgFyX4F4Fqwrq9ivt3U1zcvoCVZzZjZoZyCBiAlaq/3CeF4R2nB7VrRKw
 lh3Uh+CFh7n0pMDl/5eMBtn8vSVJ/D1UM5BznrY2m0QQe9IpLNOa3EFA84/Kgn5OG1F1yAH+m7z
 dKiAR3YciRoYMkhfrQfa5OTeoTsgmSVn2zDHy5fNoQ2ui0MUtlR2kuJY5pJIHcEDFz/KDJwxVWu
 puNsgkCwIb26
X-Google-Smtp-Source: AGHT+IHQDT2aOIuDvvBQjx8I+piE5HmA6YrNqNkqGo+iFSJYPzWB9VYnZN/f8Cq64J4MMrGoLD+rqA==
X-Received: by 2002:a05:6808:199c:b0:3f9:17f9:30bd with SMTP id
 5614622812f47-3febf702481mr8726512b6e.7.1742842161121; 
 Mon, 24 Mar 2025 11:49:21 -0700 (PDT)
Received: from fedora ([2806:10ae:e:5fce::1]) by smtp.gmail.com with ESMTPSA id
 5614622812f47-3febf79dda8sm1668667b6e.44.2025.03.24.11.49.20
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 24 Mar 2025 11:49:20 -0700 (PDT)
From: =?utf-8?Q?Elijah_Gabe_P=C3=A9rez?= <eg642616@HIDDEN>
To: eg642616@HIDDEN
Subject: Re: bug#77224: [PATCH] New minor mode 'cursor-indicators-mode'
In-Reply-To: <875xjymh93.fsf@HIDDEN>
References: <87iknzxski.fsf@HIDDEN> <87o6xq6fud.fsf@HIDDEN>
 <875xjymh93.fsf@HIDDEN>
Date: Mon, 24 Mar 2025 12:49:19 -0600
Message-ID: <87ikny2rio.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/31.0.50
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-Spam-Score: 0.3 (/)
X-Debbugs-Envelope-To: 77224
Cc: 77224 <at> debbugs.gnu.org, shipmints@HIDDEN, Juri Linkov <juri@HIDDEN>
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.7 (/)

--=-=-=
Content-Type: multipart/alternative; boundary="==-=-="

--==-=-=
Content-Type: text/plain

Ship Mints <shipmints@HIDDEN> writes:

> I think you need to update your configuration to not use tabs in lisp code--your patch is filled with tabs.
> Standard elisp is this (see emacs/.dir-locals.el for other settings):
> (emacs-lisp-mode . ((indent-tabs-mode . nil) ...

Yeah, i forgot to untabify the whole file.

Sending fixed one.



--==-=-=
Content-Type: text/html

<p>
Ship Mints &lt;shipmints@HIDDEN&gt; writes:<br />
</p>

<p>
<blockquote class="gmail_quote" style="border-left:#5555EE solid 0.2em;margin: 0em;padding-left: 0.85em;font-family: monospace;unicode-bidi: isolate;display: box;">

<div>I think you need to update your configuration to not use tabs in lisp code&#x2013;your patch is filled with tabs.<br />
Standard elisp is this (see emacs/.dir-locals.el for other settings):<br />
(emacs-lisp-mode . ((indent-tabs-mode . nil) &#x2026;<br />

</div></blockquote>
</p>

<p>
Yeah, i forgot to untabify the whole file.<br />
</p>

<p>
Sending fixed one.<br />
</p>

--==-=-=--

--=-=-=
Content-Type: text/x-patch; charset=utf-8
Content-Disposition: attachment;
 filename=0001-New-minor-mode-cursor-indicators-mode.patch
Content-Transfer-Encoding: quoted-printable

From b2e9e8e1b60c3d0f051c3c7d0bbe6af39edf2408 Mon Sep 17 00:00:00 2001
From: =3D?UTF-8?q?El=3DC3=3DADas=3D20Gabriel=3D20P=3DC3=3DA9rez?=3D <eg6426=
16@HIDDEN>
Date: Sat, 22 Mar 2025 22:56:01 -0600
Subject: [PATCH] New minor mode 'cursor-indicators-mode'

This minor mode changes the cursor appearance to indicate
buffers states, such as if overwrite-mode is active or current
buffer is read-only. (Bug#77224)
Acts similar to 'cua-enable-cursor-indications'
* etc/NEWS: Document changes.
* lisp/cursor-indicators.el
(cursor-indicators-overwrite-indicator)
(cursor-indicators-repeat-indicator)
(cursor-indicators-input-method-indicator)
(cursor-indicators-read-only-indicator): New user options.
(cursor-indicators--default-cursor-color): New use internal variable.
(cursor-indicators--update-indications): New use internal function.
(cursor-indicators-mode): New minor mode definition.
---
 etc/NEWS                  |   9 ++
 lisp/cursor-indicators.el | 185 ++++++++++++++++++++++++++++++++++++++
 2 files changed, 194 insertions(+)
 create mode 100644 lisp/cursor-indicators.el

diff --git a/etc/NEWS b/etc/NEWS
index cc63d03eafe..a9fee82a29e 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -1566,6 +1566,15 @@ This user option replaces 'follow-mode-prefix', whic=
h had to be set
 before loading Follow mode.  This new option allows you to change the
 prefix even after it was loaded, using 'customize-option' or 'setopt'.
=20
+---
+*** New minor mode 'cursor-indicators-mode'
+This mode changes cursor appearance (color and/or type) to indicate
+different buffer states.  This mode have cursor indicators for:
+- Overwrite mode
+- Read-only buffers
+- Repeat mode
+- Input method activation
+
 ---
 *** cdl.el is now obsolete.
 Use 'shell-command' and 'shell-command-on-region' instead.
diff --git a/lisp/cursor-indicators.el b/lisp/cursor-indicators.el
new file mode 100644
index 00000000000..cf778c5bfce
--- /dev/null
+++ b/lisp/cursor-indicators.el
@@ -0,0 +1,185 @@
+;;; cursor-indicators.el --- Cursor indicators for some states  -*- lexica=
l-binding: t; -*-
+
+;; Copyright (C) 2025 Free Software Foundation, Inc.
+
+;; Author: El=C3=ADas Gabriel P=C3=A9rez <eg642616@HIDDEN>
+;; Keywords:
+
+;; This program is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; This program is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with this program.  If not, see <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+;; This package changes cursor appearance (color and/or type) to indicate
+;; different buffer states.
+;;
+;; For example:
+;;
+;; The following setting will use a YELLOW cursor in overwrite mode in rea=
d-write
+;; buffers, and a GREEN cursor in read-only buffers:
+;;
+;;  (setq cursor-indicators-overwrite-indicator "yellow")
+;;  (setq cursor-indicators-read-only-indicator "green")
+
+
+;;; Code:
+
+;;; User options
+(defcustom cursor-indicators-overwrite-indicator "red3"
+  "Cursor indicator used when overwrite mode is set, if non-nil.
+Only used when `cursor-indicators-mode' is enabled.
+
+If the value is a COLOR name, then only the `cursor-color' attribute will =
be
+affected.  If the value is a cursor TYPE (one of: box, hollow, bar, or hba=
r),
+then only the `cursor-type' property will be affected.  If the value is
+a cons (TYPE . COLOR), then both properties are affected.
+If the value is nil then do not change cursor."
+  :group 'cursor
+  :type '(choice
+          (const :tag "None (do not change cursor)" nil)
+          (color :tag "Color")
+          (choice :tag "Type"
+                  (const :tag "Filled box" box)
+                  (const :tag "Vertical bar" bar)
+                  (const :tag "Horizontal bar" hbar)
+                  (const :tag "Hollow box" hollow))
+          (cons :tag "Color and Type"
+                (choice :tag "Type"
+                        (const :tag "Filled box" box)
+                        (const :tag "Vertical bar" bar)
+                        (const :tag "Horizontal bar" hbar)
+                        (const :tag "Hollow box" hollow))
+                (color :tag "Color"))))
+
+(defcustom cursor-indicators-read-only-indicator "darkgreen"
+  "Cursor indicator used in read-only buffers, if non-nil.
+Only used when `cursor-indicators-mode' is enabled.
+
+If the value is a COLOR name, then only the `cursor-color' attribute will =
be
+affected.  If the value is a cursor TYPE (one of: box, hollow, bar, or hba=
r),
+then only the `cursor-type' property will be affected.  If the value is
+a cons (TYPE . COLOR), then both properties are affected.
+If the value is nil then do not change cursor."
+  :group 'cursor
+  :type '(choice
+          (const :tag "None (do not change cursor)" nil)
+          (color :tag "Color")
+          (choice :tag "Type"
+                  (const :tag "Filled box" box)
+                  (const :tag "Vertical bar" bar)
+                  (const :tag "Horizontal bar" hbar)
+                  (const :tag "Hollow box" hollow))
+          (cons :tag "Color and Type"
+                (choice :tag "Type"
+                        (const :tag "Filled box" box)
+                        (const :tag "Vertical bar" bar)
+                        (const :tag "Horizontal bar" hbar)
+                        (const :tag "Hollow box" hollow))
+                (color :tag "Color"))))
+
+(defcustom cursor-indicators-repeat-indicator "blue"
+  "Cursor indicator used when `repeat-in-progress' is non-nil.
+Only used when `cursor-indicators-mode' is enabled.
+
+If the value is a COLOR name, then only the `cursor-color' attribute will =
be
+affected.  If the value is a cursor TYPE (one of: box, hollow, bar, or hba=
r),
+then only the `cursor-type' property will be affected.  If the value is
+a cons (TYPE . COLOR), then both properties are affected.
+If the value is nil then do not change cursor."
+  :group 'cursor
+  :type '(choice
+          (const :tag "None (do not change cursor)" nil)
+          (color :tag "Color")
+          (choice :tag "Type"
+                  (const :tag "Filled box" box)
+                  (const :tag "Vertical bar" bar)
+                  (const :tag "Horizontal bar" hbar)
+                  (const :tag "Hollow box" hollow))
+          (cons :tag "Color and Type"
+                (choice :tag "Type"
+                        (const :tag "Filled box" box)
+                        (const :tag "Vertical bar" bar)
+                        (const :tag "Horizontal bar" hbar)
+                        (const :tag "Hollow box" hollow))
+                (color :tag "Color"))))
+
+(defcustom cursor-indicators-input-method-indicator "dark magenta"
+  "Cursor indicator used when input method is activated now.
+Only used when `cursor-indicators-mode' is enabled.
+
+If the value is a COLOR name, then only the `cursor-color' attribute will =
be
+affected.  If the value is a cursor TYPE (one of: box, hollow, bar, or hba=
r),
+then only the `cursor-type' property will be affected.  If the value is
+a cons (TYPE . COLOR), then both properties are affected.
+If the value is nil then do not change cursor."
+  :group 'cursor
+  :type '(choice
+          (const :tag "None (do not change cursor)" nil)
+          (color :tag "Color")
+          (choice :tag "Type"
+                  (const :tag "Filled box" box)
+                  (const :tag "Vertical bar" bar)
+                  (const :tag "Horizontal bar" hbar)
+                  (const :tag "Hollow box" hollow))
+          (cons :tag "Color and Type"
+                (choice :tag "Type"
+                        (const :tag "Filled box" box)
+                        (const :tag "Vertical bar" bar)
+                        (const :tag "Horizontal bar" hbar)
+                        (const :tag "Hollow box" hollow))
+                (color :tag "Color"))))
+
+;;; Internal Code
+
+(defvar cursor-indicators--default-cursor-color (frame-parameter nil 'curs=
or-color))
+
+(defun cursor-indicators--update-indications (&optional cursor-color)
+  (let* ((cursor
+          (or
+           ;; CURSOR-COLOR is intended to be used by the user in an advice=
-add
+           cursor-color
+           ;; XXX: global mark?
+           ;; (and cua--global-mark-active cursor-indicators-global-mark-c=
olor)
+           (and buffer-read-only cursor-indicators-read-only-indicator)
+           (and overwrite-mode cursor-indicators-overwrite-indicator)
+           (and (bound-and-true-p repeat-in-progress) cursor-indicators-re=
peat-indicator)
+           (and (bound-and-true-p current-input-method) cursor-indicators-=
input-method-indicator)
+           (cons (default-value 'cursor-type)
+                 cursor-indicators--default-cursor-color)))
+         (color (if (consp cursor) (cdr cursor) cursor))
+         (type (if (consp cursor) (car cursor) cursor)))
+    (if (and color
+             (stringp color)
+             (not (equal color (frame-parameter nil 'cursor-color))))
+        (set-cursor-color color))
+    (if (and type
+             (symbolp type)
+             (not (eq type (default-value 'cursor-type))))
+        (setq-local cursor-type type))))
+
+;;;###autoload
+(define-minor-mode cursor-indicators-mode
+  "Change cursor type and/or face for indications.
+When enabled, this mode changes the cursor appearance to indicate
+overwrite mode or read-only buffers."
+  :group 'cursor
+  :global t
+  (if cursor-indicators-mode
+      (progn
+        (add-hook 'post-command-hook #'cursor-indicators--update-indicatio=
ns)
+        (cursor-indicators--update-indications))
+    (remove-hook 'post-command-hook #'cursor-indicators--update-indication=
s)
+    (set-cursor-color cursor-indicators--default-cursor-color)
+    (setq-local cursor-type (default-value 'cursor-type))))
+
+(provide 'cursor-indicators)
+;;; cursor-indicators.el ends here
--=20
2.49.0


--=-=-=
Content-Type: text/plain


-- 
                                          - E.G via GNU Emacs and Org.

--=-=-=--




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

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


Received: (at 77224) by debbugs.gnu.org; 24 Mar 2025 18:11:07 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Mar 24 14:11:06 2025
Received: from localhost ([127.0.0.1]:58080 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1twmGL-0003Wi-Df
	for submit <at> debbugs.gnu.org; Mon, 24 Mar 2025 14:11:06 -0400
Received: from mail-oi1-x242.google.com ([2607:f8b0:4864:20::242]:43313)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <eg642616@HIDDEN>)
 id 1twmGH-0003Vl-MS
 for 77224 <at> debbugs.gnu.org; Mon, 24 Mar 2025 14:10:59 -0400
Received: by mail-oi1-x242.google.com with SMTP id
 5614622812f47-3fa58dc37c5so2828309b6e.1
 for <77224 <at> debbugs.gnu.org>; Mon, 24 Mar 2025 11:10:57 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1742839851; x=1743444651; darn=debbugs.gnu.org;
 h=mime-version:user-agent:message-id:date:references:in-reply-to
 :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to;
 bh=I7jF0nrZ+4EEJPwqiJGgpZKHItTkDEnNxNokgXuWopQ=;
 b=WYed4Nh/qbl7tZepBdfe1adk+q7dnqqMdgxl6ozeAr+I9Uo1fpTPBCGMJs+OBxHAgz
 xO+KVmdnohEZfMPeJvqF2BHAPWMA6seA4hKRse0Fots2vFRYH36gneej5MM4NT/0Xivg
 JyosomWhiVlWU2iXLkpy3CdrwdbzKXaYfVw5+8QF5N3qVJ1BM/o5Hg0BLRopPEL0aveB
 X3nC1DMIkjHYjx6k7pd1SBQDl3PUGtzAQYx5eSjRlAus09t24dVdS66N0J2POXW+OivB
 NXHdQR2JsKlNPaMOhgwIaz83IztKdIAx3yD8zsWgL8Zw/S5tQ5tVP72IMoycs0Lkwf18
 xdag==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1742839851; x=1743444651;
 h=mime-version:user-agent:message-id:date:references:in-reply-to
 :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date
 :message-id:reply-to;
 bh=I7jF0nrZ+4EEJPwqiJGgpZKHItTkDEnNxNokgXuWopQ=;
 b=ls3dSt1G7abywDGG1PyJ6RslJ+J5DIeSHNg3ZhMXJSTADu+zpEDnTNxEfAspr+F807
 Xs3FEhMbeGc7vhRONU0idEWy7lqDvO2FnMmkluH+D84UwpHtNwzFWabv+yXtoTixxvDr
 sXZj0uBwGklKNgArZ6eagpnDjX/DhFXFnOHz6TZJ7BWW2lhJ0Lmn10mYpiwlW7wDz43w
 ij7H4fd87nIlITZclZnYLry1B4cHXC8VdRXJ2YyLuRIzWHxZF7v9e/qvetWevQI3AVL9
 dnGNehDgCsQ/2+CIZWnn52TvLk4pjNVQ/sTxJ7SH48GvmwdtdWSx/Gv72VjurmS1ycY5
 /FOA==
X-Gm-Message-State: AOJu0YwYlmWy2yks9BD0NyejEyO78smc+6HwJsRAsV+v24+G3EOfe+Ht
 px1ssvV+VcP8362HYRM5F8RIq8CqVZ5yQf9W7Cl8P0I3VUiJdfeYNYhCulzK
X-Gm-Gg: ASbGncurbHwbn4GUBYnn3dz2sE+E6eAqf+o4QdwKnjRyt2PAPrQ1/vMZ7bQmr/1Sz5A
 nAmk6HxVOyAoIJMvGaZm60b9FWLR82Ho+Xsrrm0T7OLRO895w5u4Jzt/w4K6WfIPIsQoqemlv7f
 KHHwyauQRDpMPyG0KOtrje4lEsv4CIFSUFatnW+PUJsc0GiVd83nyjOm2/KY+9cXNp46Th3NTif
 Mu6Pj6lvtfWfNEwpRQ6WbHymq1Q1WcspUs/nZNJGyLsXhW1Ro5h8xAQ2l/uVcNy4Kwd0JhTZyWE
 orPLUgcrsZnx
X-Google-Smtp-Source: AGHT+IEF8qLi5HVk132mALWTGcT5OuNDcpn4Cvx3boc2mrMrN/uOg7j/yEpG1IteXf3zPV0hgFXz8A==
X-Received: by 2002:a05:6808:6b48:b0:3f4:bc5:d47a with SMTP id
 5614622812f47-3febee94fbemr9219867b6e.13.1742839850959; 
 Mon, 24 Mar 2025 11:10:50 -0700 (PDT)
Received: from fedora ([2806:10ae:e:5fce::1]) by smtp.gmail.com with ESMTPSA id
 5614622812f47-3febf79e27dsm1687659b6e.50.2025.03.24.11.10.49
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 24 Mar 2025 11:10:50 -0700 (PDT)
From: =?utf-8?Q?Elijah_Gabe_P=C3=A9rez?= <eg642616@HIDDEN>
To: Juri Linkov <juri@HIDDEN>
Subject: Re: bug#77224: [PATCH] New minor mode 'cursor-indicators-mode'
In-Reply-To: <87o6xq6fud.fsf@HIDDEN>
References: <87iknzxski.fsf@HIDDEN> <87o6xq6fud.fsf@HIDDEN>
Date: Mon, 24 Mar 2025 12:10:48 -0600
Message-ID: <875xjymh93.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/31.0.50
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-Spam-Score: 0.3 (/)
X-Debbugs-Envelope-To: 77224
Cc: 77224 <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: -0.7 (/)

--=-=-=
Content-Type: multipart/alternative; boundary="==-=-="

--==-=-=
Content-Type: text/plain

Juri Linkov <juri@HIDDEN> writes:

>> FWIW, I have this in my init file since forever:

>> (setq my/set-cursor-color-color "")
>> (setq my/set-cursor-color-buffer "")
>> (defun my/set-cursor-color-according-to-mode ()
>> "Change cursor color according to some minor modes."
>> ;; set-cursor-color is somewhat costly, so we only call it when needed:
>> (let ((color
>> (if buffer-read-only "#8888FF"
>> (if overwrite-mode "#000000"
>> "#FF0000"))))
>> (unless (and
>> (string= color my/set-cursor-color-color)
>> (string= (buffer-name) my/set-cursor-color-buffer))
>> (set-cursor-color (setq my/set-cursor-color-color color))
>> (setq my/set-cursor-color-buffer (buffer-name)))))
>> (add-hook 'post-command-hook 'my/set-cursor-color-according-to-mode)

> Cool.  Will it be possible to replace these settings in my init file
> with the new package?

> #+begin_src emacs-lisp
> (defun my-change-cursor (&rest _)
>   "Change cursor color and type depending on insertion mode and input method."
>   (set-cursor-color
>    (cond (repeat-in-progress   "blue")
>          (current-input-method "red3")
>          (t                    "black")))
>   (setq-default cursor-type
>    (cond (overwrite-mode       'box)
>          (t                    'bar))))
> (add-hook 'post-command-hook 'my-change-cursor t)

> ;; Also update the cursor on the repeat timer events:
> (add-function :after repeat-echo-function #'my-change-cursor)
> #+end_src

Sure, I've updated the patch for handle this.





--==-=-=
Content-Type: text/html

<p>
Juri Linkov &lt;juri@HIDDEN&gt; writes:<br />
</p>

<p>
<blockquote class="gmail_quote" style="border-left:#5555EE solid 0.2em;margin: 0em;padding-left: 0.85em;font-family: monospace;unicode-bidi: isolate;display: box;">

<div><blockquote class="gmail_quote" style="border-left:#5555EE solid 0.2em;margin: 0em;padding-left: 0.85em;font-family: monospace;unicode-bidi: isolate;display: box;">

<div>FWIW, I have this in my init file since forever:<br />

</div></blockquote>

</div></blockquote>
</p>

<p>
<blockquote class="gmail_quote" style="border-left:#5555EE solid 0.2em;margin: 0em;padding-left: 0.85em;font-family: monospace;unicode-bidi: isolate;display: box;">

<div><blockquote class="gmail_quote" style="border-left:#5555EE solid 0.2em;margin: 0em;padding-left: 0.85em;font-family: monospace;unicode-bidi: isolate;display: box;">

<div>(setq my/set-cursor-color-color "")<br />
(setq my/set-cursor-color-buffer "")<br />
(defun my/set-cursor-color-according-to-mode ()<br />
"Change cursor color according to some minor modes."<br />
;; set-cursor-color is somewhat costly, so we only call it when needed:<br />
(let ((color<br />
(if buffer-read-only "#8888FF"<br />
(if overwrite-mode "#000000"<br />
"#FF0000"))))<br />
(unless (and<br />
(string= color my/set-cursor-color-color)<br />
(string= (buffer-name) my/set-cursor-color-buffer))<br />
(set-cursor-color (setq my/set-cursor-color-color color))<br />
(setq my/set-cursor-color-buffer (buffer-name)))))<br />
(add-hook 'post-command-hook 'my/set-cursor-color-according-to-mode)<br />

</div></blockquote>

</div></blockquote>
</p>

<p>
<blockquote class="gmail_quote" style="border-left:#5555EE solid 0.2em;margin: 0em;padding-left: 0.85em;font-family: monospace;unicode-bidi: isolate;display: box;">

<div>Cool.  Will it be possible to replace these settings in my init file<br />
with the new package?<br />

</div></blockquote>
</p>

<p>
<blockquote class="gmail_quote" style="border-left:#5555EE solid 0.2em;margin: 0em;padding-left: 0.85em;font-family: monospace;unicode-bidi: isolate;display: box;">

<div>#+begin<sub>src</sub> emacs-lisp<br />
(defun my-change-cursor (&amp;rest _)<br />
"Change cursor color and type depending on insertion mode and input method."<br />
(set-cursor-color<br />
(cond (repeat-in-progress   "blue")<br />
(current-input-method "red3")<br />
(t                    "black")))<br />
(setq-default cursor-type<br />
(cond (overwrite-mode       'box)<br />
(t                    'bar))))<br />
(add-hook 'post-command-hook 'my-change-cursor t)<br />

</div></blockquote>
</p>

<p>
<blockquote class="gmail_quote" style="border-left:#5555EE solid 0.2em;margin: 0em;padding-left: 0.85em;font-family: monospace;unicode-bidi: isolate;display: box;">

<div>;; Also update the cursor on the repeat timer events:<br />
(add-function :after repeat-echo-function #'my-change-cursor)<br />
#+end<sub>src</sub><br />

</div></blockquote>
</p>

<p>
Sure, I've updated the patch for handle this.<br />
</p>

--==-=-=--

--=-=-=
Content-Type: text/x-patch; charset=utf-8
Content-Disposition: attachment;
 filename=0001-New-minor-mode-cursor-indicators-mode.patch
Content-Transfer-Encoding: quoted-printable

From 82a59dce91c15a742ed6031b6961e316c8da627b Mon Sep 17 00:00:00 2001
From: =3D?UTF-8?q?El=3DC3=3DADas=3D20Gabriel=3D20P=3DC3=3DA9rez?=3D <eg6426=
16@HIDDEN>
Date: Sat, 22 Mar 2025 22:56:01 -0600
Subject: [PATCH] New minor mode 'cursor-indicators-mode'

This minor mode changes the cursor appearance to indicate
buffers states, such as if overwrite-mode is active or current
buffer is read-only. (Bug#77224)
Acts similar to 'cua-enable-cursor-indications'
* etc/NEWS: Document changes.
* lisp/cursor-indicators.el
(cursor-indicators-overwrite-indicator)
(cursor-indicators-repeat-indicator)
(cursor-indicators-input-method-indicator)
(cursor-indicators-read-only-indicator): New user options.
(cursor-indicators--default-cursor-color): New use internal variable.
(cursor-indicators--update-indications): New use internal function.
(cursor-indicators-mode): New minor mode definition.
---
 etc/NEWS                  |   9 ++
 lisp/cursor-indicators.el | 185 ++++++++++++++++++++++++++++++++++++++
 2 files changed, 194 insertions(+)
 create mode 100644 lisp/cursor-indicators.el

diff --git a/etc/NEWS b/etc/NEWS
index cc63d03eafe..a9fee82a29e 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -1566,6 +1566,15 @@ This user option replaces 'follow-mode-prefix', whic=
h had to be set
 before loading Follow mode.  This new option allows you to change the
 prefix even after it was loaded, using 'customize-option' or 'setopt'.
=20
+---
+*** New minor mode 'cursor-indicators-mode'
+This mode changes cursor appearance (color and/or type) to indicate
+different buffer states.  This mode have cursor indicators for:
+- Overwrite mode
+- Read-only buffers
+- Repeat mode
+- Input method activation
+
 ---
 *** cdl.el is now obsolete.
 Use 'shell-command' and 'shell-command-on-region' instead.
diff --git a/lisp/cursor-indicators.el b/lisp/cursor-indicators.el
new file mode 100644
index 00000000000..6b9ae9677d7
--- /dev/null
+++ b/lisp/cursor-indicators.el
@@ -0,0 +1,185 @@
+;;; cursor-indicators.el --- Cursor indicators for some states  -*- lexica=
l-binding: t; -*-
+
+;; Copyright (C) 2025 Free Software Foundation, Inc.
+
+;; Author: El=C3=ADas Gabriel P=C3=A9rez <eg642616@HIDDEN>
+;; Keywords:
+
+;; This program is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; This program is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with this program.  If not, see <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+;; This package changes cursor appearance (color and/or type) to indicate
+;; different buffer states.
+;;
+;; For example:
+;;
+;; The following setting will use a YELLOW cursor in overwrite mode in rea=
d-write
+;; buffers, and a GREEN cursor in read-only buffers:
+;;
+;;  (setq cursor-indicators-overwrite-indicator "yellow")
+;;  (setq cursor-indicators-read-only-indicator "green")
+
+
+;;; Code:
+
+;;; User options
+(defcustom cursor-indicators-overwrite-indicator "red3"
+  "Cursor indicator used when overwrite mode is set, if non-nil.
+Only used when `cursor-indicators-mode' is enabled.
+
+If the value is a COLOR name, then only the `cursor-color' attribute will =
be
+affected.  If the value is a cursor TYPE (one of: box, hollow, bar, or hba=
r),
+then only the `cursor-type' property will be affected.  If the value is
+a cons (TYPE . COLOR), then both properties are affected.
+If the value is nil then do not change cursor."
+  :group 'cursor
+  :type '(choice
+          (const :tag "None (do not change cursor)" nil)
+	  (color :tag "Color")
+	  (choice :tag "Type"
+		  (const :tag "Filled box" box)
+		  (const :tag "Vertical bar" bar)
+		  (const :tag "Horizontal bar" hbar)
+		  (const :tag "Hollow box" hollow))
+	  (cons :tag "Color and Type"
+		(choice :tag "Type"
+			(const :tag "Filled box" box)
+			(const :tag "Vertical bar" bar)
+			(const :tag "Horizontal bar" hbar)
+			(const :tag "Hollow box" hollow))
+		(color :tag "Color"))))
+
+(defcustom cursor-indicators-read-only-indicator "darkgreen"
+  "Cursor indicator used in read-only buffers, if non-nil.
+Only used when `cursor-indicators-mode' is enabled.
+
+If the value is a COLOR name, then only the `cursor-color' attribute will =
be
+affected.  If the value is a cursor TYPE (one of: box, hollow, bar, or hba=
r),
+then only the `cursor-type' property will be affected.  If the value is
+a cons (TYPE . COLOR), then both properties are affected.
+If the value is nil then do not change cursor."
+  :group 'cursor
+  :type '(choice
+          (const :tag "None (do not change cursor)" nil)
+	  (color :tag "Color")
+	  (choice :tag "Type"
+		  (const :tag "Filled box" box)
+		  (const :tag "Vertical bar" bar)
+		  (const :tag "Horizontal bar" hbar)
+		  (const :tag "Hollow box" hollow))
+	  (cons :tag "Color and Type"
+		(choice :tag "Type"
+			(const :tag "Filled box" box)
+			(const :tag "Vertical bar" bar)
+			(const :tag "Horizontal bar" hbar)
+			(const :tag "Hollow box" hollow))
+		(color :tag "Color"))))
+
+(defcustom cursor-indicators-repeat-indicator "blue"
+  "Cursor indicator used when `repeat-in-progress' is non-nil.
+Only used when `cursor-indicators-mode' is enabled.
+
+If the value is a COLOR name, then only the `cursor-color' attribute will =
be
+affected.  If the value is a cursor TYPE (one of: box, hollow, bar, or hba=
r),
+then only the `cursor-type' property will be affected.  If the value is
+a cons (TYPE . COLOR), then both properties are affected.
+If the value is nil then do not change cursor."
+  :group 'cursor
+  :type '(choice
+          (const :tag "None (do not change cursor)" nil)
+	  (color :tag "Color")
+	  (choice :tag "Type"
+		  (const :tag "Filled box" box)
+		  (const :tag "Vertical bar" bar)
+		  (const :tag "Horizontal bar" hbar)
+		  (const :tag "Hollow box" hollow))
+	  (cons :tag "Color and Type"
+		(choice :tag "Type"
+			(const :tag "Filled box" box)
+			(const :tag "Vertical bar" bar)
+			(const :tag "Horizontal bar" hbar)
+			(const :tag "Hollow box" hollow))
+		(color :tag "Color"))))
+
+(defcustom cursor-indicators-input-method-indicator "dark magenta"
+  "Cursor indicator used when input method is activated now.
+Only used when `cursor-indicators-mode' is enabled.
+
+If the value is a COLOR name, then only the `cursor-color' attribute will =
be
+affected.  If the value is a cursor TYPE (one of: box, hollow, bar, or hba=
r),
+then only the `cursor-type' property will be affected.  If the value is
+a cons (TYPE . COLOR), then both properties are affected.
+If the value is nil then do not change cursor."
+  :group 'cursor
+  :type '(choice
+          (const :tag "None (do not change cursor)" nil)
+	  (color :tag "Color")
+	  (choice :tag "Type"
+		  (const :tag "Filled box" box)
+		  (const :tag "Vertical bar" bar)
+		  (const :tag "Horizontal bar" hbar)
+		  (const :tag "Hollow box" hollow))
+	  (cons :tag "Color and Type"
+		(choice :tag "Type"
+			(const :tag "Filled box" box)
+			(const :tag "Vertical bar" bar)
+			(const :tag "Horizontal bar" hbar)
+			(const :tag "Hollow box" hollow))
+		(color :tag "Color"))))
+
+;;; Internal Code
+
+(defvar cursor-indicators--default-cursor-color (frame-parameter nil 'curs=
or-color))
+
+(defun cursor-indicators--update-indications (&optional cursor-color)
+  (let* ((cursor
+          (or
+           ;; CURSOR-COLOR is intended to be used by the user in an advice=
-add
+           cursor-color
+           ;; XXX: global mark?
+           ;; (and cua--global-mark-active cursor-indicators-global-mark-c=
olor)
+           (and buffer-read-only cursor-indicators-read-only-indicator)
+           (and overwrite-mode cursor-indicators-overwrite-indicator)
+           (and (bound-and-true-p repeat-in-progress) cursor-indicators-re=
peat-indicator)
+           (and (bound-and-true-p current-input-method) cursor-indicators-=
input-method-indicator)
+           (cons (default-value 'cursor-type)
+                 cursor-indicators--default-cursor-color)))
+         (color (if (consp cursor) (cdr cursor) cursor))
+         (type (if (consp cursor) (car cursor) cursor)))
+    (if (and color
+             (stringp color)
+             (not (equal color (frame-parameter nil 'cursor-color))))
+        (set-cursor-color color))
+    (if (and type
+             (symbolp type)
+             (not (eq type (default-value 'cursor-type))))
+        (setq-local cursor-type type))))
+
+;;;###autoload
+(define-minor-mode cursor-indicators-mode
+  "Change cursor type and/or face for indications.
+When enabled, this mode changes the cursor appearance to indicate
+overwrite mode or read-only buffers."
+  :group 'cursor
+  :global t
+  (if cursor-indicators-mode
+      (progn
+	(add-hook 'post-command-hook #'cursor-indicators--update-indications)
+        (cursor-indicators--update-indications))
+    (remove-hook 'post-command-hook #'cursor-indicators--update-indication=
s)
+    (set-cursor-color cursor-indicators--default-cursor-color)
+    (setq-local cursor-type (default-value 'cursor-type))))
+
+(provide 'cursor-indicators)
+;;; cursor-indicators.el ends here
--=20
2.49.0


--=-=-=
Content-Type: text/plain


-- 
                                          - E.G via GNU Emacs and Org.

--=-=-=--




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

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


Received: (at 77224) by debbugs.gnu.org; 24 Mar 2025 07:37:33 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Mar 24 03:37:33 2025
Received: from localhost ([127.0.0.1]:54018 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1twcNI-0005wn-UV
	for submit <at> debbugs.gnu.org; Mon, 24 Mar 2025 03:37:33 -0400
Received: from relay1-d.mail.gandi.net ([217.70.183.193]:56381)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <juri@HIDDEN>) id 1twcNG-0005wR-RU
 for 77224 <at> debbugs.gnu.org; Mon, 24 Mar 2025 03:37:31 -0400
Received: by mail.gandi.net (Postfix) with ESMTPSA id BAA7444383;
 Mon, 24 Mar 2025 07:37:22 +0000 (UTC)
From: Juri Linkov <juri@HIDDEN>
To: Elijah Gabe =?iso-8859-1?Q?P=E9rez?= <eg642616@HIDDEN>
Subject: Re: bug#77224: [PATCH] New minor mode 'cursor-indicators-mode'
In-Reply-To: <87iknzxski.fsf@HIDDEN>
Organization: LINKOV.NET
References: <87iknzxski.fsf@HIDDEN>
Date: Mon, 24 Mar 2025 09:35:38 +0200
Message-ID: <87o6xq6fud.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/31.0.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain
X-GND-State: clean
X-GND-Score: -100
X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdduheeludelucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuifetpfffkfdpucggtfgfnhhsuhgsshgtrhhisggvnecuuegrihhlohhuthemuceftddunecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvfevufgjohhffffkfgggtgesthdtredttdertdenucfhrhhomheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqeenucggtffrrghtthgvrhhnpeffgeetfeevlefhleejfeeuheeiudeitdffhfdutdekfeffgffhveehteegueekheenucfkphepledurdduvdelrddutdehrdduudejnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepledurdduvdelrddutdehrdduudejpdhhvghlohepmhgrihhlrdhgrghnughirdhnvghtpdhmrghilhhfrhhomhepjhhurhhisehlihhnkhhovhdrnhgvthdpnhgspghrtghpthhtohepvddprhgtphhtthhopeejjedvvdegseguvggssghughhsrdhgnhhurdhorhhgpdhrtghpthhtohepvghgieegvdeiudeisehgmhgrihhlrdgtohhm
X-GND-Sasl: juri@HIDDEN
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 77224
Cc: 77224 <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.7 (-)

> FWIW, I have this in my init file since forever:
>
> (setq my/set-cursor-color-color "")
> (setq my/set-cursor-color-buffer "")
> (defun my/set-cursor-color-according-to-mode ()
> "Change cursor color according to some minor modes."
> ;; set-cursor-color is somewhat costly, so we only call it when needed:
> (let ((color
> (if buffer-read-only "#8888FF"
> (if overwrite-mode "#000000"
> "#FF0000"))))
> (unless (and
> (string= color my/set-cursor-color-color)
> (string= (buffer-name) my/set-cursor-color-buffer))
> (set-cursor-color (setq my/set-cursor-color-color color))
> (setq my/set-cursor-color-buffer (buffer-name)))))
> (add-hook 'post-command-hook 'my/set-cursor-color-according-to-mode)

Cool.  Will it be possible to replace these settings in my init file
with the new package?

#+begin_src emacs-lisp
(defun my-change-cursor (&rest _)
  "Change cursor color and type depending on insertion mode and input method."
  (set-cursor-color
   (cond (repeat-in-progress   "blue")
         (current-input-method "red3")
         (t                    "black")))
  (setq-default cursor-type
   (cond (overwrite-mode       'box)
         (t                    'bar))))
(add-hook 'post-command-hook 'my-change-cursor t)

;; Also update the cursor on the repeat timer events:
(add-function :after repeat-echo-function #'my-change-cursor)
#+end_src




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

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


Received: (at submit) by debbugs.gnu.org; 23 Mar 2025 22:58:53 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Mar 23 18:58:53 2025
Received: from localhost ([127.0.0.1]:53037 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1twUHM-0002Qs-SD
	for submit <at> debbugs.gnu.org; Sun, 23 Mar 2025 18:58:53 -0400
Received: from lists.gnu.org ([2001:470:142::17]:49108)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <eg642616@HIDDEN>)
 id 1twUHK-0002Qb-2m
 for submit <at> debbugs.gnu.org; Sun, 23 Mar 2025 18:58:50 -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 <eg642616@HIDDEN>)
 id 1twUHE-00009P-PX
 for bug-gnu-emacs@HIDDEN; Sun, 23 Mar 2025 18:58:44 -0400
Received: from mail-ot1-x342.google.com ([2607:f8b0:4864:20::342])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <eg642616@HIDDEN>)
 id 1twUHC-00080v-AC
 for bug-gnu-emacs@HIDDEN; Sun, 23 Mar 2025 18:58:44 -0400
Received: by mail-ot1-x342.google.com with SMTP id
 46e09a7af769-72b0626c785so2674333a34.2
 for <bug-gnu-emacs@HIDDEN>; Sun, 23 Mar 2025 15:58:41 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1742770720; x=1743375520; darn=gnu.org;
 h=mime-version:user-agent:message-id:date:subject:to:from:from:to:cc
 :subject:date:message-id:reply-to;
 bh=UErBeR5jcvm5P7UwjJ0ebo9FJsW77QEpPP0SNuBTK8Q=;
 b=kEqAs6a8LIv66yvSY4ipxvtkd71SAtD35ckf3q8TllnF8roBfu4xaO8OHpFT/OViaO
 ELi/ivgpf7mVOWf43mHOuaWRR/p/t5Unz/gJQUaps/XvOtxjK9Ng9e9ELSIS/qVOQQN/
 tx6K6JHZRMwcoNNnYTL0FlKwBEoKFcou0ZJs2QpcA9h7xticoTatAuqWGvmcN/EBAcqx
 OOAN0pZ+qYPjuEWaKiUJCXsUmjn7eUbMOXYd1XzW+g8iP7LiAWWd4qnRYa940l+NKJyf
 czL0fBw8ne7pwnIFRbfsfLStZhgV9lg7GPyMl5ktcvns0jPXS3gOWaBuQ9pfDQ8/tDvi
 lQ4Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1742770720; x=1743375520;
 h=mime-version:user-agent:message-id:date:subject:to:from
 :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
 bh=UErBeR5jcvm5P7UwjJ0ebo9FJsW77QEpPP0SNuBTK8Q=;
 b=VGY/+mTNPK79w3T3qO5kywnku5ZxEOe+9hFyMegkN6Q+eEny74m2rGnpSOpatjnS51
 K1RvHyVrtZHDkJjWQU1DLuStmKBJcFJfTN0QtPAT6XfhxKIbfst6nefLbcTAioA8IP8v
 UoKHUUEcjG2GYs0JKK0CSOxyXSmVddsn8SN4PH1/N5SpWSRDq/qCdlMs64YBAjh+35Fc
 cip9g43U84K+b2Bx9mBJnTN29swGcXeGkQ8U9MJ9E/4YVmroHAi1JZnUXG/t0TVwfY73
 VhmYWZPiED9kqpGtwA9o8uiNu/d+bAbW/f48Pg/ihM3WkX3e0xL2v9DPwIR3oxvIWHML
 T3LQ==
X-Gm-Message-State: AOJu0YwKjxyJz9zutsuWUnJwNnELJfkYLtzf/LfqOaVWtb8YBEc4+ty/
 a1xoKP0xP7g3ERjobM7MbMJ/a7SZ+xXDkXRjLmBZk7CwOx7GOfl+svkTw6Ri
X-Gm-Gg: ASbGncsF+4FJT80gbb985rSAwbfe5tdlm83oWvDiQAeIj03R42fEbHw0V+oxdeFfW2f
 QswB5iZEy6JVzlq+20QBOGpZecJHfXBkRm+mI7RjbUDWES62uaAe0dHc7A0IRx0ejIkOPHVDToQ
 MuYJXx8RrDW037z7bgqEOlEA21aIPwGbXB56K0SuOhAOohgM+LjwFyWHcOOOWt/RiThVeNZ4ccQ
 81BxZkQVMVRegJ+Gk47IM5OX3TOS6G/BPYTb0cJNNFXPVTiXxoPXpnuLJYzcl/AZwo3j6LdowMp
 h0aO7S2Xh+4D
X-Google-Smtp-Source: AGHT+IE4cNNKYNJo773ippanNwOlTYE+lJ0bqmWMMdwzZnC/jXp9lmafPYVqQU6V5sT3MpyPgD2/cg==
X-Received: by 2002:a05:6830:640a:b0:72b:8aec:fbd5 with SMTP id
 46e09a7af769-72c0ae4f1b4mr6823202a34.1.1742770719993; 
 Sun, 23 Mar 2025 15:58:39 -0700 (PDT)
Received: from fedora ([2806:10ae:e:5fce::1]) by smtp.gmail.com with ESMTPSA id
 46e09a7af769-72c0ac887e6sm1348120a34.67.2025.03.23.15.58.39
 for <bug-gnu-emacs@HIDDEN>
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Sun, 23 Mar 2025 15:58:39 -0700 (PDT)
From: =?utf-8?Q?Elijah_Gabe_P=C3=A9rez?= <eg642616@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: [PATCH] New minor mode 'cursor-indicators-mode'
Date: Sun, 23 Mar 2025 16:58:37 -0600
Message-ID: <87iknzxski.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/31.0.50
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
Received-SPF: pass client-ip=2607:f8b0:4864:20::342;
 envelope-from=eg642616@HIDDEN; helo=mail-ot1-x342.google.com
X-Spam_score_int: -17
X-Spam_score: -1.8
X-Spam_bar: -
X-Spam_report: (-1.8 / 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_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001,
 RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: 1.2 (+)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 
 Content preview:  Based on Stefan Kangas comments, this minor mode mode changes
    the cursor appearance to indicate overwrite mode or read-only buffers. This
    is extracted from `cua-enable-cursor-indications'. Start of forwarded message
    From: Stefan Kangas Subject: Re: Should 'cua-overwrite-cursor-color' be standalone?
    To: Elijah Gabe Pérez , Sat, 22 Mar 2025 [...] 
 
 Content analysis details:   (1.2 points, 10.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -0.0 RCVD_IN_DNSWL_NONE     RBL: Sender listed at https://www.dnswl.org/,
                              no trust
                             [2001:470:142:0:0:0:0:17 listed in]
                             [list.dnswl.org]
  0.0 FREEMAIL_FROM          Sender email is commonly abused enduser mail
                             provider (eg642616[at]gmail.com)
  0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends
                             in digit (eg642616[at]gmail.com)
 -0.0 SPF_HELO_PASS          SPF: HELO matches SPF record
  1.0 SPF_SOFTFAIL           SPF: sender does not match SPF record (softfail)
  0.0 HTML_MESSAGE           BODY: HTML included in message
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.2 (/)

--=-=-=
Content-Type: multipart/alternative; boundary="==-=-="

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

Based on Stefan Kangas comments, this minor mode mode changes the cursor
appearance to indicate overwrite mode or read-only buffers.

This is extracted from `cua-enable-cursor-indications'.

-------------------- Start of forwarded message --------------------
From: Stefan Kangas <stefankangas@HIDDEN>
Subject: Re: Should 'cua-overwrite-cursor-color' be standalone?
To: Elijah Gabe P=C3=A9rez <eg642616@HIDDEN>,  emacs-devel@HIDDEN
Date: Sat, 22 Mar 2025 02:01:11 -0500 (1 day, 15 hours, 49 minutes ago)

Elijah Gabe P=C3=A9rez <eg642616@HIDDEN> writes:

> I've noticed about this variable today, but
> Should not this option be part of =3Doverwrite=3D instead =3Dcua=3D?
> Or be a standalone minor-mode?
>
> IMO, I find this useful outside =3Dcua=3D.

I think a standalone mode is probably best, because if you want the
cursor color changed for overwrite-mode, you might want it for
buffer-read-only too.

In other words, I'd do both of these:

    cua-overwrite-cursor-color
    cua-read-only-cursor-color

FWIW, I have this in my init file since forever:

    (setq my/set-cursor-color-color "")
    (setq my/set-cursor-color-buffer "")
    (defun my/set-cursor-color-according-to-mode ()
      "Change cursor color according to some minor modes."
      ;; set-cursor-color is somewhat costly, so we only call it when neede=
d:
      (let ((color
             (if buffer-read-only "#8888FF"
               (if overwrite-mode "#000000"
                 "#FF0000"))))
        (unless (and
                 (string=3D color my/set-cursor-color-color)
                 (string=3D (buffer-name) my/set-cursor-color-buffer))
          (set-cursor-color (setq my/set-cursor-color-color color))
          (setq my/set-cursor-color-buffer (buffer-name)))))
    (add-hook 'post-command-hook 'my/set-cursor-color-according-to-mode)

I picked it up on EmacsWiki years ago.


-------------------- End of forwarded message --------------------




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

<p>
Based on Stefan Kangas comments, this minor mode mode changes the cursor<br=
 />
appearance to indicate overwrite mode or read-only buffers.<br />
</p>

<p>
This is extracted from `cua-enable-cursor-indications'.<br />
</p>

<p>
---------------&#x2013;&#x2014; Start of forwarded message ---------------&=
#x2013;&#x2014;<br />
From: Stefan Kangas &lt;stefankangas@HIDDEN&gt;<br />
Subject: Re: Should 'cua-overwrite-cursor-color' be standalone?<br />
To: Elijah Gabe P=C3=A9rez &lt;eg642616@HIDDEN&gt;,  emacs-devel@HIDDEN=
<br />
Date: Sat, 22 Mar 2025 02:01:11 -0500 (1 day, 15 hours, 49 minutes ago)<br =
/>
</p>

<p>
Elijah Gabe P=C3=A9rez &lt;eg642616@HIDDEN&gt; writes:<br />
</p>

<p>
<blockquote class=3D"gmail_quote" style=3D"border-left:#5555EE solid 0.2em;=
margin: 0em;padding-left: 0.85em;font-family: monospace;unicode-bidi: isola=
te;display: box;">

<div>I've noticed about this variable today, but<br />
Should not this option be part of <code>overwrite</code> instead <code>cua<=
/code>?<br />
Or be a standalone minor-mode?<br />
<br />
IMO, I find this useful outside <code>cua</code>.<br />

</div></blockquote>
</p>

<p>
I think a standalone mode is probably best, because if you want the<br />
cursor color changed for overwrite-mode, you might want it for<br />
buffer-read-only too.<br />
</p>

<p>
In other words, I'd do both of these:<br />
</p>

<p>
cua-overwrite-cursor-color<br />
cua-read-only-cursor-color<br />
</p>

<p>
FWIW, I have this in my init file since forever:<br />
</p>

<p>
(setq my/set-cursor-color-color "")<br />
(setq my/set-cursor-color-buffer "")<br />
(defun my/set-cursor-color-according-to-mode ()<br />
  "Change cursor color according to some minor modes."<br />
  ;; set-cursor-color is somewhat costly, so we only call it when needed:<b=
r />
  (let ((color<br />
         (if buffer-read-only "#8888FF"<br />
           (if overwrite-mode "#000000"<br />
             "#FF0000"))))<br />
    (unless (and<br />
             (string=3D color my/set-cursor-color-color)<br />
             (string=3D (buffer-name) my/set-cursor-color-buffer))<br />
      (set-cursor-color (setq my/set-cursor-color-color color))<br />
      (setq my/set-cursor-color-buffer (buffer-name)))))<br />
(add-hook 'post-command-hook 'my/set-cursor-color-according-to-mode)<br />
</p>

<p>
I picked it up on EmacsWiki years ago.<br />
</p>


<p>
---------------&#x2013;&#x2014; End of forwarded message ---------------&#x=
2013;&#x2014;<br />
</p>

--==-=-=--

--=-=-=
Content-Type: text/patch; charset=utf-8
Content-Disposition: attachment;
 filename=0001-New-minor-mode-cursor-indicators-mode.patch
Content-Transfer-Encoding: quoted-printable

From 15b9074636a31676b83ac7e2086959e23b93cd11 Mon Sep 17 00:00:00 2001
From: =3D?UTF-8?q?El=3DC3=3DADas=3D20Gabriel=3D20P=3DC3=3DA9rez?=3D <eg6426=
16@HIDDEN>
Date: Sat, 22 Mar 2025 22:56:01 -0600
Subject: [PATCH] New minor mode 'cursor-indicators-mode'

This minor mode changes the cursor appearance to indicate
overwrite mode or read-only buffers. (bug#)
Acts similar to 'cua-enable-cursor-indications'
* etc/NEWS: Document changes.
* lisp/cursor-indicators.el
(cursor-indicators-overwrite-indicator)
(cursor-indicators-read-only-indicator): New user options.
(cursor-indicators--default-cursor-color): New use internal variable.
(cursor-indicators--update-indications): New use internal function.
(cursor-indicators-mode): New minor mode definition.
---
 etc/NEWS                  |   5 ++
 lisp/cursor-indicators.el | 125 ++++++++++++++++++++++++++++++++++++++
 2 files changed, 130 insertions(+)
 create mode 100644 lisp/cursor-indicators.el

diff --git a/etc/NEWS b/etc/NEWS
index cc63d03eafe..22c84d253ba 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -1566,6 +1566,11 @@ This user option replaces 'follow-mode-prefix', whic=
h had to be set
 before loading Follow mode.  This new option allows you to change the
 prefix even after it was loaded, using 'customize-option' or 'setopt'.
=20
+---
+*** New minor mode 'cursor-indicators-mode'
+This minor mode changes cursor type and/or face to indicate
+overwrite mode or read-only buffers.
+
 ---
 *** cdl.el is now obsolete.
 Use 'shell-command' and 'shell-command-on-region' instead.
diff --git a/lisp/cursor-indicators.el b/lisp/cursor-indicators.el
new file mode 100644
index 00000000000..d97237c6942
--- /dev/null
+++ b/lisp/cursor-indicators.el
@@ -0,0 +1,125 @@
+;;; cursor-indicators.el --- Cursor indicators for some states  -*- lexica=
l-binding: t; -*-
+
+;; Copyright (C) 2025 Free Software Foundation, Inc.
+
+;; Author: El=C3=ADas Gabriel P=C3=A9rez <eg642616@HIDDEN>
+;; Keywords:
+
+;; This program is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; This program is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with this program.  If not, see <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+;; This package changes cursor appearance (color and/or type) to indicate
+;; overwrite mode and read-only buffers.
+;;
+;; For example:
+;;
+;; The following setting will use a YELLOW cursor in overwrite mode in rea=
d-write
+;; buffers, and a GREEN cursor in read-only buffers:
+;;
+;;  (setq cursor-indicators-overwrite-indicator "yellow")
+;;  (setq cursor-indicators-read-only-indicator "green")
+
+
+;;; Code:
+(defcustom cursor-indicators-overwrite-indicator "yellow"
+  "Cursor indicator used when overwrite mode is set, if non-nil.
+Only used when `cursor-indicators-mode' is enabled.
+
+If the value is a COLOR name, then only the `cursor-color' attribute will =
be
+affected.  If the value is a cursor TYPE (one of: box, hollow, bar, or hba=
r),
+then only the `cursor-type' property will be affected.  If the value is
+a cons (TYPE . COLOR), then both properties are affected.
+If the value is nil then do not change cursor."
+  :group 'cursor
+  :type '(choice
+          (const :tag "None (do not change cursor)" nil)
+	  (color :tag "Color")
+	  (choice :tag "Type"
+		  (const :tag "Filled box" box)
+		  (const :tag "Vertical bar" bar)
+		  (const :tag "Horizontal bar" hbar)
+		  (const :tag "Hollow box" hollow))
+	  (cons :tag "Color and Type"
+		(choice :tag "Type"
+			(const :tag "Filled box" box)
+			(const :tag "Vertical bar" bar)
+			(const :tag "Horizontal bar" hbar)
+			(const :tag "Hollow box" hollow))
+		(color :tag "Color"))))
+
+(defcustom cursor-indicators-read-only-indicator "darkgreen"
+  "Cursor indicator used in read-only buffers, if non-nil.
+Only used when `cursor-indicators-mode' is enabled.
+
+If the value is a COLOR name, then only the `cursor-color' attribute will =
be
+affected.  If the value is a cursor TYPE (one of: box, hollow, bar, or hba=
r),
+then only the `cursor-type' property will be affected.  If the value is
+a cons (TYPE . COLOR), then both properties are affected.
+If the value is nil then do not change cursor."
+  :group 'cursor
+  :type '(choice
+          (const :tag "None (do not change cursor)" nil)
+	  (color :tag "Color")
+	  (choice :tag "Type"
+		  (const :tag "Filled box" box)
+		  (const :tag "Vertical bar" bar)
+		  (const :tag "Horizontal bar" hbar)
+		  (const :tag "Hollow box" hollow))
+	  (cons :tag "Color and Type"
+		(choice :tag "Type"
+			(const :tag "Filled box" box)
+			(const :tag "Vertical bar" bar)
+			(const :tag "Horizontal bar" hbar)
+			(const :tag "Hollow box" hollow))
+		(color :tag "Color"))))
+
+(defvar cursor-indicators--default-cursor-color (frame-parameter nil 'curs=
or-color))
+
+(defun cursor-indicators--update-indications ()
+  (let* ((cursor
+	  (or
+           ;; XXX: global mark?
+	   ;; (and cua--global-mark-active cursor-indicators-global-mark-color)
+	   (and buffer-read-only cursor-indicators-read-only-indicator)
+	   (and overwrite-mode cursor-indicators-overwrite-indicator)
+	   (cons (default-value 'cursor-type)
+                 cursor-indicators--default-cursor-color)))
+	 (color (if (consp cursor) (cdr cursor) cursor))
+	 (type (if (consp cursor) (car cursor) cursor)))
+    (if (and color
+	     (stringp color)
+	     (not (equal color (frame-parameter nil 'cursor-color))))
+	(set-cursor-color color))
+    (if (and type
+	     (symbolp type)
+             (not (eq type (default-value 'cursor-type))))
+	(setq-local cursor-type type))))
+
+;;;###autoload
+(define-minor-mode cursor-indicators-mode
+  "Change cursor type and/or face for indications.
+When enabled, this mode changes the cursor appearance to indicate
+overwrite mode or read-only buffers."
+  :group 'cursor
+  :global t
+  (if cursor-indicators-mode
+      (progn
+	(add-hook 'post-command-hook #'cursor-indicators--update-indications)
+        (cursor-indicators--update-indications))
+    (remove-hook 'post-command-hook #'cursor-indicators--update-indication=
s)
+    (set-cursor-color cursor-indicators--default-cursor-color)
+    (setq-local cursor-type (default-value 'cursor-type))))
+
+(provide 'cursor-indicators)
+;;; cursor-indicators.el ends here
--=20
2.49.0


--=-=-=
Content-Type: text/plain


-- 
                                          - E.G via GNU Emacs and Org.

--=-=-=--




Acknowledgement sent to Elijah Gabe Pérez <eg642616@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#77224; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Sat, 29 Mar 2025 12:30:02 UTC

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