GNU bug report logs - #70622
[PATCH] New window parameter 'cursor-type'

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: Eshel Yaron <me@HIDDEN>; Keywords: patch; dated Sun, 28 Apr 2024 06:29:01 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

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


Received: (at 70622) by debbugs.gnu.org; 12 May 2024 08:29:37 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun May 12 04:29:37 2024
Received: from localhost ([127.0.0.1]:53186 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1s64aO-00051I-N7
	for submit <at> debbugs.gnu.org; Sun, 12 May 2024 04:29:36 -0400
Received: from mout.gmx.net ([212.227.15.19]:42065)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <rudalics@HIDDEN>) id 1s64aM-00051A-3d
 for 70622 <at> debbugs.gnu.org; Sun, 12 May 2024 04:29:35 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.at;
 s=s31663417; t=1715502565; x=1716107365; i=rudalics@HIDDEN;
 bh=iIzj1B9GN6qutMCp7J2DDvuAVIuyQIEv7ZUt4UW6s+0=;
 h=X-UI-Sender-Class:Message-ID:Date:MIME-Version:Subject:To:Cc:
 References:From:In-Reply-To:Content-Type:
 Content-Transfer-Encoding:cc:content-transfer-encoding:
 content-type:date:from:message-id:mime-version:reply-to:subject:
 to;
 b=URJu4/BsVG2Hdf4iLkJNUwc0fXFPU31iuQvFQgZ0fzYbT40OSB9m45CdVI7H27rB
 i8eANZDfvA79r1zEiPmZEEpUq4BgkTarxtkStQ+9c8i4OPv59WIvg8+DCHfpfpEux
 8BAkaScLGQgzuoEsZ2kuWJPZ124WZtLNFCz7LsLGbLB5RayKJfLq+YqKCPi/JWTaV
 peP4fj0YMIZgfumb8fm4zsPejUQo8N3LSHDRicmJCmGMJXtavRIe2DuyNJk+Xx4fc
 +KaYpEcwFSKq3qZ1SxhPaxMv6N7ZIWXmMOcOjfixX3sxt7XCokBUYaU7SAGTDJ+wM
 IFkdc+COJAAEWcWAqQ==
X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a
Received: from [192.168.31.113] ([213.142.97.183]) by mail.gmx.net (mrgmx004
 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MgvvT-1snLpI24ZZ-00e5ZY; Sun, 12
 May 2024 10:29:25 +0200
Message-ID: <7a5087d8-b27a-42b4-9e1d-908f8a13731f@HIDDEN>
Date: Sun, 12 May 2024 10:29:24 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: bug#70622: [PATCH] New window parameter 'cursor-type'
To: Eli Zaretskii <eliz@HIDDEN>
References: <m1il02ypau.fsf@HIDDEN> <864jbmuf39.fsf@HIDDEN>
 <m1zftdr0q6.fsf@HIDDEN> <8634r5tsit.fsf@HIDDEN>
 <m1sez5paso.fsf@HIDDEN> <86y18wsmqy.fsf@HIDDEN>
 <m1jzkg60py.fsf@HIDDEN> <86cyq8sfif.fsf@HIDDEN>
 <0519d8d8-2a3d-411a-a5bb-b556e0fb86db@HIDDEN> <868r0ws9u1.fsf@HIDDEN>
 <ca3fb469-127b-462c-856d-8da266db8e76@HIDDEN> <867cgfqcbn.fsf@HIDDEN>
 <86jzk377kx.fsf@HIDDEN> <m1pltvfe2x.fsf@HIDDEN>
 <86v83n5iry.fsf@HIDDEN> <m1v83ndq4s.fsf@HIDDEN>
 <283e9319-8863-44e7-be72-995b8b36c37e@HIDDEN> <86cypt4p1m.fsf@HIDDEN>
 <8fe2af31-1509-45e7-9f0d-8f1e5b952353@HIDDEN> <86o79c3fx5.fsf@HIDDEN>
Content-Language: en-US
From: martin rudalics <rudalics@HIDDEN>
In-Reply-To: <86o79c3fx5.fsf@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Provags-ID: V03:K1:zY/5rc/jO+IFRzXeX87o9qBVgmHYEasPBZkmrDvHiKUNUVL34lK
 c/oJqsLZoJhj5cUEwZdRWrnGxc4EsfpHzNDfpnbB2ybwK8/pM/uRoUWRJMToNRiMtv84iJE
 vlULzk6tWiQxoFzvJEww8AtizOzxZUTQCeIhg/bdSdEhE+u3iAtwMJC0rPFL0HqP/OBHcGz
 mkBrz46GKX3zjHcS5JQGg==
X-Spam-Flag: NO
UI-OutboundReport: notjunk:1;M01:P0:8yABeabeKpA=;PhjmHOtwQ06pMsdMUFBC94j2Uji
 nBQxfRNrF17kB5zJFfO8m0JzJ8MzEI7ibULOjrNCGQIPgEbyTuDEnpKwqIO9f/g5ZNcrTS4oF
 jfCM56khlTdvMiZKQS+DeTHgSskYGSszMJGLcOPuA/zRqb6LvTTpwVIReltppktAisheLXxyF
 exemoFo+byVedPv+phk7XOJav5WC/0spUJFdjgY5qYMP0LesPA2s/fcy58TZ7kXXVeAuPVZ2s
 XLikH2Ay2qhJxNcaM8GOv7gDUIo/qOEWlY1+kyfGZTQRj7LOeHBH/o3bHDpxiZtDmyx6t/9T+
 o/3WOrHW2yrxscOU+F+eALaBaopr2yCjvqp9DHOee4bNx7yV9neTsoLuVLpezj+3fYmbr0faO
 GucRFl/gTPlsFaREztFyBfsT/KTU7X1cbdw0eV+bb/R+TduGlY06ACzJ8oIxCdB8CPNWuJYci
 9n76TOtynTOjdpVPvDs3mlN/qVeIGfkEoUkrM6VtPxHlXeG2TdfFGSM505wVYpWGoU5/3K4gz
 iWX4uYVb5HXAr2dDtbirCYMCHBaN/nV/mWCtQdXwV52KzeIwsdkYupR/DmkMMI7xuW4Yrv2pX
 feGByHVd0LMBgFVQQQNNo80Cy4dPL8XJjQaI6Erl2/c5/wPIbeXBjVBzknJKXnUoSgvBFlr1x
 LYHC78xN+khd97zdxZGA9GTLPyLztwg/nE/q3Ur3IWOk1THW8R9iWJVed0+45I1Mu2M8OwDAL
 i2SArDPVp4qA4gIhUGt8T18OVg0w8/Mm1K9zMFOaBpWW+wZH5+4HN6nmjpqv+hcxSLvt6vgjL
 zT/vkiP2lk7/LnYiSyS2vXvABqO1iqpy91VNDRlvbryek=
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 70622
Cc: me@HIDDEN, 70622 <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 (-)

 > The ANYTHING ELSE clause is simply defensive programming, something we
 > do in many other places.  It can easily hide mistakes, and I see no
 > reason not to help users find those mistakes.

I'm not a fan of strong typing but I agree with you.  The problem I see
is that we don't care about catching mistakes when setting the variable
or the corresponding frame parameter.  If we want to help users finding
mistakes, we should care everywhere in a consistent fashion.

 > But if you are still unconvinced, I won't argue, although I still
 > don't understand your and Eshel's objections.

I only stated my personal view and will leave it to Eshel and you how
serve users best.

martin




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

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


Received: (at 70622) by debbugs.gnu.org; 11 May 2024 08:34:57 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat May 11 04:34:57 2024
Received: from localhost ([127.0.0.1]:47035 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1s5iC1-0006ii-0a
	for submit <at> debbugs.gnu.org; Sat, 11 May 2024 04:34:57 -0400
Received: from eggs.gnu.org ([209.51.188.92]:45532)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1s5iBy-0006iX-SL
 for 70622 <at> debbugs.gnu.org; Sat, 11 May 2024 04:34: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 1s5iBt-0005Cm-SB; Sat, 11 May 2024 04:34:49 -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=T1yZmfA3wNoYW7GMNphXwOaSApOlHVAnL49VErS1Vj0=; b=hWxMKBbTY6K+LonKZO9X
 Plm4gTQ7AZIWM47etHAhp1zdL0jrqLP8AaSasgXL+TxoqWQER52IIvSb4zrFyj9Ro8yhFG4mS7Ezm
 GZPNUqWBhengzRNHcB5UtG7eb6jfd8d8c21jVkTS6U1NCE4CD3zM1YfDi5E5s9gVMo8mDN6ef04kS
 GxmfVvUAB+N9sC1OS503cizAC6P/EExxjMkth9y/onAftwNQM4GGtPhY89aENi7DoVCm8GXz/cv8u
 LCfgXvnP6OnmgY12d5C7qhONGlsq1zyLdUQCOkBIkLKqU6jsD6TQBScTZnQD58ocDxAMlISsEq+/C
 65tgv6+HxeDwWg==;
Date: Sat, 11 May 2024 11:34:46 +0300
Message-Id: <86o79c3fx5.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: martin rudalics <rudalics@HIDDEN>
In-Reply-To: <8fe2af31-1509-45e7-9f0d-8f1e5b952353@HIDDEN> (message from
 martin rudalics on Sat, 11 May 2024 09:35:37 +0200)
Subject: Re: bug#70622: [PATCH] New window parameter 'cursor-type'
References: <m1il02ypau.fsf@HIDDEN> <864jbmuf39.fsf@HIDDEN>
 <m1zftdr0q6.fsf@HIDDEN> <8634r5tsit.fsf@HIDDEN>
 <m1sez5paso.fsf@HIDDEN> <86y18wsmqy.fsf@HIDDEN>
 <m1jzkg60py.fsf@HIDDEN> <86cyq8sfif.fsf@HIDDEN>
 <0519d8d8-2a3d-411a-a5bb-b556e0fb86db@HIDDEN> <868r0ws9u1.fsf@HIDDEN>
 <ca3fb469-127b-462c-856d-8da266db8e76@HIDDEN> <867cgfqcbn.fsf@HIDDEN>
 <86jzk377kx.fsf@HIDDEN> <m1pltvfe2x.fsf@HIDDEN>
 <86v83n5iry.fsf@HIDDEN> <m1v83ndq4s.fsf@HIDDEN>
 <283e9319-8863-44e7-be72-995b8b36c37e@HIDDEN> <86cypt4p1m.fsf@HIDDEN>
 <8fe2af31-1509-45e7-9f0d-8f1e5b952353@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: 70622
Cc: me@HIDDEN, 70622 <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: Sat, 11 May 2024 09:35:37 +0200
> Cc: me@HIDDEN, 70622 <at> debbugs.gnu.org
> From: martin rudalics <rudalics@HIDDEN>
> 
>  >>   >> Shouldn't we validate the value of TYPE before plugging it into the
>  >>   >> window?  I know we will validate it at display time, but maybe it's a
>  >>   >> good idea to do that here as well, and signal an error up front?
>  >>   >
>  >>   > AFAICT there are no invalid values, since we take "any other value" to
>  >>   > mean the same as 'hollow' (see C-h v cursor-type), so I think not
>  >>   > validating anything should be perfectly valid :)
>  >>   >
>  >>   >> Martin, WDYT?
>  >>
>  >> I think Eshel is right.
>  >
>  > Any reasons?
> 
> The doc-string of the variable 'cursor-type' states that
> 
>      cursor-type is a variable defined in ‘C source code’.
> 
>      Its value is t
> 
>      Cursor to use when this buffer is in the selected window.
>      Values are interpreted as follows:
> 
>        t               use the cursor specified for the frame
>        [...]
>        ANYTHING ELSE   display a hollow box cursor
> 
> Suppose the buffer value is ANYTHING ELSE, someone wants to temporarily
> change it for a specific window and later wants to reset it back to its
> buffer value via 'set-window-cursor-type'.  Should Emacs signal an error
> up front in that case?

I don't see why not.

The ANYTHING ELSE clause is simply defensive programming, something we
do in many other places.  It can easily hide mistakes, and I see no
reason not to help users find those mistakes.

But if you are still unconvinced, I won't argue, although I still
don't understand your and Eshel's objections.




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

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


Received: (at 70622) by debbugs.gnu.org; 11 May 2024 07:35:48 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat May 11 03:35:48 2024
Received: from localhost ([127.0.0.1]:46791 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1s5hGm-000693-D3
	for submit <at> debbugs.gnu.org; Sat, 11 May 2024 03:35:48 -0400
Received: from mout.gmx.net ([212.227.17.20]:55161)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <rudalics@HIDDEN>) id 1s5hGk-00068x-EF
 for 70622 <at> debbugs.gnu.org; Sat, 11 May 2024 03:35:47 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.at;
 s=s31663417; t=1715412939; x=1716017739; i=rudalics@HIDDEN;
 bh=Mn7KqIYKivyEfcJ8XZHc/SEMP4YSWBdlBiI55YNNjPs=;
 h=X-UI-Sender-Class:Message-ID:Date:MIME-Version:Subject:To:Cc:
 References:From:In-Reply-To:Content-Type:
 Content-Transfer-Encoding:cc:content-transfer-encoding:
 content-type:date:from:message-id:mime-version:reply-to:subject:
 to;
 b=NG+yFKIwUveApmqXqk3OH+AniQOmi221Y32b1cOWLoSMgJOisWyUTJRuBJKLnB6R
 q6zpIrBddxa04vbSvFibJ1r468PFaa3J6ZCpgWSuciWsxJfzQvEBqpCpQJj38wUEz
 nHb99g0q+3Gwwwea7Lz3GbiWFAw2djrCxMvGt5dQPoerbcwjNjBi+hI0sA/zvsdZ9
 LMfRgi+meVo2F0+y3jR7JjLik24+mb7P94FXVyCYv9v4t+rA+QqZ+9y4sJE/32q3D
 Sin27DnbclhXvg4pALJhCuWBR0yb3k3ndn/9J848FzD40MSf5yDINhoH7ynD/LJr1
 sMRKkGafkeD4Rjye7A==
X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a
Received: from [192.168.31.113] ([212.95.5.100]) by mail.gmx.net (mrgmx105
 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MvsEx-1sulaO11eR-00sxDt; Sat, 11
 May 2024 09:35:39 +0200
Message-ID: <8fe2af31-1509-45e7-9f0d-8f1e5b952353@HIDDEN>
Date: Sat, 11 May 2024 09:35:37 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: bug#70622: [PATCH] New window parameter 'cursor-type'
To: Eli Zaretskii <eliz@HIDDEN>
References: <m1il02ypau.fsf@HIDDEN> <864jbmuf39.fsf@HIDDEN>
 <m1zftdr0q6.fsf@HIDDEN> <8634r5tsit.fsf@HIDDEN>
 <m1sez5paso.fsf@HIDDEN> <86y18wsmqy.fsf@HIDDEN>
 <m1jzkg60py.fsf@HIDDEN> <86cyq8sfif.fsf@HIDDEN>
 <0519d8d8-2a3d-411a-a5bb-b556e0fb86db@HIDDEN> <868r0ws9u1.fsf@HIDDEN>
 <ca3fb469-127b-462c-856d-8da266db8e76@HIDDEN> <867cgfqcbn.fsf@HIDDEN>
 <86jzk377kx.fsf@HIDDEN> <m1pltvfe2x.fsf@HIDDEN>
 <86v83n5iry.fsf@HIDDEN> <m1v83ndq4s.fsf@HIDDEN>
 <283e9319-8863-44e7-be72-995b8b36c37e@HIDDEN> <86cypt4p1m.fsf@HIDDEN>
Content-Language: en-US
From: martin rudalics <rudalics@HIDDEN>
In-Reply-To: <86cypt4p1m.fsf@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: base64
X-Provags-ID: V03:K1:MyKR5rozLAU12Ng6m+7z8KfwOxtLGdLybqhD4zrPuZ0UjGjdvA/
 B0ShiXMmZxeaPlZGM0c8Hr0fpwvuNZurmI5L58/ERJrD7jxlE5v71tXOPfiBdqNuj4VoJxv
 rCqjnacWmC/8kAdU0yU/fXvUxsPPkbSpBWnu5g2RTMfKm5yTIzDffXazgCjIJA4YMITj0ui
 /kCk72J5j6UY/XifwWtWQ==
X-Spam-Flag: NO
UI-OutboundReport: notjunk:1;M01:P0:KmG50fDDUHI=;WCdSiE+U44LFcEBQ6ixV/bDVBps
 C5NklYCJDsRwvKsQnXGoncFwW8JiGUnpmnG/fCrNVd3c8toXQF90T0/ZsSCxxV755dhhd2Iv1
 76DR17sIDPj4KA+zApqsLwuvTbCePeUcdmbSrgKkRJX04d7zCBa/1wh0/6hUgQjoBSGDAS+ny
 f6EoX2KFv++Yqa8NU741EbksiHSznWCl6EP0RntMdSitYKh6eaBf6jEbLzyiR9/mcJp1uHxEO
 VRT/cmPZIbaT2ULvS/CroXdj0VjOVcuWtPywUwbGbYtC6Vv/joo6N0orFTPESWPMWKaFqwnTd
 X3Kzs1g97co0ryC7Qguvj5/B+81EZ8UMuYtR60I9pi5K4Um77Q3UKhpuMIccjkJOt/Zl8RzVw
 EBQEMTB41NZwgsI1DdZWuXQQ26KJlxhi3n9w7zm0BZYfVv9QECk7xC4oCWMaH12L00w3HxL1Q
 ydSfINtSgyJVa0i3hMquiBo6/ZBk6HjxkrgS1SvaSDBawgMJjQczznw65p+c8CpkWWIvRdnE/
 vtVeI/tgL/GNPD1IuvSuDK1CjGUhYfmWXig/L6Pgg2HrhQr1aVDHD+9d5Lywo/9lBIEvh5DBZ
 QidR0WJnKU4sRaVtFa7gvg4W0J9xY8wMpBGD3+tYdVAfxjtj9GNHRvs/f1k6rB+2KZLCxY9aI
 LWh+Sp9Ym2Nc/V1Sdy4pZqt6+SQqIXZN7V1S8BP5ErpZHTspiggxTLbF4Y+g1YbDLMGQK3q4W
 9HiS5/7f3MKkI3Hk3vpDdmvOSG6NvNAI8z7C1r5eo75lLN+h29UXBjcpb9BJqBfq0SAB+PD7j
 FbwxvEt3mAAeg1Sqs0MH1/HYF3JPPgoHKNzxST1xHiyWrCTjgMKQGmOkkSTvYLgtuC
X-Spam-Score: 2.9 (++)
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: >> >> Shouldn't we validate the value of TYPE before plugging
 it into the >> >> window? I know we will validate it at display time, but
 maybe it's a >> >> good idea to do that here as well, and signa [...] 
 Content analysis details:   (2.9 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -0.7 RCVD_IN_DNSWL_LOW      RBL: Sender listed at https://www.dnswl.org/,
 low trust [212.227.17.20 listed in list.dnswl.org]
 3.6 RCVD_IN_SBL_CSS        RBL: Received via a relay in Spamhaus SBL-CSS
 [212.95.5.100 listed in zen.spamhaus.org]
 0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 0.0 FREEMAIL_FROM          Sender email is commonly abused enduser mail
 provider (rudalics[at]gmx.at)
 -0.0 SPF_PASS               SPF: sender matches SPF record
 0.0 RCVD_IN_MSPIKE_H4      RBL: Very Good reputation (+4)
 [212.227.17.20 listed in wl.mailspike.net]
 0.0 RCVD_IN_MSPIKE_WL      Mailspike good senders
X-Debbugs-Envelope-To: 70622
Cc: me@HIDDEN, 70622 <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.9 (+)
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:  >> >> Shouldn't we validate the value of TYPE before plugging
    it into the >> >> window? I know we will validate it at display time, but
    maybe it's a >> >> good idea to do that here as well, and signa [...] 
 
 Content analysis details:   (1.9 points, 10.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
  0.0 RCVD_IN_MSPIKE_H4      RBL: Very Good reputation (+4)
                             [212.227.17.20 listed in wl.mailspike.net]
  3.6 RCVD_IN_SBL_CSS        RBL: Received via a relay in Spamhaus SBL-CSS
                             [212.95.5.100 listed in zen.spamhaus.org]
 -0.7 RCVD_IN_DNSWL_LOW      RBL: Sender listed at https://www.dnswl.org/,
                             low trust
                             [212.227.17.20 listed in list.dnswl.org]
  0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
  0.0 FREEMAIL_FROM          Sender email is commonly abused enduser mail
                             provider (rudalics[at]gmx.at)
 -0.0 SPF_PASS               SPF: sender matches SPF record
  0.0 RCVD_IN_MSPIKE_WL      Mailspike good senders
 -1.0 MAILING_LIST_MULTI     Multiple indicators imply a widely-seen list
                             manager

ID4+ICAgPj4gU2hvdWxkbid0IHdlIHZhbGlkYXRlIHRoZSB2YWx1ZSBvZiBUWVBFIGJlZm9y
ZSBwbHVnZ2luZyBpdCBpbnRvIHRoZQ0KID4+ICAgPj4gd2luZG93PyAgSSBrbm93IHdlIHdp
bGwgdmFsaWRhdGUgaXQgYXQgZGlzcGxheSB0aW1lLCBidXQgbWF5YmUgaXQncyBhDQogPj4g
ICA+PiBnb29kIGlkZWEgdG8gZG8gdGhhdCBoZXJlIGFzIHdlbGwsIGFuZCBzaWduYWwgYW4g
ZXJyb3IgdXAgZnJvbnQ/DQogPj4gICA+DQogPj4gICA+IEFGQUlDVCB0aGVyZSBhcmUgbm8g
aW52YWxpZCB2YWx1ZXMsIHNpbmNlIHdlIHRha2UgImFueSBvdGhlciB2YWx1ZSIgdG8NCiA+
PiAgID4gbWVhbiB0aGUgc2FtZSBhcyAnaG9sbG93JyAoc2VlIEMtaCB2IGN1cnNvci10eXBl
KSwgc28gSSB0aGluayBub3QNCiA+PiAgID4gdmFsaWRhdGluZyBhbnl0aGluZyBzaG91bGQg
YmUgcGVyZmVjdGx5IHZhbGlkIDopDQogPj4gICA+DQogPj4gICA+PiBNYXJ0aW4sIFdEWVQ/
DQogPj4NCiA+PiBJIHRoaW5rIEVzaGVsIGlzIHJpZ2h0Lg0KID4NCiA+IEFueSByZWFzb25z
Pw0KDQpUaGUgZG9jLXN0cmluZyBvZiB0aGUgdmFyaWFibGUgJ2N1cnNvci10eXBlJyBzdGF0
ZXMgdGhhdA0KDQogICAgIGN1cnNvci10eXBlIGlzIGEgdmFyaWFibGUgZGVmaW5lZCBpbiDi
gJhDIHNvdXJjZSBjb2Rl4oCZLg0KDQogICAgIEl0cyB2YWx1ZSBpcyB0DQoNCiAgICAgQ3Vy
c29yIHRvIHVzZSB3aGVuIHRoaXMgYnVmZmVyIGlzIGluIHRoZSBzZWxlY3RlZCB3aW5kb3cu
DQogICAgIFZhbHVlcyBhcmUgaW50ZXJwcmV0ZWQgYXMgZm9sbG93czoNCg0KICAgICAgIHQg
ICAgICAgICAgICAgICB1c2UgdGhlIGN1cnNvciBzcGVjaWZpZWQgZm9yIHRoZSBmcmFtZQ0K
ICAgICAgIFsuLi5dDQogICAgICAgQU5ZVEhJTkcgRUxTRSAgIGRpc3BsYXkgYSBob2xsb3cg
Ym94IGN1cnNvcg0KDQpTdXBwb3NlIHRoZSBidWZmZXIgdmFsdWUgaXMgQU5ZVEhJTkcgRUxT
RSwgc29tZW9uZSB3YW50cyB0byB0ZW1wb3JhcmlseQ0KY2hhbmdlIGl0IGZvciBhIHNwZWNp
ZmljIHdpbmRvdyBhbmQgbGF0ZXIgd2FudHMgdG8gcmVzZXQgaXQgYmFjayB0byBpdHMNCmJ1
ZmZlciB2YWx1ZSB2aWEgJ3NldC13aW5kb3ctY3Vyc29yLXR5cGUnLiAgU2hvdWxkIEVtYWNz
IHNpZ25hbCBhbiBlcnJvcg0KdXAgZnJvbnQgaW4gdGhhdCBjYXNlPw0KDQptYXJ0aW4NCg==





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

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


Received: (at 70622) by debbugs.gnu.org; 10 May 2024 16:20:13 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri May 10 12:20:13 2024
Received: from localhost ([127.0.0.1]:42809 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1s5Syj-00040X-BT
	for submit <at> debbugs.gnu.org; Fri, 10 May 2024 12:20:13 -0400
Received: from eggs.gnu.org ([209.51.188.92]:33890)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1s5Syh-00040M-EI
 for 70622 <at> debbugs.gnu.org; Fri, 10 May 2024 12:20:12 -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 1s5Syd-0005FK-AY; Fri, 10 May 2024 12:20:07 -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=oMkBYR0XDrZbx7hScctwETk6RfzQdHT5PTns0WryA6c=; b=kA1E2wGNxXbR
 zfYgHvC1pLs+jw0OCiF8HaFN6JcCt1HXkifzlmPYSGXVP/Uly23RQsgSDL2mJXJTU2mXZrl1UO3SY
 Di639OSV/X0vcLilNZr8uqOKB+9csIZFWRZkBHuxO4tH305dJnp/uhXRPnpmDhDsxuKbh5sAsEshA
 YBVhgnnhjoH+bejihsIm5QGUF69O+HUqvMTZqWUR5p9m1vPYAQ+/gpL1ky3YKv+8Nhm/viXKxEn5R
 uQzpcR8lqeFixV2fUU6nMJ6JNEzDRpLLiZMITk2pyTXtxcuKgV54zcKj8ph8G6u6OGpThav2SGEpa
 GjuQSsGv9CBnPUI5zU2VBw==;
Date: Fri, 10 May 2024 19:20:05 +0300
Message-Id: <86cypt4p1m.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: martin rudalics <rudalics@HIDDEN>
In-Reply-To: <283e9319-8863-44e7-be72-995b8b36c37e@HIDDEN> (message from
 martin rudalics on Fri, 10 May 2024 10:58:58 +0200)
Subject: Re: bug#70622: [PATCH] New window parameter 'cursor-type'
References: <m1il02ypau.fsf@HIDDEN> <864jbmuf39.fsf@HIDDEN>
 <m1zftdr0q6.fsf@HIDDEN> <8634r5tsit.fsf@HIDDEN>
 <m1sez5paso.fsf@HIDDEN> <86y18wsmqy.fsf@HIDDEN>
 <m1jzkg60py.fsf@HIDDEN> <86cyq8sfif.fsf@HIDDEN>
 <0519d8d8-2a3d-411a-a5bb-b556e0fb86db@HIDDEN> <868r0ws9u1.fsf@HIDDEN>
 <ca3fb469-127b-462c-856d-8da266db8e76@HIDDEN> <867cgfqcbn.fsf@HIDDEN>
 <86jzk377kx.fsf@HIDDEN> <m1pltvfe2x.fsf@HIDDEN>
 <86v83n5iry.fsf@HIDDEN> <m1v83ndq4s.fsf@HIDDEN>
 <283e9319-8863-44e7-be72-995b8b36c37e@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 70622
Cc: me@HIDDEN, 70622 <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: Fri, 10 May 2024 10:58:58 +0200
> Cc: 70622 <at> debbugs.gnu.org
> From: martin rudalics <rudalics@HIDDEN>
> 
>  >>> +DEFUN ("set-window-cursor-type", Fset_window_cursor_type,
>  >>> +       Sset_window_cursor_type, 2, 2, 0,
>  >>> +       doc: /* Set the `cursor-type' of WINDOW to TYPE.
>  >>> +
>  >>> +This setting takes precedence over the variable `cursor-type', and TYPE
>  >>> +has the same format as the value of that variable.  WINDOW nil means use
>  >>> +the selected window.  */)
>  >>> +  (Lisp_Object window, Lisp_Object type)
>  >>> +{
>  >>> +  struct window *w = decode_live_window (window);
>  >>> +
>  >>> +  wset_cursor_type (w, type);
>  >>
>  >> Shouldn't we validate the value of TYPE before plugging it into the
>  >> window?  I know we will validate it at display time, but maybe it's a
>  >> good idea to do that here as well, and signal an error up front?
>  >
>  > AFAICT there are no invalid values, since we take "any other value" to
>  > mean the same as 'hollow' (see C-h v cursor-type), so I think not
>  > validating anything should be perfectly valid :)
>  >
>  >> Martin, WDYT?
> 
> I think Eshel is right.

Any reasons?

>  > Maybe, but that's a bit tricky because we need to consider whether or
>  > not the window is selected and what cursor-in-non-selected-windows has
>  > to say to figure out what the cursor will actually look like.  Currently
>  > this function just provides Lisp with access to the window slot, so we
>  > have all the needed information available in Lisp.  I suggest keeping
>  > 'window-cursor-type' simple and, if the need arises, providing a Lisp
>  > function that calculates the effective cursor type for a given window.
>  > WDYT?
> 
> If needed, the function can be given a second argument that allows to
> retrieve either the value specified for this window or the effective
> value used.

SGTM, thanks.




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

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


Received: (at 70622) by debbugs.gnu.org; 10 May 2024 16:19:12 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri May 10 12:19:12 2024
Received: from localhost ([127.0.0.1]:42801 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1s5Sxj-0003z8-SQ
	for submit <at> debbugs.gnu.org; Fri, 10 May 2024 12:19:12 -0400
Received: from eggs.gnu.org ([209.51.188.92]:42810)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1s5Sxg-0003yw-Ug
 for 70622 <at> debbugs.gnu.org; Fri, 10 May 2024 12:19: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 1s5Sxb-0004q9-Sp; Fri, 10 May 2024 12:19: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=DjV5oj6nqHN27wvoJ4ZDDt/cy3hGDr8GA111P8uE8jE=; b=SqWY+mUa2l0G
 Kh3NV4+hciPXmGja+d8N0oVx8VWCSjTr0AtLyBYxWZS6UGoLhNHqOs4wMfIIKqKq/ijd6A25eMEja
 h8GiVdSaCcc/jotzDInRTr43T3PMYvwaMkQbmFINazPoHkGharczSczzG6A01zvofQLim6Giw0WH/
 U7HFnZKySR/TwgsDQLhw2VlBzDj0UmoCIenZ5rTazv0T179QXKHZHIhoEpUO5YmKeSMWOp6sUJk9Y
 qXVr8MmqsevHZM1v0cl3WwHHjM60kw3knK4Sbk9KWgp+xgGwa2YfnHJV6Dd1qw7M+WZiP8uhGci6n
 pRcrA6j9Hy4zY9e43oBPbw==;
Date: Fri, 10 May 2024 19:19:00 +0300
Message-Id: <86eda94p3f.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Eshel Yaron <me@HIDDEN>
In-Reply-To: <m1v83ndq4s.fsf@HIDDEN> (message from Eshel Yaron on Thu, 
 09 May 2024 16:19:31 +0200)
Subject: Re: bug#70622: [PATCH] New window parameter 'cursor-type'
References: <m1il02ypau.fsf@HIDDEN> <864jbmuf39.fsf@HIDDEN>
 <m1zftdr0q6.fsf@HIDDEN> <8634r5tsit.fsf@HIDDEN>
 <m1sez5paso.fsf@HIDDEN> <86y18wsmqy.fsf@HIDDEN>
 <m1jzkg60py.fsf@HIDDEN> <86cyq8sfif.fsf@HIDDEN>
 <0519d8d8-2a3d-411a-a5bb-b556e0fb86db@HIDDEN> <868r0ws9u1.fsf@HIDDEN>
 <ca3fb469-127b-462c-856d-8da266db8e76@HIDDEN> <867cgfqcbn.fsf@HIDDEN>
 <86jzk377kx.fsf@HIDDEN> <m1pltvfe2x.fsf@HIDDEN>
 <86v83n5iry.fsf@HIDDEN> <m1v83ndq4s.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 70622
Cc: rudalics@HIDDEN, 70622 <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: Eshel Yaron <me@HIDDEN>
> Cc: rudalics@HIDDEN,  70622 <at> debbugs.gnu.org
> Date: Thu, 09 May 2024 16:19:31 +0200
> 
> >> +DEFUN ("set-window-cursor-type", Fset_window_cursor_type,
> >> +       Sset_window_cursor_type, 2, 2, 0,
> >> +       doc: /* Set the `cursor-type' of WINDOW to TYPE.
> >> +
> >> +This setting takes precedence over the variable `cursor-type', and TYPE
> >> +has the same format as the value of that variable.  WINDOW nil means use
> >> +the selected window.  */)
> >> +  (Lisp_Object window, Lisp_Object type)
> >> +{
> >> +  struct window *w = decode_live_window (window);
> >> +
> >> +  wset_cursor_type (w, type);
> >
> > Shouldn't we validate the value of TYPE before plugging it into the
> > window?  I know we will validate it at display time, but maybe it's a
> > good idea to do that here as well, and signal an error up front?
> 
> AFAICT there are no invalid values, since we take "any other value" to
> mean the same as 'hollow' (see C-h v cursor-type), so I think not
> validating anything should be perfectly valid :)

I know, but that's because there's no useful way of signaling an error
in the middle of redisplay.  Here we have an opportunity to help the
caller to catch any mistakes before the value is applied, so why not?

> Maybe, but that's a bit tricky because we need to consider whether or
> not the window is selected and what cursor-in-non-selected-windows has
> to say to figure out what the cursor will actually look like.  Currently
> this function just provides Lisp with access to the window slot, so we
> have all the needed information available in Lisp.  I suggest keeping
> 'window-cursor-type' simple and, if the need arises, providing a Lisp
> function that calculates the effective cursor type for a given window.
> WDYT?

Martin suggested a way to have both, so I think we should take it.




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

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


Received: (at 70622) by debbugs.gnu.org; 10 May 2024 08:59:11 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri May 10 04:59:11 2024
Received: from localhost ([127.0.0.1]:41850 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1s5M5u-0006mK-Of
	for submit <at> debbugs.gnu.org; Fri, 10 May 2024 04:59:11 -0400
Received: from mout.gmx.net ([212.227.17.21]:39941)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <rudalics@HIDDEN>) id 1s5M5r-0006lt-1R
 for 70622 <at> debbugs.gnu.org; Fri, 10 May 2024 04:59:09 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.at;
 s=s31663417; t=1715331540; x=1715936340; i=rudalics@HIDDEN;
 bh=/T11HaPOb/eu1CeG67C62uP/3P1KKB+c/IbEH+70oYA=;
 h=X-UI-Sender-Class:Message-ID:Date:MIME-Version:Subject:To:Cc:
 References:From:In-Reply-To:Content-Type:
 Content-Transfer-Encoding:cc:content-transfer-encoding:
 content-type:date:from:message-id:mime-version:reply-to:subject:
 to;
 b=jKgbpVgQYV9LHTR6JXRqJgn9c8L/6lyh67KAAShFsSTgKh1aKlfc1AWt0zAxFSJC
 +cYvkeBMlJRP4Klk7124pD3vq9EZrhJDGICfXSV1uG7J4S8pAwM5TF1qj8y/dEEkE
 8pbblvm2jsZ98PO2aHGZFruHa8HucuxuGwjmRsHKISI6DUE6dB83MMknyvYlaF9YH
 TbiHN1xNA59N5j0+LMAkOpdApUCXXR5bs1dBFckMkjHfZ+d+EMahrtksqDmdyeRxb
 9s9oq3x4VbmPb4td5s28d4Z+1Xa9RIbIFu9zL9gl5JK8xloeeEWa+Cieyln7AIg7q
 /Ujuh9j9NBopxsWjrQ==
X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a
Received: from [192.168.31.113] ([212.95.5.30]) by mail.gmx.net (mrgmx104
 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MmULx-1sVIzS3rer-00lReJ; Fri, 10
 May 2024 10:59:00 +0200
Message-ID: <283e9319-8863-44e7-be72-995b8b36c37e@HIDDEN>
Date: Fri, 10 May 2024 10:58:58 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: bug#70622: [PATCH] New window parameter 'cursor-type'
To: Eshel Yaron <me@HIDDEN>, Eli Zaretskii <eliz@HIDDEN>
References: <m1il02ypau.fsf@HIDDEN> <864jbmuf39.fsf@HIDDEN>
 <m1zftdr0q6.fsf@HIDDEN> <8634r5tsit.fsf@HIDDEN>
 <m1sez5paso.fsf@HIDDEN> <86y18wsmqy.fsf@HIDDEN>
 <m1jzkg60py.fsf@HIDDEN> <86cyq8sfif.fsf@HIDDEN>
 <0519d8d8-2a3d-411a-a5bb-b556e0fb86db@HIDDEN> <868r0ws9u1.fsf@HIDDEN>
 <ca3fb469-127b-462c-856d-8da266db8e76@HIDDEN> <867cgfqcbn.fsf@HIDDEN>
 <86jzk377kx.fsf@HIDDEN> <m1pltvfe2x.fsf@HIDDEN>
 <86v83n5iry.fsf@HIDDEN> <m1v83ndq4s.fsf@HIDDEN>
Content-Language: en-US
From: martin rudalics <rudalics@HIDDEN>
In-Reply-To: <m1v83ndq4s.fsf@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Provags-ID: V03:K1:2TqDS26+p6KJhg4V6wi5JL/lxh8nPfq4Dj48opDhWTqN+EJHZZ5
 fA4sDOrE20KbTsGGQUDvmqEq9LeyAeEuuBA8TlSaHzwzLUfpzls625OKeCDFPBZnYMCHTBB
 PmUjcXvwY2DW+erHA8fjk8CMHX1VzLuMSqck12XHaRVsoZSUybK7qd//m171LAGxOpS6RPa
 bANJY/no5ahWXXP0vLKyA==
X-Spam-Flag: NO
UI-OutboundReport: notjunk:1;M01:P0:sDLV2X8KpEs=;/LZ62SI9WYMB6P5khoUrQLVqdy6
 4dg68XGoZK+KhqkTeFp0mX0MepbAGrWH4LRHNB3sz0hxfM2/xUTj6dEAWB9XlVmX1ZKyLKTQI
 5PHG7yHHcbMpyMp8V1m3dj79K7bEaZbewsu75GZm48SEL2B8aOdkB1RptI9fwfQ9vRqzhBeUi
 58TqnltKjVS+xr5n17tFzFf04QcWqWQxaM1zk+KXuxKjkmQjH+6/UkADDgn+9qzQ/APeeQOB1
 UkM+t+xivmZFp1BuAx+cL0KGlVVBrVdVyD/7l5790IsedmQIWxOQbvybg1FS3KKXEusz0CYd2
 UfkVxg/3CNFzYDf1R/wV17wcxSlzMM30J/sL0MC7m5fNiNb8ytdDZHv8rOFWBUCx9PIhyp9ee
 miMp27PlyLK60qmsw6qIwZH8s75/lte4J4+R5/i3Zv+Afd7kXog9vXGzXLen3XFZH2QD5PjMu
 VOqwWIxuhlb75yOuw69XN3zfZkigcJQEMmenQV2A/VzHh2HGftc1RzT7Y6wGCxb85m9qupsOQ
 AmTH7RObk6sDoqv19fmsdzIzKxMW1y+DEuwZuZmtiQH/1h2GSS/ahDTvsxJLJHFGPROriprhD
 eXbEr/rd0VykEENDUY32PjfdkaE5MxwAjqBFhLtuTi3tvdJ8asQaBPUR7s4hiXIaSBk+cYYla
 MM7JuhiOUu/dJMsks8Lfykr1dFDRGXzADS6OqXHmGEcb1n3yvQYjX10qVWBSWR3T0yXqy73T0
 dnx1Ky3TXiOfyR7W//BvimhqusPEDQONmx5O4pce+f3aeYDWn+9OZxDCCU/KhXFsf5MR4M7/+
 fUtCGEkYFC1PONGAWE1VfAMBTG/0UYxMgsj45g7/OPfY25j2Ub8TP70jPLloWMiIif
X-Spam-Score: 2.9 (++)
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:  >>> +DEFUN ("set-window-cursor-type", Fset_window_cursor_type,
 >>> + Sset_window_cursor_type, 2, 2, 0, >>> + doc: /* Set the `cursor-type'
 of WINDOW to TYPE. >>> + >>> +This setting takes precedence [...] 
 Content analysis details:   (2.9 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -0.0 RCVD_IN_MSPIKE_H2      RBL: Average reputation (+2)
 [212.227.17.21 listed in wl.mailspike.net]
 -0.7 RCVD_IN_DNSWL_LOW      RBL: Sender listed at https://www.dnswl.org/,
 low trust [212.227.17.21 listed in list.dnswl.org]
 3.6 RCVD_IN_SBL_CSS        RBL: Received via a relay in Spamhaus SBL-CSS
 [212.95.5.30 listed in zen.spamhaus.org]
 0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 0.0 FREEMAIL_FROM          Sender email is commonly abused enduser mail
 provider (rudalics[at]gmx.at)
 -0.0 SPF_PASS               SPF: sender matches SPF record
X-Debbugs-Envelope-To: 70622
Cc: 70622 <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.9 (+)
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:  >>> +DEFUN ("set-window-cursor-type", Fset_window_cursor_type,
    >>> + Sset_window_cursor_type, 2, 2, 0, >>> + doc: /* Set the `cursor-type'
    of WINDOW to TYPE. >>> + >>> +This setting takes precedence [...] 
 
 Content analysis details:   (1.9 points, 10.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -0.0 RCVD_IN_MSPIKE_H2      RBL: Average reputation (+2)
                             [212.227.17.21 listed in wl.mailspike.net]
  3.6 RCVD_IN_SBL_CSS        RBL: Received via a relay in Spamhaus SBL-CSS
                             [212.95.5.30 listed in zen.spamhaus.org]
 -0.7 RCVD_IN_DNSWL_LOW      RBL: Sender listed at https://www.dnswl.org/,
                             low trust
                             [212.227.17.21 listed in list.dnswl.org]
  0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
  0.0 FREEMAIL_FROM          Sender email is commonly abused enduser mail
                             provider (rudalics[at]gmx.at)
 -0.0 SPF_PASS               SPF: sender matches SPF record
 -1.0 MAILING_LIST_MULTI     Multiple indicators imply a widely-seen list
                             manager

 >>> +DEFUN ("set-window-cursor-type", Fset_window_cursor_type,
 >>> +       Sset_window_cursor_type, 2, 2, 0,
 >>> +       doc: /* Set the `cursor-type' of WINDOW to TYPE.
 >>> +
 >>> +This setting takes precedence over the variable `cursor-type', and TYPE
 >>> +has the same format as the value of that variable.  WINDOW nil means use
 >>> +the selected window.  */)
 >>> +  (Lisp_Object window, Lisp_Object type)
 >>> +{
 >>> +  struct window *w = decode_live_window (window);
 >>> +
 >>> +  wset_cursor_type (w, type);
 >>
 >> Shouldn't we validate the value of TYPE before plugging it into the
 >> window?  I know we will validate it at display time, but maybe it's a
 >> good idea to do that here as well, and signal an error up front?
 >
 > AFAICT there are no invalid values, since we take "any other value" to
 > mean the same as 'hollow' (see C-h v cursor-type), so I think not
 > validating anything should be perfectly valid :)
 >
 >> Martin, WDYT?

I think Eshel is right.

 >>> +DEFUN ("window-cursor-type", Fwindow_cursor_type, Swindow_cursor_type,
 >>> +       0, 1, 0,
 >>> +       doc: /* Return the `cursor-type' of WINDOW.
 >>> +WINDOW must be a live window and defaults to the selected one.  */)
 >>> +  (Lisp_Object window)
 >>> +{
 >>> +  return decode_live_window (window)->cursor_type;
 >>> +}
 >>
 >> This will AFAIU return t if the value is Qt.  Should we return the
 >> value actually in effect in that case?
 >
 > Maybe, but that's a bit tricky because we need to consider whether or
 > not the window is selected and what cursor-in-non-selected-windows has
 > to say to figure out what the cursor will actually look like.  Currently
 > this function just provides Lisp with access to the window slot, so we
 > have all the needed information available in Lisp.  I suggest keeping
 > 'window-cursor-type' simple and, if the need arises, providing a Lisp
 > function that calculates the effective cursor type for a given window.
 > WDYT?

If needed, the function can be given a second argument that allows to
retrieve either the value specified for this window or the effective
value used.

'set-window-cursor-type' like all other functions and parameters in this
context suffers from the problem that there's no common concept wrt
setting window/buffer/frame-local values.  This matters when a
buffer-local value changes or another buffer is shown in a window.  For
margins or fringes the PERSISTENT argument can be used to tell whether a
window-specified value shall survive subsequent 'set-window-buffer'
calls.  Setting the buffer variable for these doesn't take effect
immediately.

For 'set-window-cursor-type' we probably should say that any value it
sets is "persistent" (survives subsequent 'set-window-buffer' calls)
unless the value delegates the choice to the 'cursor-type' variable or
frame parameter and that it takes effect immediately.

And we _could_ tell that setting the 'cursor-type' variable takes effect
"pretty soon", that is when an associated window is redisplayed so it
does not have to wait until the next 'set-window-buffer' call, that it
can be overridden by 'set-window-cursor-type' in quite some ways, and
that 'set-window-buffer' won't use the buffer value when another way has
been specified via 'set-window-cursor-type'.  If I'm right, obviously.

martin




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

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


Received: (at 70622) by debbugs.gnu.org; 9 May 2024 14:20:04 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu May 09 10:20:04 2024
Received: from localhost ([127.0.0.1]:55544 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1s54cs-0003Rx-QM
	for submit <at> debbugs.gnu.org; Thu, 09 May 2024 10:20:03 -0400
Received: from mail.eshelyaron.com ([107.175.124.16]:44536 helo=eshelyaron.com)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <me@HIDDEN>) id 1s54cq-0003RQ-EM
 for 70622 <at> debbugs.gnu.org; Thu, 09 May 2024 10:20:01 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eshelyaron.com;
 s=mail; t=1715264373;
 bh=pl8Cj991VZUEebflrZtXFHCNZdKMDFL0BgvSL921IaM=;
 h=From:To:Cc:Subject:In-Reply-To:References:Date:From;
 b=EQYjGkARSCRYfRQNAdxmSiuWSfTcdcWxBkJNgQ6BPCpNvRXlH2JEbGJGYKBUEtsrT
 eGhQR+sfTnmmpbhHP9I+9idzzU8mdqVlWWqUEohiFHUa8vR+iOhpZK3eGi8Mq6LIwK
 oanaeGd29vg5Z11/I78uNuPpnE+HdHza4zaAorKKDOAFBf2rW8yh/w6t7RTt8pgEvc
 XUK8M0uGFN7A2m13w2TimyFyP9XN7IGmGru/2O24sAWFr4zdzLMn/vMtoYpEJX0kvj
 vGCmudTlxugVwBUmQFYmKZ5uI5brvMN+KoN4hdjYF+6C5DN7hQR8wYZpRyFkjjKp68
 hnSJ5HhBUJFNg==
From: Eshel Yaron <me@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#70622: [PATCH] New window parameter 'cursor-type'
In-Reply-To: <86v83n5iry.fsf@HIDDEN> (Eli Zaretskii's message of "Thu, 09 May
 2024 14:25:37 +0300")
References: <m1il02ypau.fsf@HIDDEN> <864jbmuf39.fsf@HIDDEN>
 <m1zftdr0q6.fsf@HIDDEN> <8634r5tsit.fsf@HIDDEN>
 <m1sez5paso.fsf@HIDDEN> <86y18wsmqy.fsf@HIDDEN>
 <m1jzkg60py.fsf@HIDDEN> <86cyq8sfif.fsf@HIDDEN>
 <0519d8d8-2a3d-411a-a5bb-b556e0fb86db@HIDDEN> <868r0ws9u1.fsf@HIDDEN>
 <ca3fb469-127b-462c-856d-8da266db8e76@HIDDEN> <867cgfqcbn.fsf@HIDDEN>
 <86jzk377kx.fsf@HIDDEN> <m1pltvfe2x.fsf@HIDDEN>
 <86v83n5iry.fsf@HIDDEN>
X-Hashcash: 1:20:240509:rudalics@HIDDEN::OMjMvP6Kv1xEpApC:02qf
X-Hashcash: 1:20:240509:70622 <at> debbugs.gnu.org::77YDemKWG12FG8dX:kCr
X-Hashcash: 1:20:240509:eliz@HIDDEN::bwkJwpz6QHB3hWA2:2bVg
Date: Thu, 09 May 2024 16:19:31 +0200
Message-ID: <m1v83ndq4s.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 70622
Cc: rudalics@HIDDEN, 70622 <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 (-)

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

Eli Zaretskii <eliz@HIDDEN> writes:

>> From: Eshel Yaron <me@HIDDEN>
>> Cc: rudalics@HIDDEN,  70622 <at> debbugs.gnu.org
>> Date: Thu, 09 May 2024 12:56:54 +0200
>>
>> > Eshel, could you please update your patch along these lines?
>>
>> Yes, how does the attached patch look?
>
> Looks good, with a few nits:

Thanks, I'm attaching another iteration of this patch below.

>>  @vindex cursor-type
>> -The @code{cursor-type} frame parameter may be overridden by the
>> -variables @code{cursor-type} and
>> -@code{cursor-in-non-selected-windows}:
>> +The @code{cursor-type} frame parameter may be overridden by
>> +@code{set-window-cursor-type}, and by the variables @code{cursor-type}
>> +and @code{cursor-in-non-selected-windows}:
>
> Please add here a cross-reference to where set-window-cursor-type is
> described.

Done.

>> --- a/doc/lispref/windows.texi
>> +++ b/doc/lispref/windows.texi
>> @@ -5142,6 +5142,18 @@ Window Point
>>  so @code{window-point} will stay behind text inserted there.
>>  @end defvar
>>
>> +@defun set-window-cursor-type window type
>> +This function sets the cursor shape for @var{window}.  This setting
>> +takes precedence over the @code{cursor-type} variable, and @var{type}
>> +has the same format as the value of that variable.
>
> And here, please add a cross-reference to where the values accepted by
> cursor-type are described.

Done.

>> ++++
>> +*** New functions 'set-window-cursor-type' and 'window-cursor-type'.
>> +'set-window-cursor-type' sets a per-window cursor type, and
>> +'window-cursor-type' queries this setting for a given window.
>
> Here, we should tell what is the default value and its meaning.

And done.

>> +DEFUN ("set-window-cursor-type", Fset_window_cursor_type,
>> +       Sset_window_cursor_type, 2, 2, 0,
>> +       doc: /* Set the `cursor-type' of WINDOW to TYPE.
>> +
>> +This setting takes precedence over the variable `cursor-type', and TYPE
>> +has the same format as the value of that variable.  WINDOW nil means use
>> +the selected window.  */)
>> +  (Lisp_Object window, Lisp_Object type)
>> +{
>> +  struct window *w = decode_live_window (window);
>> +
>> +  wset_cursor_type (w, type);
>
> Shouldn't we validate the value of TYPE before plugging it into the
> window?  I know we will validate it at display time, but maybe it's a
> good idea to do that here as well, and signal an error up front?

AFAICT there are no invalid values, since we take "any other value" to
mean the same as 'hollow' (see C-h v cursor-type), so I think not
validating anything should be perfectly valid :)

> Martin, WDYT?
>
>> +DEFUN ("window-cursor-type", Fwindow_cursor_type, Swindow_cursor_type,
>> +       0, 1, 0,
>> +       doc: /* Return the `cursor-type' of WINDOW.
>> +WINDOW must be a live window and defaults to the selected one.  */)
>> +  (Lisp_Object window)
>> +{
>> +  return decode_live_window (window)->cursor_type;
>> +}
>
> This will AFAIU return t if the value is Qt.  Should we return the
> value actually in effect in that case?

Maybe, but that's a bit tricky because we need to consider whether or
not the window is selected and what cursor-in-non-selected-windows has
to say to figure out what the cursor will actually look like.  Currently
this function just provides Lisp with access to the window slot, so we
have all the needed information available in Lisp.  I suggest keeping
'window-cursor-type' simple and, if the need arises, providing a Lisp
function that calculates the effective cursor type for a given window.
WDYT?

>> --- a/src/window.h
>> +++ b/src/window.h
>> @@ -323,6 +323,9 @@ #define WINDOW_H_INCLUDED
>>         as the normal may yield a matrix which is too small.  */
>>      int nrows_scale_factor, ncols_scale_factor;
>>
>> +    /* `cursor-type' to use in this window.  */
>> +    Lisp_Object cursor_type;
>> +
>
> The comment after the mode_line_help_echo member of 'struct window'
> says:
>
>     /* No Lisp data may follow this point; mode_line_help_echo must be
>        the last Lisp member.  */

Oh I missed that, thanks!

> So you must move this new Lisp_Object member to before
> mode_line_help_echo

Done, here's the updated patch:


--=-=-=
Content-Type: text/x-patch
Content-Disposition: attachment;
 filename=v4-0001-New-functions-set-window-cursor-type.patch

From c685d968962be8e16205bffb4cc1a953218d8e4f Mon Sep 17 00:00:00 2001
From: Eshel Yaron <me@HIDDEN>
Date: Sat, 27 Apr 2024 20:47:34 +0200
Subject: [PATCH v4] New functions '(set-)window-cursor-type'

* src/window.h (struct window): Add 'cursor_type' slot.
(wset_cursor_type): New inline function.
* src/xdisp.c (get_window_cursor_type): Consult 'cursor_type'.
* src/window.c (make_window): Initialize 'cursor_type' to t.
(Fset_window_cursor_type, Fwindow_cursor_type): New functions.
(syms_of_window): List their symbols.
* doc/lispref/windows.texi (Window Point): Document them.
* doc/lispref/frames.texi (Cursor Parameters): Mention
new 'set-window-cursor-type'.
* etc/NEWS: Announce new functions.  (Bug#70622)
---
 doc/lispref/frames.texi  |  6 +++---
 doc/lispref/windows.texi | 13 +++++++++++++
 etc/NEWS                 |  7 +++++++
 src/window.c             | 30 ++++++++++++++++++++++++++++++
 src/window.h             |  9 +++++++++
 src/xdisp.c              | 29 ++++++++++++++++++-----------
 6 files changed, 80 insertions(+), 14 deletions(-)

diff --git a/doc/lispref/frames.texi b/doc/lispref/frames.texi
index cae93acae9f..974def3de10 100644
--- a/doc/lispref/frames.texi
+++ b/doc/lispref/frames.texi
@@ -2341,9 +2341,9 @@ Cursor Parameters
 @end table
 
 @vindex cursor-type
-The @code{cursor-type} frame parameter may be overridden by the
-variables @code{cursor-type} and
-@code{cursor-in-non-selected-windows}:
+The @code{cursor-type} frame parameter may be overridden by
+@code{set-window-cursor-type} (@pxref{Window Point}), and by the
+variables @code{cursor-type} and @code{cursor-in-non-selected-windows}:
 
 @defopt cursor-type
 This buffer-local variable controls how the cursor looks in a selected
diff --git a/doc/lispref/windows.texi b/doc/lispref/windows.texi
index 104420235df..eb9a5b4efb1 100644
--- a/doc/lispref/windows.texi
+++ b/doc/lispref/windows.texi
@@ -5142,6 +5142,19 @@ Window Point
 so @code{window-point} will stay behind text inserted there.
 @end defvar
 
+@defun set-window-cursor-type window type
+This function sets the cursor shape for @var{window}.  This setting
+takes precedence over the @code{cursor-type} variable, and @var{type}
+has the same format as the value of that variable.  @xref{Cursor
+Parameters}.  If @var{window} is @code{nil}, it means to set the cursor
+type for the selected window.
+@end defun
+
+@defun window-cursor-type &optional window
+This function returns the cursor type of @var{window}, defaulting to the
+selected window.
+@end defun
+
 @node Window Start and End
 @section The Window Start and End Positions
 @cindex window start position
diff --git a/etc/NEWS b/etc/NEWS
index 9c356e64bde..700c7d060b8 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -340,6 +340,13 @@ and 'window-state-get'.  Then later another new variable
 'window-state-put' to restore positions of window points
 according to the context stored in a window parameter.
 
++++
+*** New functions 'set-window-cursor-type' and 'window-cursor-type'.
+'set-window-cursor-type' sets a per-window cursor type, and
+'window-cursor-type' queries this setting for a given window.  Windows
+are always created with a 'window-cursor-type' of t, which means to
+consult the variable 'cursor-type' as before.
+
 ** Tab Bars and Tab Lines
 
 ---
diff --git a/src/window.c b/src/window.c
index cf12841bd51..e71f1b152a6 100644
--- a/src/window.c
+++ b/src/window.c
@@ -4425,6 +4425,7 @@ make_window (void)
   wset_old_pointm (w, Fmake_marker ());
   wset_vertical_scroll_bar_type (w, Qt);
   wset_horizontal_scroll_bar_type (w, Qt);
+  wset_cursor_type (w, Qt);
   /* These Lisp fields are marked specially so they're not set to nil by
      allocate_window.  */
   wset_prev_buffers (w, Qnil);
@@ -8050,6 +8051,33 @@ DEFUN ("window-fringes", Fwindow_fringes, Swindow_fringes,
 		w->fringes_persistent ? Qt : Qnil);
 }
 
+DEFUN ("set-window-cursor-type", Fset_window_cursor_type,
+       Sset_window_cursor_type, 2, 2, 0,
+       doc: /* Set the `cursor-type' of WINDOW to TYPE.
+
+This setting takes precedence over the variable `cursor-type', and TYPE
+has the same format as the value of that variable.  WINDOW nil means use
+the selected window.  */)
+  (Lisp_Object window, Lisp_Object type)
+{
+  struct window *w = decode_live_window (window);
+
+  wset_cursor_type (w, type);
+
+  /* Redisplay with updated cursor type.  */
+  wset_redisplay (w);
+
+  return type;
+}
+
+DEFUN ("window-cursor-type", Fwindow_cursor_type, Swindow_cursor_type,
+       0, 1, 0,
+       doc: /* Return the `cursor-type' of WINDOW.
+WINDOW must be a live window and defaults to the selected one.  */)
+  (Lisp_Object window)
+{
+  return decode_live_window (window)->cursor_type;
+}
 
 
 /***********************************************************************
@@ -8976,4 +9004,6 @@ syms_of_window (void)
   defsubr (&Swindow_parameters);
   defsubr (&Swindow_parameter);
   defsubr (&Sset_window_parameter);
+  defsubr (&Swindow_cursor_type);
+  defsubr (&Sset_window_cursor_type);
 }
diff --git a/src/window.h b/src/window.h
index 19283725931..86932181252 100644
--- a/src/window.h
+++ b/src/window.h
@@ -205,6 +205,9 @@ #define WINDOW_H_INCLUDED
     /* An alist with parameters.  */
     Lisp_Object window_parameters;
 
+    /* `cursor-type' to use in this window.  */
+    Lisp_Object cursor_type;
+
     /* The help echo text for this window.  Qnil if there's none.  */
     Lisp_Object mode_line_help_echo;
 
@@ -542,6 +545,12 @@ wset_horizontal_scroll_bar_type (struct window *w, Lisp_Object val)
   w->horizontal_scroll_bar_type = val;
 }
 
+INLINE void
+wset_cursor_type (struct window *w, Lisp_Object val)
+{
+  w->cursor_type = val;
+}
+
 INLINE void
 wset_prev_buffers (struct window *w, Lisp_Object val)
 {
diff --git a/src/xdisp.c b/src/xdisp.c
index 85802ec5083..24d0c090326 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -33617,7 +33617,9 @@ get_window_cursor_type (struct window *w, struct glyph *glyph, int *width,
     {
       if (w == XWINDOW (echo_area_window))
 	{
-	  if (EQ (BVAR (b, cursor_type), Qt) || NILP (BVAR (b, cursor_type)))
+	  if (!EQ (Qt, w->cursor_type))
+	      return get_specified_cursor_type (w->cursor_type, width);
+	  else if (EQ (BVAR (b, cursor_type), Qt) || NILP (BVAR (b, cursor_type)))
 	    {
 	      *width = FRAME_CURSOR_WIDTH (f);
 	      return FRAME_DESIRED_CURSOR (f);
@@ -33644,18 +33646,23 @@ get_window_cursor_type (struct window *w, struct glyph *glyph, int *width,
       non_selected = true;
     }
 
-  /* Never display a cursor in a window in which cursor-type is nil.  */
-  if (NILP (BVAR (b, cursor_type)))
-    return NO_CURSOR;
-
-  /* Get the normal cursor type for this window.  */
-  if (EQ (BVAR (b, cursor_type), Qt))
+  if (!EQ (Qt, w->cursor_type))
+      cursor_type = get_specified_cursor_type (w->cursor_type, width);
+  else
     {
-      cursor_type = FRAME_DESIRED_CURSOR (f);
-      *width = FRAME_CURSOR_WIDTH (f);
+      /* Never display a cursor in a window in which cursor-type is nil.  */
+      if (NILP (BVAR (b, cursor_type)))
+	return NO_CURSOR;
+
+      /* Get the normal cursor type for this window.  */
+      if (EQ (BVAR (b, cursor_type), Qt))
+	{
+	  cursor_type = FRAME_DESIRED_CURSOR (f);
+	  *width = FRAME_CURSOR_WIDTH (f);
+	}
+      else
+	cursor_type = get_specified_cursor_type (BVAR (b, cursor_type), width);
     }
-  else
-    cursor_type = get_specified_cursor_type (BVAR (b, cursor_type), width);
 
   /* Use cursor-in-non-selected-windows instead
      for non-selected window or frame.  */
-- 
2.45.0


--=-=-=--




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

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


Received: (at 70622) by debbugs.gnu.org; 9 May 2024 11:26:16 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu May 09 07:26:16 2024
Received: from localhost ([127.0.0.1]:54746 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1s51ui-0006vQ-BG
	for submit <at> debbugs.gnu.org; Thu, 09 May 2024 07:26:16 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:42092)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1s51uf-0006uz-7Y
 for 70622 <at> debbugs.gnu.org; Thu, 09 May 2024 07:26: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 1s51u9-0000e2-HG; Thu, 09 May 2024 07:25:41 -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=wWhx7PFGbprTGStKvGp36KaVKkQEADCmiFHX9zIZMZA=; b=G6fuIFTzfHDg
 10wKuhBDfVKjLhIm8I6EgX644U2HdfXQktCl0J6CNT9v3KuUMcCjF6PsKvhVabaYUhPtfvf+NUFLW
 gIo2gOLKaWFm/SAqISgwbXs6T8i5pYkHr5yTuqtfdLn0J7iT+RHk9TLkhsO3FMetwoM3IdGsamUyq
 ga0gKJsnhFYVzYnZaxtJOdP7ZScaXBii+Vj7NIHsdefOLpGEtCK9hX+9xMPESsMHs0XuE2/AzG6He
 nO4YAKxzkistStTfbrYtTMubTkSEhomI733/xkVpSekljG0Gm+vzPji7CwRv9h3zxLY3AZmP3ZltI
 jQ3u0wgXQKwQh5+AsY1O4A==;
Date: Thu, 09 May 2024 14:25:37 +0300
Message-Id: <86v83n5iry.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Eshel Yaron <me@HIDDEN>
In-Reply-To: <m1pltvfe2x.fsf@HIDDEN> (message from Eshel Yaron on Thu, 
 09 May 2024 12:56:54 +0200)
Subject: Re: bug#70622: [PATCH] New window parameter 'cursor-type'
References: <m1il02ypau.fsf@HIDDEN> <864jbmuf39.fsf@HIDDEN>
 <m1zftdr0q6.fsf@HIDDEN> <8634r5tsit.fsf@HIDDEN>
 <m1sez5paso.fsf@HIDDEN> <86y18wsmqy.fsf@HIDDEN>
 <m1jzkg60py.fsf@HIDDEN> <86cyq8sfif.fsf@HIDDEN>
 <0519d8d8-2a3d-411a-a5bb-b556e0fb86db@HIDDEN> <868r0ws9u1.fsf@HIDDEN>
 <ca3fb469-127b-462c-856d-8da266db8e76@HIDDEN> <867cgfqcbn.fsf@HIDDEN>
 <86jzk377kx.fsf@HIDDEN> <m1pltvfe2x.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 70622
Cc: rudalics@HIDDEN, 70622 <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: Eshel Yaron <me@HIDDEN>
> Cc: rudalics@HIDDEN,  70622 <at> debbugs.gnu.org
> Date: Thu, 09 May 2024 12:56:54 +0200
> 
> > Eshel, could you please update your patch along these lines?
> 
> Yes, how does the attached patch look?

Looks good, with a few nits:

>  @vindex cursor-type
> -The @code{cursor-type} frame parameter may be overridden by the
> -variables @code{cursor-type} and
> -@code{cursor-in-non-selected-windows}:
> +The @code{cursor-type} frame parameter may be overridden by
> +@code{set-window-cursor-type}, and by the variables @code{cursor-type}
> +and @code{cursor-in-non-selected-windows}:

Please add here a cross-reference to where set-window-cursor-type is
described.

> --- a/doc/lispref/windows.texi
> +++ b/doc/lispref/windows.texi
> @@ -5142,6 +5142,18 @@ Window Point
>  so @code{window-point} will stay behind text inserted there.
>  @end defvar
>  
> +@defun set-window-cursor-type window type
> +This function sets the cursor shape for @var{window}.  This setting
> +takes precedence over the @code{cursor-type} variable, and @var{type}
> +has the same format as the value of that variable.

And here, please add a cross-reference to where the values accepted by
cursor-type are described.

> ++++
> +*** New functions 'set-window-cursor-type' and 'window-cursor-type'.
> +'set-window-cursor-type' sets a per-window cursor type, and
> +'window-cursor-type' queries this setting for a given window.

Here, we should tell what is the default value and its meaning.

> +DEFUN ("set-window-cursor-type", Fset_window_cursor_type,
> +       Sset_window_cursor_type, 2, 2, 0,
> +       doc: /* Set the `cursor-type' of WINDOW to TYPE.
> +
> +This setting takes precedence over the variable `cursor-type', and TYPE
> +has the same format as the value of that variable.  WINDOW nil means use
> +the selected window.  */)
> +  (Lisp_Object window, Lisp_Object type)
> +{
> +  struct window *w = decode_live_window (window);
> +
> +  wset_cursor_type (w, type);

Shouldn't we validate the value of TYPE before plugging it into the
window?  I know we will validate it at display time, but maybe it's a
good idea to do that here as well, and signal an error up front?
Martin, WDYT?

> +DEFUN ("window-cursor-type", Fwindow_cursor_type, Swindow_cursor_type,
> +       0, 1, 0,
> +       doc: /* Return the `cursor-type' of WINDOW.
> +WINDOW must be a live window and defaults to the selected one.  */)
> +  (Lisp_Object window)
> +{
> +  return decode_live_window (window)->cursor_type;
> +}

This will AFAIU return t if the value is Qt.  Should we return the
value actually in effect in that case?

> --- a/src/window.h
> +++ b/src/window.h
> @@ -323,6 +323,9 @@ #define WINDOW_H_INCLUDED
>         as the normal may yield a matrix which is too small.  */
>      int nrows_scale_factor, ncols_scale_factor;
>  
> +    /* `cursor-type' to use in this window.  */
> +    Lisp_Object cursor_type;
> +

The comment after the mode_line_help_echo member of 'struct window'
says:

    /* No Lisp data may follow this point; mode_line_help_echo must be
       the last Lisp member.  */

So you must move this new Lisp_Object member to before
mode_line_help_echo (or move it just after it, and update the comment
and allocate_window accordingly).  This is because GC needs to know
where the Lisp part of a window object ends.

Thanks.




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

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


Received: (at 70622) by debbugs.gnu.org; 9 May 2024 10:57:29 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu May 09 06:57:29 2024
Received: from localhost ([127.0.0.1]:54621 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1s51Sq-0006aV-S7
	for submit <at> debbugs.gnu.org; Thu, 09 May 2024 06:57:29 -0400
Received: from mail.eshelyaron.com ([107.175.124.16]:48284 helo=eshelyaron.com)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <me@HIDDEN>) id 1s51Sl-0006aI-In
 for 70622 <at> debbugs.gnu.org; Thu, 09 May 2024 06:57:27 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eshelyaron.com;
 s=mail; t=1715252217;
 bh=edzh2wddOlxULJVZt2tGl3r0ajCEvPihjksiwo2bDho=;
 h=From:To:Cc:Subject:In-Reply-To:References:Date:From;
 b=wBXTP45IUiT1RyopxLgZiBZjT2e7w8dB0ZRdVCuhr+V5IoBhKsoNRmJYRlg3VgvVI
 vAZsDUSzi37/P8Pn+6A+4w/982e90Nr0TIYxA8HR3KFybrN/+amRF/WkByorjgspn9
 m4U1elzgU0HRAFPyAx1oxnnrCtsxMFs88uaODUNzXCczbHGKrAnfWSXbn3rs4YST8z
 LNkDXH4klKDoSJMWG2Q76qB7UMDFj4pY+FOJ4F9YMv9BW1bMNUXmtG/O2oGYrNe8Ha
 DLNYZ7bAWkFK/ViZHKWv68TxYyHeYCWt+AO4xaGsmsUZrHSh48KdQUSKBMBVvWrIZi
 n/UTL4U8Kr5lA==
From: Eshel Yaron <me@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#70622: [PATCH] New window parameter 'cursor-type'
In-Reply-To: <86jzk377kx.fsf@HIDDEN> (Eli Zaretskii's message of "Thu, 09 May
 2024 10:44:30 +0300")
References: <m1il02ypau.fsf@HIDDEN> <864jbmuf39.fsf@HIDDEN>
 <m1zftdr0q6.fsf@HIDDEN> <8634r5tsit.fsf@HIDDEN>
 <m1sez5paso.fsf@HIDDEN> <86y18wsmqy.fsf@HIDDEN>
 <m1jzkg60py.fsf@HIDDEN> <86cyq8sfif.fsf@HIDDEN>
 <0519d8d8-2a3d-411a-a5bb-b556e0fb86db@HIDDEN> <868r0ws9u1.fsf@HIDDEN>
 <ca3fb469-127b-462c-856d-8da266db8e76@HIDDEN> <867cgfqcbn.fsf@HIDDEN>
 <86jzk377kx.fsf@HIDDEN>
Date: Thu, 09 May 2024 12:56:54 +0200
Message-ID: <m1pltvfe2x.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 70622
Cc: rudalics@HIDDEN, 70622 <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 (-)

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

Hi,

Eli Zaretskii <eliz@HIDDEN> writes:

>> Cc: me@HIDDEN, 70622 <at> debbugs.gnu.org
>> Date: Tue, 30 Apr 2024 15:12:12 +0300
>> From: Eli Zaretskii <eliz@HIDDEN>
>> 
>> > Date: Tue, 30 Apr 2024 11:03:44 +0200
>> > Cc: me@HIDDEN, 70622 <at> debbugs.gnu.org
>> > From: martin rudalics <rudalics@HIDDEN>
>> > 
>> >  > So that cursor-type is no longer a window-parameter?
>> > 
>> > Yes.  IIUC it would mean that we have to initialize the cursor_type slot
>> > of a new window to t.  With the window parameter solution one would have
>> > to add a new 'cursor-type' parameter with a value of t whenever making a
>> > new window.  This would break with the convention that non-nil window
>> > parameters are used for handling "special" behaviors only.
>> 
>> I'm fine with this approach, thanks.  It will also solve nicely the
>> problem of redisplaying the affected window ASAP.
>
> Eshel, could you please update your patch along these lines?

Yes, how does the attached patch look?


--=-=-=
Content-Type: text/x-patch
Content-Disposition: attachment;
 filename=v3-0001-New-functions-set-window-cursor-type.patch

From 418170a9860d368eb268b01f7b3d00f5c4d9e169 Mon Sep 17 00:00:00 2001
From: Eshel Yaron <me@HIDDEN>
Date: Sat, 27 Apr 2024 20:47:34 +0200
Subject: [PATCH v3] New functions '(set-)window-cursor-type'

* src/window.h (struct window): Add 'cursor_type' slot.
(wset_cursor_type): New inline function.
* src/xdisp.c (get_window_cursor_type): Consult 'cursor_type'.
* src/window.c (make_window): Initialize 'cursor_type' to t.
(Fset_window_cursor_type, Fwindow_cursor_type): New functions.
(syms_of_window): List their symbols.
* doc/lispref/windows.texi (Window Point): Document them.
* doc/lispref/frames.texi (Cursor Parameters): Mention
new 'set-window-cursor-type'.
* etc/NEWS: Announce new functions.  (Bug#70622)
---
 doc/lispref/frames.texi  |  6 +++---
 doc/lispref/windows.texi | 12 ++++++++++++
 etc/NEWS                 |  5 +++++
 src/window.c             | 30 ++++++++++++++++++++++++++++++
 src/window.h             |  9 +++++++++
 src/xdisp.c              | 29 ++++++++++++++++++-----------
 6 files changed, 77 insertions(+), 14 deletions(-)

diff --git a/doc/lispref/frames.texi b/doc/lispref/frames.texi
index cae93acae9f..df6a94ed0f7 100644
--- a/doc/lispref/frames.texi
+++ b/doc/lispref/frames.texi
@@ -2341,9 +2341,9 @@ Cursor Parameters
 @end table
 
 @vindex cursor-type
-The @code{cursor-type} frame parameter may be overridden by the
-variables @code{cursor-type} and
-@code{cursor-in-non-selected-windows}:
+The @code{cursor-type} frame parameter may be overridden by
+@code{set-window-cursor-type}, and by the variables @code{cursor-type}
+and @code{cursor-in-non-selected-windows}:
 
 @defopt cursor-type
 This buffer-local variable controls how the cursor looks in a selected
diff --git a/doc/lispref/windows.texi b/doc/lispref/windows.texi
index 104420235df..745dca49f9a 100644
--- a/doc/lispref/windows.texi
+++ b/doc/lispref/windows.texi
@@ -5142,6 +5142,18 @@ Window Point
 so @code{window-point} will stay behind text inserted there.
 @end defvar
 
+@defun set-window-cursor-type window type
+This function sets the cursor shape for @var{window}.  This setting
+takes precedence over the @code{cursor-type} variable, and @var{type}
+has the same format as the value of that variable.  If @var{window} is
+@code{nil}, it means to set the cursor type for the selected window.
+@end defun
+
+@defun window-cursor-type &optional window
+This function returns the cursor type of @var{window}, defaulting to the
+selected window.
+@end defun
+
 @node Window Start and End
 @section The Window Start and End Positions
 @cindex window start position
diff --git a/etc/NEWS b/etc/NEWS
index 9c356e64bde..3cf97b605e7 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -340,6 +340,11 @@ and 'window-state-get'.  Then later another new variable
 'window-state-put' to restore positions of window points
 according to the context stored in a window parameter.
 
++++
+*** New functions 'set-window-cursor-type' and 'window-cursor-type'.
+'set-window-cursor-type' sets a per-window cursor type, and
+'window-cursor-type' queries this setting for a given window.
+
 ** Tab Bars and Tab Lines
 
 ---
diff --git a/src/window.c b/src/window.c
index cf12841bd51..e71f1b152a6 100644
--- a/src/window.c
+++ b/src/window.c
@@ -4425,6 +4425,7 @@ make_window (void)
   wset_old_pointm (w, Fmake_marker ());
   wset_vertical_scroll_bar_type (w, Qt);
   wset_horizontal_scroll_bar_type (w, Qt);
+  wset_cursor_type (w, Qt);
   /* These Lisp fields are marked specially so they're not set to nil by
      allocate_window.  */
   wset_prev_buffers (w, Qnil);
@@ -8050,6 +8051,33 @@ DEFUN ("window-fringes", Fwindow_fringes, Swindow_fringes,
 		w->fringes_persistent ? Qt : Qnil);
 }
 
+DEFUN ("set-window-cursor-type", Fset_window_cursor_type,
+       Sset_window_cursor_type, 2, 2, 0,
+       doc: /* Set the `cursor-type' of WINDOW to TYPE.
+
+This setting takes precedence over the variable `cursor-type', and TYPE
+has the same format as the value of that variable.  WINDOW nil means use
+the selected window.  */)
+  (Lisp_Object window, Lisp_Object type)
+{
+  struct window *w = decode_live_window (window);
+
+  wset_cursor_type (w, type);
+
+  /* Redisplay with updated cursor type.  */
+  wset_redisplay (w);
+
+  return type;
+}
+
+DEFUN ("window-cursor-type", Fwindow_cursor_type, Swindow_cursor_type,
+       0, 1, 0,
+       doc: /* Return the `cursor-type' of WINDOW.
+WINDOW must be a live window and defaults to the selected one.  */)
+  (Lisp_Object window)
+{
+  return decode_live_window (window)->cursor_type;
+}
 
 
 /***********************************************************************
@@ -8976,4 +9004,6 @@ syms_of_window (void)
   defsubr (&Swindow_parameters);
   defsubr (&Swindow_parameter);
   defsubr (&Sset_window_parameter);
+  defsubr (&Swindow_cursor_type);
+  defsubr (&Sset_window_cursor_type);
 }
diff --git a/src/window.h b/src/window.h
index 19283725931..297f3c66044 100644
--- a/src/window.h
+++ b/src/window.h
@@ -323,6 +323,9 @@ #define WINDOW_H_INCLUDED
        as the normal may yield a matrix which is too small.  */
     int nrows_scale_factor, ncols_scale_factor;
 
+    /* `cursor-type' to use in this window.  */
+    Lisp_Object cursor_type;
+
     /* Intended cursor position.   This is a position within the
        glyph matrix.  */
     struct cursor_pos cursor;
@@ -542,6 +545,12 @@ wset_horizontal_scroll_bar_type (struct window *w, Lisp_Object val)
   w->horizontal_scroll_bar_type = val;
 }
 
+INLINE void
+wset_cursor_type (struct window *w, Lisp_Object val)
+{
+  w->cursor_type = val;
+}
+
 INLINE void
 wset_prev_buffers (struct window *w, Lisp_Object val)
 {
diff --git a/src/xdisp.c b/src/xdisp.c
index 85802ec5083..24d0c090326 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -33617,7 +33617,9 @@ get_window_cursor_type (struct window *w, struct glyph *glyph, int *width,
     {
       if (w == XWINDOW (echo_area_window))
 	{
-	  if (EQ (BVAR (b, cursor_type), Qt) || NILP (BVAR (b, cursor_type)))
+	  if (!EQ (Qt, w->cursor_type))
+	      return get_specified_cursor_type (w->cursor_type, width);
+	  else if (EQ (BVAR (b, cursor_type), Qt) || NILP (BVAR (b, cursor_type)))
 	    {
 	      *width = FRAME_CURSOR_WIDTH (f);
 	      return FRAME_DESIRED_CURSOR (f);
@@ -33644,18 +33646,23 @@ get_window_cursor_type (struct window *w, struct glyph *glyph, int *width,
       non_selected = true;
     }
 
-  /* Never display a cursor in a window in which cursor-type is nil.  */
-  if (NILP (BVAR (b, cursor_type)))
-    return NO_CURSOR;
-
-  /* Get the normal cursor type for this window.  */
-  if (EQ (BVAR (b, cursor_type), Qt))
+  if (!EQ (Qt, w->cursor_type))
+      cursor_type = get_specified_cursor_type (w->cursor_type, width);
+  else
     {
-      cursor_type = FRAME_DESIRED_CURSOR (f);
-      *width = FRAME_CURSOR_WIDTH (f);
+      /* Never display a cursor in a window in which cursor-type is nil.  */
+      if (NILP (BVAR (b, cursor_type)))
+	return NO_CURSOR;
+
+      /* Get the normal cursor type for this window.  */
+      if (EQ (BVAR (b, cursor_type), Qt))
+	{
+	  cursor_type = FRAME_DESIRED_CURSOR (f);
+	  *width = FRAME_CURSOR_WIDTH (f);
+	}
+      else
+	cursor_type = get_specified_cursor_type (BVAR (b, cursor_type), width);
     }
-  else
-    cursor_type = get_specified_cursor_type (BVAR (b, cursor_type), width);
 
   /* Use cursor-in-non-selected-windows instead
      for non-selected window or frame.  */
-- 
2.45.0


--=-=-=--




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

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


Received: (at 70622) by debbugs.gnu.org; 9 May 2024 07:45:07 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu May 09 03:45:06 2024
Received: from localhost ([127.0.0.1]:53751 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1s4ySg-00021f-ED
	for submit <at> debbugs.gnu.org; Thu, 09 May 2024 03:45:06 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:51286)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1s4ySd-0001hc-NA
 for 70622 <at> debbugs.gnu.org; Thu, 09 May 2024 03:45: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 1s4yS7-0007GY-Kt; Thu, 09 May 2024 03:44:31 -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=aBApUGBa0jfUXWVNJPzHzTYC2cF6Nj/6yPUB1ot4dwA=; b=AoQLgESX7weV
 odGnhZ/MbcsoDnHmyfngmH0OZ7NIx09+b9e5h5EIQldbkvqWlV29cDKXH9cfQLvo8D+ugRvBimElc
 C90GZt3EBGWE45UEXzBC45q341jMEFQ/4cEx9JwQY/TDlzuquFoJ8AHrZ01F4fKkD2QETwu6Nx3yb
 nQbpbX6N7Qi69Kcj2WP/fsnOVLrxOIH/ChNZsyVLxvODit5C3zZEatKR/50Mt3XlShAhaEGIA2aPg
 ccof3MvN7ff52MDDyiNOcorMGxz0l789QYnuxn2xZSq9hVVYk8uyPexGSPegV8y0kr+tmMKxojMJo
 NPo3ZuIYFyAbumfov44AMA==;
Date: Thu, 09 May 2024 10:44:30 +0300
Message-Id: <86jzk377kx.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: me@HIDDEN
In-Reply-To: <867cgfqcbn.fsf@HIDDEN> (message from Eli Zaretskii on Tue, 30
 Apr 2024 15:12:12 +0300)
Subject: Re: bug#70622: [PATCH] New window parameter 'cursor-type'
References: <m1il02ypau.fsf@HIDDEN> <864jbmuf39.fsf@HIDDEN>
 <m1zftdr0q6.fsf@HIDDEN> <8634r5tsit.fsf@HIDDEN>
 <m1sez5paso.fsf@HIDDEN> <86y18wsmqy.fsf@HIDDEN>
 <m1jzkg60py.fsf@HIDDEN> <86cyq8sfif.fsf@HIDDEN>
 <0519d8d8-2a3d-411a-a5bb-b556e0fb86db@HIDDEN> <868r0ws9u1.fsf@HIDDEN>
 <ca3fb469-127b-462c-856d-8da266db8e76@HIDDEN> <867cgfqcbn.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 70622
Cc: rudalics@HIDDEN, 70622 <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 (---)

> Cc: me@HIDDEN, 70622 <at> debbugs.gnu.org
> Date: Tue, 30 Apr 2024 15:12:12 +0300
> From: Eli Zaretskii <eliz@HIDDEN>
> 
> > Date: Tue, 30 Apr 2024 11:03:44 +0200
> > Cc: me@HIDDEN, 70622 <at> debbugs.gnu.org
> > From: martin rudalics <rudalics@HIDDEN>
> > 
> >  > So that cursor-type is no longer a window-parameter?
> > 
> > Yes.  IIUC it would mean that we have to initialize the cursor_type slot
> > of a new window to t.  With the window parameter solution one would have
> > to add a new 'cursor-type' parameter with a value of t whenever making a
> > new window.  This would break with the convention that non-nil window
> > parameters are used for handling "special" behaviors only.
> 
> I'm fine with this approach, thanks.  It will also solve nicely the
> problem of redisplaying the affected window ASAP.

Eshel, could you please update your patch along these lines?

Thanks.




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

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


Received: (at 70622) by debbugs.gnu.org; 30 Apr 2024 12:12:52 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Apr 30 08:12:52 2024
Received: from localhost ([127.0.0.1]:59410 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1s1mLs-0002cY-62
	for submit <at> debbugs.gnu.org; Tue, 30 Apr 2024 08:12:52 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:38048)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1s1mLp-0002cM-Ol
 for 70622 <at> debbugs.gnu.org; Tue, 30 Apr 2024 08:12:50 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1s1mLP-0007Xo-9M; Tue, 30 Apr 2024 08:12: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=pbU0/tjLWz3YLWJPLf9UBLDSuoa5fnXfBYOidk8AOYw=; b=O6lFx5ewDRsQ
 7KEr6CuYHItoJ25AwLmmwKRH1fEi7PnNwoKMCpEvULIAkwgQ5oBoTz/AIvM1RWjTKeYSOHD0ozdot
 8CkNdX6Ub1H6NWPfdB3k2a8pBH6T8yHNSeScmzrZQ9RwB6SVD7rwV94A9+vfEQ5wGAdO7fSrd8E2y
 Tm960RU5s668Up+dZUDknkWAM26roiAd4auvcXNpivj/+b9kGVVbRMoEUYGoq0FgSSlq74OakIn4j
 3rx2qelMPKWF5vYNFBUzX5X/jWYkNxOlstAIv1nJJWclSHbKPUSCVLVgO17dHMlJa6U3xMrJWSAKW
 zYXjqZs6sviJBc9qC/SE5A==;
Date: Tue, 30 Apr 2024 15:12:12 +0300
Message-Id: <867cgfqcbn.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: martin rudalics <rudalics@HIDDEN>
In-Reply-To: <ca3fb469-127b-462c-856d-8da266db8e76@HIDDEN> (message from
 martin rudalics on Tue, 30 Apr 2024 11:03:44 +0200)
Subject: Re: bug#70622: [PATCH] New window parameter 'cursor-type'
References: <m1il02ypau.fsf@HIDDEN> <864jbmuf39.fsf@HIDDEN>
 <m1zftdr0q6.fsf@HIDDEN> <8634r5tsit.fsf@HIDDEN>
 <m1sez5paso.fsf@HIDDEN> <86y18wsmqy.fsf@HIDDEN>
 <m1jzkg60py.fsf@HIDDEN> <86cyq8sfif.fsf@HIDDEN>
 <0519d8d8-2a3d-411a-a5bb-b556e0fb86db@HIDDEN> <868r0ws9u1.fsf@HIDDEN>
 <ca3fb469-127b-462c-856d-8da266db8e76@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 70622
Cc: me@HIDDEN, 70622 <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: Tue, 30 Apr 2024 11:03:44 +0200
> Cc: me@HIDDEN, 70622 <at> debbugs.gnu.org
> From: martin rudalics <rudalics@HIDDEN>
> 
>  > So that cursor-type is no longer a window-parameter?
> 
> Yes.  IIUC it would mean that we have to initialize the cursor_type slot
> of a new window to t.  With the window parameter solution one would have
> to add a new 'cursor-type' parameter with a value of t whenever making a
> new window.  This would break with the convention that non-nil window
> parameters are used for handling "special" behaviors only.

I'm fine with this approach, thanks.  It will also solve nicely the
problem of redisplaying the affected window ASAP.




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

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


Received: (at 70622) by debbugs.gnu.org; 30 Apr 2024 09:04:18 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Apr 30 05:04:17 2024
Received: from localhost ([127.0.0.1]:59239 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1s1jPN-00060l-KC
	for submit <at> debbugs.gnu.org; Tue, 30 Apr 2024 05:04:17 -0400
Received: from mout.gmx.net ([212.227.15.19]:59253)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <rudalics@HIDDEN>) id 1s1jPJ-00060d-Os
 for 70622 <at> debbugs.gnu.org; Tue, 30 Apr 2024 05:04:16 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.at;
 s=s31663417; t=1714467825; x=1715072625; i=rudalics@HIDDEN;
 bh=/Tq09t1soMp++ihpJwjLUax6IhXM6hbOuAbDKX+kCM4=;
 h=X-UI-Sender-Class:Message-ID:Date:MIME-Version:Subject:To:Cc:
 References:From:In-Reply-To:Content-Type:
 Content-Transfer-Encoding:cc:content-transfer-encoding:
 content-type:date:from:message-id:mime-version:reply-to:subject:
 to;
 b=innLaMmGLi1vFZj9+hOmtXnIgCNIX1lyyGYhgexxaBSZ1oEP2Fun9wSVdam/fs1g
 VM64keOJnbXLYN9Ptp+M5y/9L+yjn29m4IytgBoSytfgpignajxq6RmnLRFJ4K3ts
 wDy+dQLmwVXmRiEH2Gxta018WFjkumBFur/XCmQICo/5ht0h92YyX3F0WQZdu9Kn5
 QDggXpY4rAEYjnc51cDNDCc69m2lgUd5pRlpXrAsWW/E7ETByn7QI0Ko2LL5LNNwe
 7z7keBE29Uea/aZpi+Er2qrGB2qJa+a7uk5+cpS3KZfx7KAfquaJYt2K6x8QYfUO6
 EMoliLj6Par3hPe7nQ==
X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a
Received: from [192.168.31.113] ([46.125.249.78]) by mail.gmx.net (mrgmx005
 [212.227.17.190]) with ESMTPSA (Nemesis) id 1Mj8mV-1sXkhA0Us9-00fEGE; Tue, 30
 Apr 2024 11:03:45 +0200
Message-ID: <ca3fb469-127b-462c-856d-8da266db8e76@HIDDEN>
Date: Tue, 30 Apr 2024 11:03:44 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: bug#70622: [PATCH] New window parameter 'cursor-type'
To: Eli Zaretskii <eliz@HIDDEN>
References: <m1il02ypau.fsf@HIDDEN> <864jbmuf39.fsf@HIDDEN>
 <m1zftdr0q6.fsf@HIDDEN> <8634r5tsit.fsf@HIDDEN>
 <m1sez5paso.fsf@HIDDEN> <86y18wsmqy.fsf@HIDDEN>
 <m1jzkg60py.fsf@HIDDEN> <86cyq8sfif.fsf@HIDDEN>
 <0519d8d8-2a3d-411a-a5bb-b556e0fb86db@HIDDEN> <868r0ws9u1.fsf@HIDDEN>
Content-Language: en-US
From: martin rudalics <rudalics@HIDDEN>
In-Reply-To: <868r0ws9u1.fsf@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Provags-ID: V03:K1:H63VWaWOEH1KUEdyH7dEn91DO49g7mN73jmhtdH8ffFskUDvSHT
 1MjKKH39nhvkF1EeExKGN2tgsXKDDMG+ehnUhrDrp/ogHsVT6nt/yehi23Tq2v2zOYdfFoO
 RTPwsrUjWx1F7G6JRpxuQ1gVkj3CtqG669QV+5IEP7NDv8FHdmafx2vsg3VsanZ/lbMseUY
 XKIsXTwA6fYF9r/OT/7pw==
X-Spam-Flag: NO
UI-OutboundReport: notjunk:1;M01:P0:7sO0lPPk14o=;hSR5gU8syaUgdpJlj3UaGEB0i3U
 uG9T3zuNEPSo1G4EyQYUpiMw/CHC/52scfHPK63T80o7w8LRC+BH4+nJL91ozxt0B8mD3tE7e
 63A6Owius9ShoANw/P1ryfmF+jrtpcQSah/faafafg5/AKHzchS2ESqOknCKX5tdYo2/+YZBl
 xTrBOoDh4XfXdqXLzTv/mgAWBERSCUfVu0LRzCz2vx1uYk8bF2ZiOq1lQzEVDy0Plb3Sb49XG
 X6tTgKOmS8E2d2nntNJY4NEBgcLmNDh5ocTH873aOJpub2jO9TbCRStWOSGRLO1NsnwgyOc4Q
 oiQd+i/M3l3j2THSWFCp7MO1/11TwDzKRj7CLFyGY2ozgiYrYrC6par8+6Dpb0XGze5lTn97f
 bhEtZ4oEU3M56wPhfzdfD160sTotFDeemuRXU2Ir/7R/ZxJ6ACOvJ278qQr0MEEQVvV0+yldn
 NOhonAFvOT+dnfQOHBdecXT+yHUSkFz5Cl0M0iiNain4SSHH74NF5gjSDiL1bPj4rkmSqP79H
 2MRdO+OdIt0csntkW7WoIrxvpNW+yxAtHqJzrnBZKdbCWcc/4wa5kLTkMMVWmKPasTIjEI1Ke
 Oq/WWRxnZ3AD4ZV5e4IXdjBDWsID8GNPBfDvICZ7bvrFQatWtZNVOYW2Cnl3k+JFSvaPH+411
 DYL4yd/6NFFOX6e3Oj8wDDHhTQEQXOPSjul2gLC0Epsd5G+dm5xNv6IBx2btosbdTf8mYPbOl
 /z2oDMOa7CCMRLAfU914p9TurUrEVwPNqIdG+k69g/JH9QWQx75UuYGJSn1od9HNypdKkRonm
 2r8DvC+L2lt4vABB2a31REgifh+I6BiWcqQGq88AigLD4=
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 70622
Cc: me@HIDDEN, 70622 <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 (-)

 > So that cursor-type is no longer a window-parameter?

Yes.  IIUC it would mean that we have to initialize the cursor_type slot
of a new window to t.  With the window parameter solution one would have
to add a new 'cursor-type' parameter with a value of t whenever making a
new window.  This would break with the convention that non-nil window
parameters are used for handling "special" behaviors only.

martin




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

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


Received: (at 70622) by debbugs.gnu.org; 29 Apr 2024 11:11:27 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Apr 29 07:11:27 2024
Received: from localhost ([127.0.0.1]:56627 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1s1Out-0006eR-2c
	for submit <at> debbugs.gnu.org; Mon, 29 Apr 2024 07:11:27 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:34068)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1s1Ouo-0006eB-69
 for 70622 <at> debbugs.gnu.org; Mon, 29 Apr 2024 07:11:25 -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 1s1OuO-0001Ma-AO; Mon, 29 Apr 2024 07:10:56 -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=FVdY7KmJiHHIfnt1wMyQPtNEqJfw8r2/R1QdMYYFVFg=; b=IHnQqUnUvRHr
 1P373Ye1PO+VsEQchSSYQk+eHIL/Gz9dyGbxEu2PFnU+IN6BUjcqS4/4uVlZaCskGoU3Yu/dEG1VD
 vToctHH0G5LJSsYHh2nTsybnKaEd3/tz4gdy2eEpmGrCnnpDv3mfjQ9thbiPdcmfxPmn3WchuvLGD
 Tqg6tmXomciGdmo8+k0JavGr5Zjn6eVSwfZU0VAkw8ZhktpCcNGvAUuRDxBhDiTX5ZBZPE7hddwCV
 0v8sKYxJym4MOufKyQ8Xhdu9lfbgLEferKez4jTCS1IMLc2m6Jn5wVa6e1ytPwxf8G02/MHJmPSfd
 nwQcXHDpdddte9Rl89IjhQ==;
Date: Mon, 29 Apr 2024 14:10:46 +0300
Message-Id: <868r0ws9u1.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: martin rudalics <rudalics@HIDDEN>
In-Reply-To: <0519d8d8-2a3d-411a-a5bb-b556e0fb86db@HIDDEN> (message from
 martin rudalics on Mon, 29 Apr 2024 11:48:19 +0200)
Subject: Re: bug#70622: [PATCH] New window parameter 'cursor-type'
References: <m1il02ypau.fsf@HIDDEN> <864jbmuf39.fsf@HIDDEN>
 <m1zftdr0q6.fsf@HIDDEN> <8634r5tsit.fsf@HIDDEN>
 <m1sez5paso.fsf@HIDDEN> <86y18wsmqy.fsf@HIDDEN>
 <m1jzkg60py.fsf@HIDDEN> <86cyq8sfif.fsf@HIDDEN>
 <0519d8d8-2a3d-411a-a5bb-b556e0fb86db@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 70622
Cc: me@HIDDEN, 70622 <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: Mon, 29 Apr 2024 11:48:19 +0200
> Cc: 70622 <at> debbugs.gnu.org
> From: martin rudalics <rudalics@HIDDEN>
> 
>  >> Here the window parameter has the same set of possible values as the
>  >> variable, except the window parameter also has the value 'none, which
>  >> corresponds to the variable's nil value.  The nil value of the window
>  >> parameter means "window parameter not set".
>  >
>  > If this is unavoidable (which I'm not yet sure), we can use this.  But
>  > let's first hear from Martin, maybe there are better ideas.
> 
> Since I'm responsible for the 'none' convention (which I dislike) I have
> no better ideas.  Would it help to make cursor_type a slot in the window
> structure and provide a 'set-window-cursor-type' function?

So that cursor-type is no longer a window-parameter?




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

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


Received: (at 70622) by debbugs.gnu.org; 29 Apr 2024 09:48:52 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Apr 29 05:48:52 2024
Received: from localhost ([127.0.0.1]:56234 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1s1Ncy-0005a1-1i
	for submit <at> debbugs.gnu.org; Mon, 29 Apr 2024 05:48:52 -0400
Received: from mout.gmx.net ([212.227.17.20]:35579)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <rudalics@HIDDEN>) id 1s1Ncv-0005ZP-HH
 for 70622 <at> debbugs.gnu.org; Mon, 29 Apr 2024 05:48:50 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.at;
 s=s31663417; t=1714384102; x=1714988902; i=rudalics@HIDDEN;
 bh=a3YgOue9JOlrmGMnuJ+iP2lAQnmRRVZki9JSv/YXPOk=;
 h=X-UI-Sender-Class:Message-ID:Date:MIME-Version:Subject:To:Cc:
 References:From:In-Reply-To:Content-Type:
 Content-Transfer-Encoding:cc:content-transfer-encoding:
 content-type:date:from:message-id:mime-version:reply-to:subject:
 to;
 b=Xi5JLqLKnWn25u3NNtZYy8QZ4YxbauBxX8cCFNaDswPj7SixfUEcV13NYsh+etb7
 BdMIBEfEIiswMAKHSkA5Sn1H6HoaKmGxZP0V3Ax8dBtxCqxZ6iMzS1SKpzec5oCUj
 DcfozlSZAKExZpzhTgCXpRN08PuGXjRtiukYfJftkQTEIyB8OkA6ntsrh7QbyEPU2
 Q7xqdFkwK3YkXtW/KTGHr5ZNzXQgOrlgAvC0ub5KIQnXRHgNCegLBoef9XDaAzrdU
 Xh1CA+ZvMXbQh3yRvjIgWjcS8+qe2kxWisoVVsXWt8P2duOEkrEYysJpoEXkxLCIq
 IpcKrVAmpaW64XPYgg==
X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a
Received: from [192.168.31.113] ([212.95.5.32]) by mail.gmx.net (mrgmx105
 [212.227.17.168]) with ESMTPSA (Nemesis) id 1N7QxB-1skF0F0H2z-017ipu; Mon, 29
 Apr 2024 11:48:22 +0200
Message-ID: <0519d8d8-2a3d-411a-a5bb-b556e0fb86db@HIDDEN>
Date: Mon, 29 Apr 2024 11:48:19 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: bug#70622: [PATCH] New window parameter 'cursor-type'
To: Eli Zaretskii <eliz@HIDDEN>, Eshel Yaron <me@HIDDEN>
References: <m1il02ypau.fsf@HIDDEN> <864jbmuf39.fsf@HIDDEN>
 <m1zftdr0q6.fsf@HIDDEN> <8634r5tsit.fsf@HIDDEN>
 <m1sez5paso.fsf@HIDDEN> <86y18wsmqy.fsf@HIDDEN>
 <m1jzkg60py.fsf@HIDDEN> <86cyq8sfif.fsf@HIDDEN>
Content-Language: en-US
From: martin rudalics <rudalics@HIDDEN>
In-Reply-To: <86cyq8sfif.fsf@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Provags-ID: V03:K1:IUTK6xGLZJuBljgUufUdqfwWXJU0qdBdm/TaClxdHxkcuWmJJuw
 07PiOZuJ/Tw/vmMI0pzCz6WywRQWdA2RrLupqJ1TT8ugtcvX+aqb+2LNYn32KxUhYBMnEQi
 +wMheUcZlqS0BJSB9wwj+cOJbzkuAPSyyoCSnobPg/xtVCoAEm9nOp/uqv4XCOEyzc0y7g4
 cXR/cmuhRXVedSKUnWQAQ==
X-Spam-Flag: NO
UI-OutboundReport: notjunk:1;M01:P0:x6gOlRWnlJw=;Gh1kYlr8KtiiIzJfazcRGjdIFqo
 goKVm6HN4/We6wLa8la420WtjEMYJBOYRwIcEYr4dVJNs47FI4UkgyQ6k96Igz8VtN9CgiVGn
 sMuP5X06a1yAQl6c/Q20oFktxoVoL4LX7qjW329G41IsiQbrGfTtHM3L0BXHDlcki7Co3MCEf
 Th0yykwN0ZDZQof4WJ+P3ZiKHIIcguxjPOgebRYbYNA0wA5yUchx3YLh+uIuFGbyhLt0aip7b
 BoCE2Ce3axdyEIn8N4zXxdZFvj0oAAMXyIq5d/vfE5IqXkDVaIJGyACNsJXdOScEA1xUrMFnA
 5ZmcLMXKwYHiR917KenFNvPc2vZEtZERgr0immtx0RHfzRjjnjUgNYzwriOvg8wvt+qmNKPRD
 zCMp2kFofdkm+2GOwJVWclJTBiPqjNfP0M+7uKB/B/5s1oL9FDpK9jUaIFHY0IGeglTkjxfqb
 NR4fRDggzEzLkgeSVjjfS9EXNnmPNWJk+dt/hwLNE20rTfdWMyCHwhqLDadQn9SMdo2nQGRFw
 GeGrPlpkrIkE+ZBLdGUwwzaZGrCebUuznTbw/JgLTbh6Qrl6td1T4Vq3Kha6r2NxQWF6DQgSP
 qys/GwrwMoxJiHldcBasbbW5XhyIVN3bIZ6xfl7HF6I6N3iA31brnDpsoZOdQOTUDi39ydn4f
 2ZwMsH8RrpemRD2veIcA5CMg3grSZvQDGmvOdJQ2J9zPcw7NQ0biJoqvX0moV3ekizTlEVzE2
 5IyCLrvoQmvrAAuf/TcdfqE7gk1TLEkK1TrbBcNoa6NxUzg9Xrio4sTHQpf7k3cB9ji6DLjLm
 srJvSYTwz4HaQXsPeneQesaan5DYQ2J2Ti1BMc1LH6bdOMlBCwS+zsGf/HxURo6Fex
X-Spam-Score: 2.9 (++)
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:  >> Here the window parameter has the same set of possible
 values as the >> variable, except the window parameter also has the value
 'none, which >> corresponds to the variable's nil value. The nil va [...]
 Content analysis details:   (2.9 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -0.0 RCVD_IN_MSPIKE_H2      RBL: Average reputation (+2)
 [212.227.17.20 listed in wl.mailspike.net]
 -0.7 RCVD_IN_DNSWL_LOW      RBL: Sender listed at https://www.dnswl.org/,
 low trust [212.227.17.20 listed in list.dnswl.org]
 3.6 RCVD_IN_SBL_CSS        RBL: Received via a relay in Spamhaus SBL-CSS
 [212.95.5.32 listed in zen.spamhaus.org]
 -0.0 SPF_PASS               SPF: sender matches SPF record
 0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 0.0 FREEMAIL_FROM          Sender email is commonly abused enduser mail
 provider (rudalics[at]gmx.at)
X-Debbugs-Envelope-To: 70622
Cc: 70622 <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.9 (+)
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:  >> Here the window parameter has the same set of possible
    values as the >> variable, except the window parameter also has the value
    'none, which >> corresponds to the variable's nil value. The nil va [...]
    
 
 Content analysis details:   (1.9 points, 10.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -0.0 RCVD_IN_MSPIKE_H2      RBL: Average reputation (+2)
                             [212.227.17.20 listed in wl.mailspike.net]
 -0.7 RCVD_IN_DNSWL_LOW      RBL: Sender listed at https://www.dnswl.org/,
                             low trust
                             [212.227.17.20 listed in list.dnswl.org]
  3.6 RCVD_IN_SBL_CSS        RBL: Received via a relay in Spamhaus SBL-CSS
                             [212.95.5.32 listed in zen.spamhaus.org]
 -0.0 SPF_PASS               SPF: sender matches SPF record
  0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
  0.0 FREEMAIL_FROM          Sender email is commonly abused enduser mail
                             provider (rudalics[at]gmx.at)
 -1.0 MAILING_LIST_MULTI     Multiple indicators imply a widely-seen list
                             manager

 >> Here the window parameter has the same set of possible values as the
 >> variable, except the window parameter also has the value 'none, which
 >> corresponds to the variable's nil value.  The nil value of the window
 >> parameter means "window parameter not set".
 >
 > If this is unavoidable (which I'm not yet sure), we can use this.  But
 > let's first hear from Martin, maybe there are better ideas.

Since I'm responsible for the 'none' convention (which I dislike) I have
no better ideas.  Would it help to make cursor_type a slot in the window
structure and provide a 'set-window-cursor-type' function?

martin




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

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


Received: (at 70622) by debbugs.gnu.org; 29 Apr 2024 09:48:40 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Apr 29 05:48:40 2024
Received: from localhost ([127.0.0.1]:56229 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1s1Ncl-0005Yw-It
	for submit <at> debbugs.gnu.org; Mon, 29 Apr 2024 05:48:39 -0400
Received: from mout.gmx.net ([212.227.17.20]:50037)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <rudalics@HIDDEN>) id 1s1Ncj-0005YI-Fx
 for 70622 <at> debbugs.gnu.org; Mon, 29 Apr 2024 05:48:38 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.at;
 s=s31663417; t=1714384089; x=1714988889; i=rudalics@HIDDEN;
 bh=htAUV2Kv5m0/JiodBWlvmF0FK8rxO9uJieuTrMNZPjg=;
 h=X-UI-Sender-Class:Message-ID:Date:MIME-Version:Subject:To:Cc:
 References:From:In-Reply-To:Content-Type:
 Content-Transfer-Encoding:cc:content-transfer-encoding:
 content-type:date:from:message-id:mime-version:reply-to:subject:
 to;
 b=jOE2GvahcwdBhtR84nrQssbjiR8BHLxz9mMK1Mi26JjmbtS2VZCw3xu2G9PGaK6g
 CvKT/O/1uN36H6D1eRjcz/rKU0Ps4KuSsoetWl54HhFyN2t+WXNnDHIeU+lq9ATV0
 hTiOqqH/X7i85EgsMTFZcbZSopM5insNHEPq+k0+gPYVKruMgg+WB8B/wsZOCQMXG
 32QwiAwvKwleDI2VrsRaCJHuCIi0+zVd82K1HJTTu6XLFEj50nJ6l1BvbK27/JDSD
 i/+Hp0lieLeNaIraqeEoAF0Ut8MY1dZLzY9MaOX4WjPwnmgx2dVE8710+yBVzW87B
 tAJxJFOzt5QAqr6eTQ==
X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a
Received: from [192.168.31.113] ([212.95.5.32]) by mail.gmx.net (mrgmx104
 [212.227.17.168]) with ESMTPSA (Nemesis) id 1M3lcJ-1s0Yfa1RyN-001V9R; Mon, 29
 Apr 2024 11:48:09 +0200
Message-ID: <250a655e-58b1-406e-9d3b-28b395e8e243@HIDDEN>
Date: Mon, 29 Apr 2024 11:48:07 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: bug#70622: [PATCH] New window parameter 'cursor-type'
To: Eli Zaretskii <eliz@HIDDEN>, Eshel Yaron <me@HIDDEN>
References: <m1il02ypau.fsf@HIDDEN> <864jbmuf39.fsf@HIDDEN>
 <m1zftdr0q6.fsf@HIDDEN> <8634r5tsit.fsf@HIDDEN>
Content-Language: en-US
From: martin rudalics <rudalics@HIDDEN>
In-Reply-To: <8634r5tsit.fsf@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Provags-ID: V03:K1:f4xbDRmQuo6H2ClLK7JG1lZsIK8P2EYZVddPc6UhoSin1oUMa21
 wFMcjHpqbTohgOgJ8dN2gCp/AF5Lzv867y6yzfdBFV1KtiZgzUXITIQjsON/6vi8wAL+VCJ
 in8xvIznC2XjUWCDSYijG+vkbGK6TizZJ+ZgPUbfgzZ5K89Q/X+Cp/tQsrLvZ0S8HEH2aZN
 VB/0cmGnBAYlkDynTIvsg==
X-Spam-Flag: NO
UI-OutboundReport: notjunk:1;M01:P0:Aod8NmCeGjA=;0qA4sxzymSmeJIml8KnMncsZFVi
 hwLNjI/PoLdYxPoWsXZb2tiIkUbTzbTk5SfyhBbqJKyYIRZjruW9siKT5vmQX6sdYpyq5ms46
 0jPY9dw3yRXKNCzRWOP9JbUj4e3NgMdvFwyH9b99Hjz8dodTSI8Jb2tbmNnb/P8fxPF0xqoq2
 tnR4XBLoJO+THDTaFSOcLesg/Z2lMzsWIfMQ92FPrDFj5PVhmqSUgmjgMk3IZrWLa53kXLyuL
 2bawlhp2n2LEr7CT4p/c3i/pT9XSHWWtAOs9COGMVReTEgI/4ModSM+V7cOPzfBNnG5UclPJA
 BMcoueBvQAyod9VrIzcaeJtY/ropiQhH35vpZf8/nrQrVKjMHAFdQokevSjiY3Rp5n0uck/bm
 PrkijgsXZAFJdpBco6dgUdwF1PxMZOrdiFvFs3EayX4uXqQzx+N1HZcLcyOg4iiNtzrc/ukwc
 rMG2nyNI6aeRSi0UqiHrOvMmbk1+FDM2vcbJCqMK6cMSpJpqtRnREmfEFq7wW8sHqo9HRtKTr
 hVYVbjfx5zpn6FPTjifh6EJBonPEP2rN0t92IeDNh43VHUOLh/k6ZMQQMtLK7bnLTFnwNEAhS
 npybNvOffOzO/RJ98zSaN1PjupMZJfShMONlBCgSW12BPYR2WXliQ6O2eSUo0JbVdFSZivytr
 B4xmT0l1hO2N9ddFHrp76FJDQ02GYFa3xDJwjOG/BnPOha0ChQ5sJbV8fX0jZoVUghhgd3ZRP
 0w/lNPTbcb2pSrqsrfG6pWBpLjdufPECd3dqUjxMapv7WGGqaDHEXZp3SCMLI/G0GoAIY8pIU
 MXubrROhfh+EuLicDZ69DCFvZBHRxebot59ynTlOPaoc3Xd8N2BooQUx5pWTkryihU
X-Spam-Score: 2.9 (++)
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:  >> WRT cursor-in-non-selected-windows, I think >> there are
 two viable options: >> >> 1. Give cursor-in-non-selected-windows precedence
 over the new window >> parameter, and add another window parame [...] 
 Content analysis details:   (2.9 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -0.0 RCVD_IN_MSPIKE_H2      RBL: Average reputation (+2)
 [212.227.17.20 listed in wl.mailspike.net]
 -0.7 RCVD_IN_DNSWL_LOW      RBL: Sender listed at https://www.dnswl.org/,
 low trust [212.227.17.20 listed in list.dnswl.org]
 3.6 RCVD_IN_SBL_CSS        RBL: Received via a relay in Spamhaus SBL-CSS
 [212.95.5.32 listed in zen.spamhaus.org]
 -0.0 SPF_PASS               SPF: sender matches SPF record
 0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 0.0 FREEMAIL_FROM          Sender email is commonly abused enduser mail
 provider (rudalics[at]gmx.at)
X-Debbugs-Envelope-To: 70622
Cc: 70622 <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.9 (+)
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:  >> WRT cursor-in-non-selected-windows, I think >> there are
    two viable options: >> >> 1. Give cursor-in-non-selected-windows precedence
    over the new window >> parameter, and add another window parame [...] 
 
 Content analysis details:   (1.9 points, 10.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -0.0 RCVD_IN_MSPIKE_H2      RBL: Average reputation (+2)
                             [212.227.17.20 listed in wl.mailspike.net]
 -0.7 RCVD_IN_DNSWL_LOW      RBL: Sender listed at https://www.dnswl.org/,
                             low trust
                             [212.227.17.20 listed in list.dnswl.org]
  3.6 RCVD_IN_SBL_CSS        RBL: Received via a relay in Spamhaus SBL-CSS
                             [212.95.5.32 listed in zen.spamhaus.org]
 -0.0 SPF_PASS               SPF: sender matches SPF record
  0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
  0.0 FREEMAIL_FROM          Sender email is commonly abused enduser mail
                             provider (rudalics[at]gmx.at)
 -1.0 MAILING_LIST_MULTI     Multiple indicators imply a widely-seen list
                             manager

 >> WRT cursor-in-non-selected-windows, I think
 >> there are two viable options:
 >>
 >> 1. Give cursor-in-non-selected-windows precedence over the new window
 >>     parameter, and add another window parameter to override
 >>     cursor-in-non-selected-windows.
 >> 2. Give the new window parameter precedence also over
 >>     cursor-in-non-selected-windows.
 >>
 >> In the updated patch, I went with option 2, so if you set the
 >> cursor-type window parameter, that overrides any buffer-local variable,
 >> whether or not the window is selected.  I think that's sensible enough,
 >> WDYT?
 >
 > I tend to think option 1 is better, but I'm curious what others think.
 > Martin, WDYT?

I'd give 'cursor-in-non-selected-windows' precedence over the new window
parameter and not add another window parameter to override it.  IIUC
that's what a buffer-local value of 'cursor-in-non-selected-windows'
currently does to a 'cursor-type' frame parameter.

 >> Not necessarily.  In cases where we want to ensure the cursor is redrawn
 >> immediately in a non-selected window, we can use force-window-update
 >> after setting the window parameter.  Should that be mentioned in the
 >> documentation as well?
 >
 > I think it would be better to make sure the parameter takes effect
 > immediately.  Documenting the force-window-update thing should be
 > fallback, if the immediate effect is impossible.

I think 'set-window-parameter' should handle 'cursor-type' specially -
when it changes, it should set that window's redisplay flag.

martin




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

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


Received: (at 70622) by debbugs.gnu.org; 29 Apr 2024 09:08:50 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Apr 29 05:08:50 2024
Received: from localhost ([127.0.0.1]:56069 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1s1N0E-0005CJ-5k
	for submit <at> debbugs.gnu.org; Mon, 29 Apr 2024 05:08:50 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:56042)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1s1N0C-0005CD-1Z
 for 70622 <at> debbugs.gnu.org; Mon, 29 Apr 2024 05:08:48 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1s1Mzm-0001FN-3Y; Mon, 29 Apr 2024 05:08:22 -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=Q5J5Bf5cqq4/cmARKJ6elQYBErdf10/WkHoau9sCvWE=; b=jqJwSJsmGpRX12cAsgtT
 6w6CoIMeTvlX7xnSKiVQptE66g2rgXkDWgcCHD6CwBc5w1ab5At401F2qgte9wRTgNzZTVhvqbzFY
 PCucbXs/60gGNUHK4fFYk25qAbVz/o6cCBSVEIWP825mfIhkCD35iCzZ5MqpcNEilVEmZ5tL9W4Ke
 XK5qmbPRMGHcn7jgNbdltctr28lSp/MnMEpHKyjRfRzLOznmYPD5+dkkxQiiJx1+wfqCJxvMk3gVM
 PHzCMulFdEwTbFmzdxGHFqIaojId/2wWgOlHe8MrEhSY6jDZRe97cLW/sV+hw824Bd59jvWeh4T6m
 9UizGK3KD4wUxw==;
Date: Mon, 29 Apr 2024 12:08:08 +0300
Message-Id: <86cyq8sfif.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Eshel Yaron <me@HIDDEN>
In-Reply-To: <m1jzkg60py.fsf@HIDDEN> (message from Eshel Yaron on Mon, 
 29 Apr 2024 10:18:33 +0200)
Subject: Re: bug#70622: [PATCH] New window parameter 'cursor-type'
References: <m1il02ypau.fsf@HIDDEN> <864jbmuf39.fsf@HIDDEN>
 <m1zftdr0q6.fsf@HIDDEN> <8634r5tsit.fsf@HIDDEN>
 <m1sez5paso.fsf@HIDDEN> <86y18wsmqy.fsf@HIDDEN>
 <m1jzkg60py.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: 70622
Cc: rudalics@HIDDEN, 70622 <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: Eshel Yaron <me@HIDDEN>
> Cc: rudalics@HIDDEN,  70622 <at> debbugs.gnu.org
> Date: Mon, 29 Apr 2024 10:18:33 +0200
> 
> Eli Zaretskii <eliz@HIDDEN> writes:
> 
> > I still don't think I understand the difficultly.  The "window
> > parameter not set" can be detected by testing whether cursor-type is
> > an element in the alist returned by window-parameters, couldn't it?
> 
> Perhaps I'm missing something, but I think it's not so simple.  We
> can't/shouldn't interpret a value of nil differently from no alist entry
> at all, since there's no way to remove alist entries (in order to unset
> the window parameter) from lisp, right?

Why is the ability to remove important?

> > It is confusing to have several parameters and variables with a
> > similar semantics that each require special quirks to get the same
> > effect.  We should try to make the forms of the values of such
> > variables and parameters be uniform.
> 
> Agreed.  If we could use exactly the same format for the values of the
> variable and window parameter that would be best.  But AFAIU we need
> some encoding (special quirk) when translating from variable values (VV)
> to window parameter values (WPV), due to the competing interpretations
> for nil.  The first encoding I proposed is simple and uniform: cons to
> go from VV to WPV, car to go the other way.  The alternative encoding I
> proposed below, following mode-line-format, is trivial for most VV, but
> not uniform, because one needs to translate nil to 'none when going from
> VV to WPV.
> 
> >> Alternatively, we can use the exact same format for the window
> >> parameter as we do for the variable, except we interpret a window
> >> parameter nil value as "window parameter unset", not "no cursor", and
> >> instead add another value for the window parameter, 'none, that'll
> >> correspond to the nil value of the variable (so window parameter 'none
> >> would say not to show the cursor).
> >
> > That's possible, but doesn't the absence of cursor-type parameter from
> > window-parameters already allow to solve that?
> 
> See above.  Please let me know if I'm mistaken about the possibility of
> differentiating a value of nil from the absence of an alist entry.
> 
> >> This is in line with what we have
> >> for the mode-line-format variable and window parameter, for example.
> >
> > Where do we use this convention for window parameters?
> 
> See "(elisp) Window Parameters":
> 
> ‘mode-line-format’
>      This parameter replaces the value of the buffer-local variable
>      ‘mode-line-format’ (*note Mode Line Basics::) of this window's
>      buffer whenever this window is displayed.  The symbol ‘none’ means
>      to suppress display of a mode line for this window.
> 
> Here the window parameter has the same set of possible values as the
> variable, except the window parameter also has the value 'none, which
> corresponds to the variable's nil value.  The nil value of the window
> parameter means "window parameter not set".

If this is unavoidable (which I'm not yet sure), we can use this.  But
let's first hear from Martin, maybe there are better ideas.




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

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


Received: (at 70622) by debbugs.gnu.org; 29 Apr 2024 08:19:00 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Apr 29 04:19:00 2024
Received: from localhost ([127.0.0.1]:55787 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1s1MDz-0004Zk-LX
	for submit <at> debbugs.gnu.org; Mon, 29 Apr 2024 04:19:00 -0400
Received: from mail.eshelyaron.com ([107.175.124.16]:47068 helo=eshelyaron.com)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <me@HIDDEN>) id 1s1MDw-0004Ze-So
 for 70622 <at> debbugs.gnu.org; Mon, 29 Apr 2024 04:18:57 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eshelyaron.com;
 s=mail; t=1714378716;
 bh=1imLFEhWS8y68iGcCNPIK9Ux3KSDpwXoZeKbnYcWmSE=;
 h=From:To:Cc:Subject:In-Reply-To:References:Date:From;
 b=lg/f552ztLRcMtdEqOtoTuGxmmpSpzso4UI7NeoA8btEqzA2gapVZa0vkNozTJmrl
 ZN/8+AjhdvxpyfWvUm4fDCqClszevdQcGzojAeLsEHPmJ7hVZfL2U1siZ4P4DxucWF
 jeScgQNACwdyg7EvFtuJpx+cMpVIjI16WsGZmDEI1LxHO8Vfntf77bYUFcg6fnWf5k
 fSZgrnk4tY267zdeHRhfT6gGqLIuNM9nbBlRTTG1zeMeV53P6uiu1bB0wB/cp8uEO8
 csUOURFtOiB2RpV3gy+34dWbFDRCq+CY2SAZkjP0CQMOnCF/E+zw9zfYdL4z/4JMs4
 ZxmnPh9v4FDrg==
From: Eshel Yaron <me@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#70622: [PATCH] New window parameter 'cursor-type'
In-Reply-To: <86y18wsmqy.fsf@HIDDEN> (Eli Zaretskii's message of "Mon, 29 Apr
 2024 09:31:49 +0300")
References: <m1il02ypau.fsf@HIDDEN> <864jbmuf39.fsf@HIDDEN>
 <m1zftdr0q6.fsf@HIDDEN> <8634r5tsit.fsf@HIDDEN>
 <m1sez5paso.fsf@HIDDEN> <86y18wsmqy.fsf@HIDDEN>
Date: Mon, 29 Apr 2024 10:18:33 +0200
Message-ID: <m1jzkg60py.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: 70622
Cc: rudalics@HIDDEN, 70622 <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:

>> From: Eshel Yaron <me@HIDDEN>
>> Cc: martin rudalics <rudalics@HIDDEN>,  70622 <at> debbugs.gnu.org
>> Date: Sun, 28 Apr 2024 21:05:59 +0200
>>
>> Eli Zaretskii <eliz@HIDDEN> writes:
>>
>> >> From: Eshel Yaron <me@HIDDEN>
>> >> Cc: 70622 <at> debbugs.gnu.org
>> >> Date: Sun, 28 Apr 2024 17:00:33 +0200
>> >>
>> >> > Why only cons cells are supported?
>> >>
>> >> We need a convenient way to specify both "window parameter not set" a=
nd
>> >> "window parameter set and says not to show a cursor".  Naturally, we
>> >> want to use nil for "window parameter not set", but then nil is what =
the
>> >> variable cursor-type uses for "don't to show a cursor".
>> >
>> > We have the same problem in the frame parameter by this name, and we
>> > solve it there without these complications.  Why should the window
>> > parameter be different?
>>
>> This is a little different, though.  Indeed, the frame parameter also
>> uses nil to denote "no cursor".  The variable, which overrides the frame
>> parameter, uses t to delegate to the frame parameter, so it supports all
>> values of the frame parameter (including nil), plus t.  But unlike a
>> variable, we can't make the window parameter default to t (or any other
>> non-nil value) as easily.
>
> I still don't think I understand the difficultly.  The "window
> parameter not set" can be detected by testing whether cursor-type is
> an element in the alist returned by window-parameters, couldn't it?

Perhaps I'm missing something, but I think it's not so simple.  We
can't/shouldn't interpret a value of nil differently from no alist entry
at all, since there's no way to remove alist entries (in order to unset
the window parameter) from lisp, right?

>> > It's confusing and hard to remember.
>>
>> I went with this format because it lets you use all values of the
>> cursor-type variable in a uniform manner (just wrap it in a list).
>
> It is confusing to have several parameters and variables with a
> similar semantics that each require special quirks to get the same
> effect.  We should try to make the forms of the values of such
> variables and parameters be uniform.

Agreed.  If we could use exactly the same format for the values of the
variable and window parameter that would be best.  But AFAIU we need
some encoding (special quirk) when translating from variable values (VV)
to window parameter values (WPV), due to the competing interpretations
for nil.  The first encoding I proposed is simple and uniform: cons to
go from VV to WPV, car to go the other way.  The alternative encoding I
proposed below, following mode-line-format, is trivial for most VV, but
not uniform, because one needs to translate nil to 'none when going from
VV to WPV.

>> Alternatively, we can use the exact same format for the window
>> parameter as we do for the variable, except we interpret a window
>> parameter nil value as "window parameter unset", not "no cursor", and
>> instead add another value for the window parameter, 'none, that'll
>> correspond to the nil value of the variable (so window parameter 'none
>> would say not to show the cursor).
>
> That's possible, but doesn't the absence of cursor-type parameter from
> window-parameters already allow to solve that?

See above.  Please let me know if I'm mistaken about the possibility of
differentiating a value of nil from the absence of an alist entry.

>> This is in line with what we have
>> for the mode-line-format variable and window parameter, for example.
>
> Where do we use this convention for window parameters?

See "(elisp) Window Parameters":

=E2=80=98mode-line-format=E2=80=99
     This parameter replaces the value of the buffer-local variable
     =E2=80=98mode-line-format=E2=80=99 (*note Mode Line Basics::) of this =
window's
     buffer whenever this window is displayed.  The symbol =E2=80=98none=E2=
=80=99 means
     to suppress display of a mode line for this window.

Here the window parameter has the same set of possible values as the
variable, except the window parameter also has the value 'none, which
corresponds to the variable's nil value.  The nil value of the window
parameter means "window parameter not set".




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

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


Received: (at 70622) by debbugs.gnu.org; 29 Apr 2024 06:32:21 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Apr 29 02:32:21 2024
Received: from localhost ([127.0.0.1]:55361 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1s1KYm-0003Pw-MJ
	for submit <at> debbugs.gnu.org; Mon, 29 Apr 2024 02:32:21 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:43594)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1s1KYk-0003Po-2G
 for 70622 <at> debbugs.gnu.org; Mon, 29 Apr 2024 02:32:19 -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 1s1KYK-0003uc-4J; Mon, 29 Apr 2024 02:31:52 -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=dBRCGK4ppK0aLBAPhrVjbBaeLi8QPFbLw4GoCzc6Jlo=; b=YfhliJLGyDJ2
 7Nyo30mGejM7gsTIBzz5Z6JWUUANJgCRHG6QttmUWfMQbdk3EKCagsYjVUCSgFAWVBqzp1XA9W4eC
 90GfZBqrcCzC1YseBQouzYyyW24wYs8KmjDR+mpOkmtlILndCw2ubogPwM8heKq78u3tlGzk+N29Z
 ijzbyuvDN5dzzGApTVIOV/Ge4b3zKptyGmE/K9q+3g4LMql+KKi4tPevL+yJJXqcHErqiSOCJl/Xw
 swgXziqwLz9UXoaXVPnGvlW+gmAl2pVpfzaWjPpyikyT8O5E5Zlko02iCe9CvbQhX5qGUhAXb8fZM
 vgHWXzbMWC5XEr42kOTyoQ==;
Date: Mon, 29 Apr 2024 09:31:49 +0300
Message-Id: <86y18wsmqy.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Eshel Yaron <me@HIDDEN>
In-Reply-To: <m1sez5paso.fsf@HIDDEN> (message from Eshel Yaron on Sun, 
 28 Apr 2024 21:05:59 +0200)
Subject: Re: bug#70622: [PATCH] New window parameter 'cursor-type'
References: <m1il02ypau.fsf@HIDDEN> <864jbmuf39.fsf@HIDDEN>
 <m1zftdr0q6.fsf@HIDDEN> <8634r5tsit.fsf@HIDDEN>
 <m1sez5paso.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 70622
Cc: rudalics@HIDDEN, 70622 <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: Eshel Yaron <me@HIDDEN>
> Cc: martin rudalics <rudalics@HIDDEN>,  70622 <at> debbugs.gnu.org
> Date: Sun, 28 Apr 2024 21:05:59 +0200
> 
> Eli Zaretskii <eliz@HIDDEN> writes:
> 
> >> From: Eshel Yaron <me@HIDDEN>
> >> Cc: 70622 <at> debbugs.gnu.org
> >> Date: Sun, 28 Apr 2024 17:00:33 +0200
> >>
> >> > Why only cons cells are supported?
> >>
> >> We need a convenient way to specify both "window parameter not set" and
> >> "window parameter set and says not to show a cursor".  Naturally, we
> >> want to use nil for "window parameter not set", but then nil is what the
> >> variable cursor-type uses for "don't to show a cursor".
> >
> > We have the same problem in the frame parameter by this name, and we
> > solve it there without these complications.  Why should the window
> > parameter be different?
> 
> This is a little different, though.  Indeed, the frame parameter also
> uses nil to denote "no cursor".  The variable, which overrides the frame
> parameter, uses t to delegate to the frame parameter, so it supports all
> values of the frame parameter (including nil), plus t.  But unlike a
> variable, we can't make the window parameter default to t (or any other
> non-nil value) as easily.

I still don't think I understand the difficultly.  The "window
parameter not set" can be detected by testing whether cursor-type is
an element in the alist returned by window-parameters, couldn't it?

> > It's confusing and hard to remember.
> 
> I went with this format because it lets you use all values of the
> cursor-type variable in a uniform manner (just wrap it in a list).

It is confusing to have several parameters and variables with a
similar semantics that each require special quirks to get the same
effect.  We should try to make the forms of the values of such
variables and parameters be uniform.

> Alternatively, we can use the exact same format for the window
> parameter as we do for the variable, except we interpret a window
> parameter nil value as "window parameter unset", not "no cursor", and
> instead add another value for the window parameter, 'none, that'll
> correspond to the nil value of the variable (so window parameter 'none
> would say not to show the cursor).

That's possible, but doesn't the absence of cursor-type parameter from
window-parameters already allow to solve that?

> This is in line with what we have
> for the mode-line-format variable and window parameter, for example.

Where do we use this convention for window parameters?




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

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


Received: (at 70622) by debbugs.gnu.org; 28 Apr 2024 19:06:25 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Apr 28 15:06:25 2024
Received: from localhost ([127.0.0.1]:52165 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1s19qz-00065j-Ak
	for submit <at> debbugs.gnu.org; Sun, 28 Apr 2024 15:06:25 -0400
Received: from mail.eshelyaron.com ([107.175.124.16]:42350 helo=eshelyaron.com)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <me@HIDDEN>) id 1s19qv-00065c-OR
 for 70622 <at> debbugs.gnu.org; Sun, 28 Apr 2024 15:06:23 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eshelyaron.com;
 s=mail; t=1714331161;
 bh=fY6zKCEUkazYKFRJru8/J4Lm0RJ3rQDRqo1j5FZ8VQo=;
 h=From:To:Cc:Subject:In-Reply-To:References:Date:From;
 b=CwE8LOanujQZaRjxvC1Eh+ucJeEr5+qFZjdiSVLfsfp/ILeYIWVESaTDFNmki11WQ
 nAKps2yuJDfhEyC7Hocs90N2oozUJQppXgMGnozY2fb8DyWjqw9npPNB6bcW/d1ubQ
 hyqWwLnfGl9tPyqZ28R65OnoMQ4WYTG3OQRIr0Y0CsRVK6iCzyTlfvcLMybLNIzwFS
 rvpFgCKyjD2fbbaI5mgzB75ffmiPkkm5DKNFXGrOOV42vo41t8cpzZtyth7tunFFGh
 TC9ex5jJXA9O/v7gj+fDDrj1V3LVO6sSi1AqVKaafVusVEVhGvlFXPt9auDxTpS39H
 mc3V469YnSQ4Q==
From: Eshel Yaron <me@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#70622: [PATCH] New window parameter 'cursor-type'
In-Reply-To: <8634r5tsit.fsf@HIDDEN> (Eli Zaretskii's message of "Sun, 28 Apr
 2024 18:29:30 +0300")
References: <m1il02ypau.fsf@HIDDEN> <864jbmuf39.fsf@HIDDEN>
 <m1zftdr0q6.fsf@HIDDEN> <8634r5tsit.fsf@HIDDEN>
Date: Sun, 28 Apr 2024 21:05:59 +0200
Message-ID: <m1sez5paso.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 70622
Cc: martin rudalics <rudalics@HIDDEN>, 70622 <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:

>> From: Eshel Yaron <me@HIDDEN>
>> Cc: 70622 <at> debbugs.gnu.org
>> Date: Sun, 28 Apr 2024 17:00:33 +0200
>>
>> > Why only cons cells are supported?
>>
>> We need a convenient way to specify both "window parameter not set" and
>> "window parameter set and says not to show a cursor".  Naturally, we
>> want to use nil for "window parameter not set", but then nil is what the
>> variable cursor-type uses for "don't to show a cursor".
>
> We have the same problem in the frame parameter by this name, and we
> solve it there without these complications.  Why should the window
> parameter be different?

This is a little different, though.  Indeed, the frame parameter also
uses nil to denote "no cursor".  The variable, which overrides the frame
parameter, uses t to delegate to the frame parameter, so it supports all
values of the frame parameter (including nil), plus t.  But unlike a
variable, we can't make the window parameter default to t (or any other
non-nil value) as easily.

> It's confusing and hard to remember.

I went with this format because it lets you use all values of the
cursor-type variable in a uniform manner (just wrap it in a list).
Alternatively, we can use the exact same format for the window
parameter as we do for the variable, except we interpret a window
parameter nil value as "window parameter unset", not "no cursor", and
instead add another value for the window parameter, 'none, that'll
correspond to the nil value of the variable (so window parameter 'none
would say not to show the cursor).  This is in line with what we have
for the mode-line-format variable and window parameter, for example.
Does this alternative sound better?

>> > And I have a question: is this supposed to work for non-selected
>> > windows as well?  The documentation you added says nothing about that,
>> > but I wonder what was the intent?
>>
>> Yes, it's supposed to work for non-selected windows as well.  Do you
>> think that's worth mentioning explicitly in the documentation?
>
> Not just that, but it also means one cannot specify a different cursor
> type for a window when it's selected and when not selected, unlike
> with buffers.  Is this anomaly justified?

See below.

>> > The reason I ask is that we have two buffer-local variables, not one,
>> > for both selected and non-selected windows, whereas your patch
>> > provides just one window parameter.  How will it interact with the
>> > buffer-local variables in both cases?
>>
>> That's a really good point.  WRT cursor-in-non-selected-windows, I think
>> there are two viable options:
>>
>> 1. Give cursor-in-non-selected-windows precedence over the new window
>>    parameter, and add another window parameter to override
>>    cursor-in-non-selected-windows.
>> 2. Give the new window parameter precedence also over
>>    cursor-in-non-selected-windows.
>>
>> In the updated patch, I went with option 2, so if you set the
>> cursor-type window parameter, that overrides any buffer-local variable,
>> whether or not the window is selected.  I think that's sensible enough,
>> WDYT?
>
> I tend to think option 1 is better, but I'm curious what others think.

All right.  I can implement that option instead, if that's deemed
preferable.  The way I see it, option 1 makes it easy to set the
cursor for a window and have it change based on whether or not the
window is selected, but it requires a bit more work to set the cursor
for that window once and for all if you don't want it to change based
on window selection.  Option 2 is the other way around: it's easier in
case you want to set the cursor type for a window regardless of
whether it is selected or not.  So there's a small tradeoff here.

> Martin, WDYT?
>

[...]

> I think it would be better to make sure the parameter takes effect
> immediately.  Documenting the force-window-update thing should be
> fallback, if the immediate effect is impossible.

OK, I'll look into it.

>>        if (w == XWINDOW (echo_area_window))
>>      {
>> -	  if (EQ (BVAR (b, cursor_type), Qt) || NILP (BVAR (b, cursor_type)))
>> +	  win_cursor = window_parameter (w, Qcursor_type);
>> +	  if (CONSP (win_cursor))
>> +	    {
>> +	      return get_specified_cursor_type (XCAR (win_cursor), width);
>> +	    }
>
> We don't use braces for a single-line block.

Thanks, I'll fix that in the next iteration of this patch.


Best,

Eshel




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

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


Received: (at 70622) by debbugs.gnu.org; 28 Apr 2024 15:30:03 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Apr 28 11:30:03 2024
Received: from localhost ([127.0.0.1]:50794 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1s16TZ-0000BN-US
	for submit <at> debbugs.gnu.org; Sun, 28 Apr 2024 11:30:02 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:45808)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1s16TX-0000Ax-7u
 for 70622 <at> debbugs.gnu.org; Sun, 28 Apr 2024 11:29:59 -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 1s16T8-0000cW-3m; Sun, 28 Apr 2024 11:29:34 -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=w/kTyNVPXHslceLSXeQGBmfo876Gg5pjBo/cjq3MpS4=; b=NZhrnLUb3hm4
 cZeWW4qJXW4Ql9wvDliUPzCdcr3htTPNIUf71RGJKu/S2DLiAuqlEI2WW1y+xk/1IbhrDdikoeHdi
 NRp4CLigxvTR9E5HmRuTkNynYlmw3/VQyofnDLMW5dVYHSuYspsbk4zcNl8bt1A+Kjo2jIRLb9oNr
 ICc9/9+TKbAFYWxntkfpYB++JnV03DCbe0/QjRv/4+SSmW2b9E6c90309QFJSqG3fwXlfTomAoXDi
 xjzoN2dboY4jHZtWJEZkXZ37e8lAjjGw3MFRTnXuwcbPsWnfJ6PIgLatRnyg+ren+8iRSHuZw078A
 R1ESuA8ZRtqe/CXaCrp/jg==;
Date: Sun, 28 Apr 2024 18:29:30 +0300
Message-Id: <8634r5tsit.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Eshel Yaron <me@HIDDEN>, martin rudalics <rudalics@HIDDEN>
In-Reply-To: <m1zftdr0q6.fsf@HIDDEN> (message from Eshel Yaron on Sun, 
 28 Apr 2024 17:00:33 +0200)
Subject: Re: bug#70622: [PATCH] New window parameter 'cursor-type'
References: <m1il02ypau.fsf@HIDDEN> <864jbmuf39.fsf@HIDDEN>
 <m1zftdr0q6.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 70622
Cc: 70622 <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: Eshel Yaron <me@HIDDEN>
> Cc: 70622 <at> debbugs.gnu.org
> Date: Sun, 28 Apr 2024 17:00:33 +0200
> 
> > Why only cons cells are supported?
> 
> We need a convenient way to specify both "window parameter not set" and
> "window parameter set and says not to show a cursor".  Naturally, we
> want to use nil for "window parameter not set", but then nil is what the
> variable cursor-type uses for "don't to show a cursor".

We have the same problem in the frame parameter by this name, and we
solve it there without these complications.  Why should the window
parameter be different?  It's confusing and hard to remember.

> > And I have a question: is this supposed to work for non-selected
> > windows as well?  The documentation you added says nothing about that,
> > but I wonder what was the intent?
> 
> Yes, it's supposed to work for non-selected windows as well.  Do you
> think that's worth mentioning explicitly in the documentation?

Not just that, but it also means one cannot specify a different cursor
type for a window when it's selected and when not selected, unlike
with buffers.  Is this anomaly justified?

> > The reason I ask is that we have two buffer-local variables, not one,
> > for both selected and non-selected windows, whereas your patch
> > provides just one window parameter.  How will it interact with the
> > buffer-local variables in both cases?
> 
> That's a really good point.  WRT cursor-in-non-selected-windows, I think
> there are two viable options:
> 
> 1. Give cursor-in-non-selected-windows precedence over the new window
>    parameter, and add another window parameter to override
>    cursor-in-non-selected-windows.
> 2. Give the new window parameter precedence also over
>    cursor-in-non-selected-windows.
> 
> In the updated patch, I went with option 2, so if you set the
> cursor-type window parameter, that overrides any buffer-local variable,
> whether or not the window is selected.  I think that's sensible enough,
> WDYT?

I tend to think option 1 is better, but I'm curious what others think.
Martin, WDYT?

> > In addition, what is supposed to happen when this new window-parameter
> > is changed? is the cursor supposed to be redrawn in the new shape
> > immediately, i.e. do you expect redisplay to happen right away to
> > update the relevant window?
> 
> Not necessarily.  In cases where we want to ensure the cursor is redrawn
> immediately in a non-selected window, we can use force-window-update
> after setting the window parameter.  Should that be mentioned in the
> documentation as well?

I think it would be better to make sure the parameter takes effect
immediately.  Documenting the force-window-update thing should be
fallback, if the immediate effect is impossible.

>        if (w == XWINDOW (echo_area_window))
>  	{
> -	  if (EQ (BVAR (b, cursor_type), Qt) || NILP (BVAR (b, cursor_type)))
> +	  win_cursor = window_parameter (w, Qcursor_type);
> +	  if (CONSP (win_cursor))
> +	    {
> +	      return get_specified_cursor_type (XCAR (win_cursor), width);
> +	    }

We don't use braces for a single-line block.




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

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


Received: (at 70622) by debbugs.gnu.org; 28 Apr 2024 15:00:59 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Apr 28 11:00:59 2024
Received: from localhost ([127.0.0.1]:50648 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1s161R-0007vf-W2
	for submit <at> debbugs.gnu.org; Sun, 28 Apr 2024 11:00:59 -0400
Received: from mail.eshelyaron.com ([107.175.124.16]:39330 helo=eshelyaron.com)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <me@HIDDEN>) id 1s161P-0007pd-Lv
 for 70622 <at> debbugs.gnu.org; Sun, 28 Apr 2024 11:00:56 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eshelyaron.com;
 s=mail; t=1714316435;
 bh=d/YD986l+cdy9lTO+mN3Te4hSO5ibHWNwE2aXijaQ9U=;
 h=From:To:Cc:Subject:In-Reply-To:References:Date:From;
 b=pDuKx+q1KqOObkfyObTgrY9WrMZnSEuMUA9yremU+aTwknwXtxQDRTcjx+n/yiKsP
 x2cPikiT1XHJ8nJVb1llS5Vi/MhUsqAbyhFuTcbjG42CbB9ekVr7mgiQd6PArukyol
 JqjZ8k25l5Tem+VZYgOXmbt3pmXALz++TjznCDmH5r2f46cR1VYTrNT5/sT92Z3QAD
 kF7t2AYvIEwteD36urqht+YoSqDVjen/ml5TawGz1daNl7tLj739gdSGNYSQ13Jv67
 BYSp3BNqg24P+/uCVSXIXEYDJXlTa1TAeQfeuy4ESh+j3Sarh+8g2IbXIyY9mTymU4
 cIMjvcaNteejQ==
From: Eshel Yaron <me@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#70622: [PATCH] New window parameter 'cursor-type'
In-Reply-To: <864jbmuf39.fsf@HIDDEN> (Eli Zaretskii's message of "Sun, 28 Apr
 2024 10:22:02 +0300")
References: <m1il02ypau.fsf@HIDDEN> <864jbmuf39.fsf@HIDDEN>
Date: Sun, 28 Apr 2024 17:00:33 +0200
Message-ID: <m1zftdr0q6.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 70622
Cc: 70622 <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 (-)

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

Hi,

Eli Zaretskii <eliz@HIDDEN> writes:

>> Date: Sun, 28 Apr 2024 08:27:53 +0200
>> From:  Eshel Yaron via "Bug reports for GNU Emacs,
>>  the Swiss army knife of text editors" <bug-gnu-emacs@HIDDEN>
>>
>> This patch makes it possible to set the cursor type in a specific window,
>> without affecting other windows that may be showing the same buffer.
>
> Thanks, I have a few comments and questions below.
>

Thanks for reviewing.

>> --- a/doc/lispref/windows.texi
>> +++ b/doc/lispref/windows.texi
>> @@ -6691,6 +6691,15 @@ Window Parameters
>>  window and should be used, with due care, exclusively by those
>>  applications.  It might be replaced by an improved solution in future
>>  versions of Emacs.
>> +
>> +@item cursor-type
>> +@vindex cursor-type@r{, a window parameter}
>> +If this parameter is set to a cons cell, its @sc{car} specifies the
>> +shape of the cursor in this window, using the same format as the
>> +buffer-local variable @code{cursor-type}.  @xref{Cursor Parameters}.
>> +Use this window parameter instead of the @code{cursor-type} variable or
>> +frame parameter when a buffer is displayed in multiple windows and you
>> +want to change the cursor for one window without affecting the others.
>>  @end table
>
> This doesn't say what happens when the buffer-local variable and the
> window parameter don't agree.

Right, I've made this more explicit in the updated patch below.

> Also, the "Cursor Parameters" node should mention this window-specific
> parameter, with a cross-reference.

Done.

>> +*** New window parameter 'cursor-type'.
>> +If this parameter is set to a cons cell, its 'car' specifies the shape
>> +of the window's cursor, using the same format as the buffer-local
>> +variable 'cursor-type'.
>
> Why only cons cells are supported?
>

We need a convenient way to specify both "window parameter not set" and
"window parameter set and says not to show a cursor".  Naturally, we
want to use nil for "window parameter not set", but then nil is what the
variable cursor-type uses for "don't to show a cursor".  So we embed the
space of possible values for the variable in a cons cell to clearly
disambiguate the variable's nil from the window parameter's nil.
Namely, if the window parameter is set to '(nil) that means not to show
a cursor, in contrast with a plain nil which means the window parameter
is unset.

>> +  win_cursor = window_parameter (w, Qcursor_type);
>> +  if (CONSP (win_cursor))
>>      {
>> -      cursor_type = FRAME_DESIRED_CURSOR (f);
>> -      *width = FRAME_CURSOR_WIDTH (f);
>> +      cursor_type = get_specified_cursor_type (XCAR (win_cursor), width);
>>      }
>
> Same question here.
>

See above.

> And I have a question: is this supposed to work for non-selected
> windows as well?  The documentation you added says nothing about that,
> but I wonder what was the intent?

Yes, it's supposed to work for non-selected windows as well.  Do you
think that's worth mentioning explicitly in the documentation?

> The reason I ask is that we have two buffer-local variables, not one,
> for both selected and non-selected windows, whereas your patch
> provides just one window parameter.  How will it interact with the
> buffer-local variables in both cases?

That's a really good point.  WRT cursor-in-non-selected-windows, I think
there are two viable options:

1. Give cursor-in-non-selected-windows precedence over the new window
   parameter, and add another window parameter to override
   cursor-in-non-selected-windows.
2. Give the new window parameter precedence also over
   cursor-in-non-selected-windows.

In the updated patch, I went with option 2, so if you set the
cursor-type window parameter, that overrides any buffer-local variable,
whether or not the window is selected.  I think that's sensible enough,
WDYT?

> Also, what about the cursor in mini-windows?

This applies also to the mini-window.  In the updated patch, I've
extended it to take effect also when the minibuffer is not selected but
cursor-in-echo-area is non-nil.

> In addition, what is supposed to happen when this new window-parameter
> is changed? is the cursor supposed to be redrawn in the new shape
> immediately, i.e. do you expect redisplay to happen right away to
> update the relevant window?

Not necessarily.  In cases where we want to ensure the cursor is redrawn
immediately in a non-selected window, we can use force-window-update
after setting the window parameter.  Should that be mentioned in the
documentation as well?



--=-=-=
Content-Type: text/x-patch
Content-Disposition: attachment;
 filename=v2-0001-New-window-parameter-cursor-type.patch

From 0838e20f9d23b5be81ab6ff7460d0dc0d519754b Mon Sep 17 00:00:00 2001
From: Eshel Yaron <me@HIDDEN>
Date: Sat, 27 Apr 2024 20:47:34 +0200
Subject: [PATCH v2] New window parameter 'cursor-type'

* src/xdisp.c (get_window_cursor_type): Consult new window
parameter 'cursor-type'.
* doc/lispref/windows.texi (Window Parameters): Document it.
* doc/lispref/frames.texi (Cursor Parameters): Mention it.
* etc/NEWS: Announce it.  (Bug#70622)
---
 doc/lispref/frames.texi  |  5 +++--
 doc/lispref/windows.texi | 12 ++++++++++++
 etc/NEWS                 |  6 ++++++
 src/xdisp.c              | 37 +++++++++++++++++++++++++------------
 4 files changed, 46 insertions(+), 14 deletions(-)

diff --git a/doc/lispref/frames.texi b/doc/lispref/frames.texi
index cae93acae9f..b79879063fb 100644
--- a/doc/lispref/frames.texi
+++ b/doc/lispref/frames.texi
@@ -2341,8 +2341,9 @@ Cursor Parameters
 @end table
 
 @vindex cursor-type
-The @code{cursor-type} frame parameter may be overridden by the
-variables @code{cursor-type} and
+The @code{cursor-type} frame parameter may be overridden by the window
+parameter @code{cursor-type} (@pxref{Definition of cursor-type window
+parameter}), and by the variables @code{cursor-type} and
 @code{cursor-in-non-selected-windows}:
 
 @defopt cursor-type
diff --git a/doc/lispref/windows.texi b/doc/lispref/windows.texi
index 104420235df..b66b81aca6e 100644
--- a/doc/lispref/windows.texi
+++ b/doc/lispref/windows.texi
@@ -6691,6 +6691,18 @@ Window Parameters
 window and should be used, with due care, exclusively by those
 applications.  It might be replaced by an improved solution in future
 versions of Emacs.
+
+@item cursor-type
+@vindex cursor-type@r{, a window parameter}
+@anchor{Definition of cursor-type window parameter}
+If this parameter is set to a cons cell, its @sc{car} specifies the
+shape of the cursor in this window, using the same format as the
+buffer-local variable @code{cursor-type}.  @xref{Cursor Parameters}.
+Use this window parameter instead of the @code{cursor-type} variable or
+frame parameter when a buffer is displayed in multiple windows and you
+want to change the cursor for one window without affecting the others.
+This window parameter takes precedence over the @code{cursor-type}
+variable as well as @code{cursor-in-non-selected-windows}.
 @end table
 
 
diff --git a/etc/NEWS b/etc/NEWS
index 9c356e64bde..e08998e4b6f 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -340,6 +340,12 @@ and 'window-state-get'.  Then later another new variable
 'window-state-put' to restore positions of window points
 according to the context stored in a window parameter.
 
++++
+*** New window parameter 'cursor-type'.
+If this parameter is set to a cons cell, its 'car' specifies the shape
+of the window's cursor, using the same format as the buffer-local
+variable 'cursor-type'.
+
 ** Tab Bars and Tab Lines
 
 ---
diff --git a/src/xdisp.c b/src/xdisp.c
index 85802ec5083..9e4e145d93d 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -33605,7 +33605,7 @@ get_window_cursor_type (struct window *w, struct glyph *glyph, int *width,
   struct frame *f = XFRAME (w->frame);
   struct buffer *b = XBUFFER (w->contents);
   int cursor_type = DEFAULT_CURSOR;
-  Lisp_Object alt_cursor;
+  Lisp_Object alt_cursor, win_cursor;
   bool non_selected = false;
 
   *active_cursor = true;
@@ -33617,7 +33617,12 @@ get_window_cursor_type (struct window *w, struct glyph *glyph, int *width,
     {
       if (w == XWINDOW (echo_area_window))
 	{
-	  if (EQ (BVAR (b, cursor_type), Qt) || NILP (BVAR (b, cursor_type)))
+	  win_cursor = window_parameter (w, Qcursor_type);
+	  if (CONSP (win_cursor))
+	    {
+	      return get_specified_cursor_type (XCAR (win_cursor), width);
+	    }
+	  else if (EQ (BVAR (b, cursor_type), Qt) || NILP (BVAR (b, cursor_type)))
 	    {
 	      *width = FRAME_CURSOR_WIDTH (f);
 	      return FRAME_DESIRED_CURSOR (f);
@@ -33644,22 +33649,30 @@ get_window_cursor_type (struct window *w, struct glyph *glyph, int *width,
       non_selected = true;
     }
 
-  /* Never display a cursor in a window in which cursor-type is nil.  */
-  if (NILP (BVAR (b, cursor_type)))
-    return NO_CURSOR;
-
-  /* Get the normal cursor type for this window.  */
-  if (EQ (BVAR (b, cursor_type), Qt))
+  win_cursor = window_parameter (w, Qcursor_type);
+  if (CONSP (win_cursor))
     {
-      cursor_type = FRAME_DESIRED_CURSOR (f);
-      *width = FRAME_CURSOR_WIDTH (f);
+      cursor_type = get_specified_cursor_type (XCAR (win_cursor), width);
     }
   else
-    cursor_type = get_specified_cursor_type (BVAR (b, cursor_type), width);
+    {
+      /* Never display a cursor in a window in which cursor-type is nil.  */
+      if (NILP (BVAR (b, cursor_type)))
+	return NO_CURSOR;
+
+      /* Get the normal cursor type for this window.  */
+      if (EQ (BVAR (b, cursor_type), Qt))
+	{
+	  cursor_type = FRAME_DESIRED_CURSOR (f);
+	  *width = FRAME_CURSOR_WIDTH (f);
+	}
+      else
+	cursor_type = get_specified_cursor_type (BVAR (b, cursor_type), width);
+    }
 
   /* Use cursor-in-non-selected-windows instead
      for non-selected window or frame.  */
-  if (non_selected)
+  if (non_selected && !CONSP (win_cursor))
     {
       alt_cursor = BVAR (b, cursor_in_non_selected_windows);
       if (!EQ (Qt, alt_cursor))
-- 
2.44.0


--=-=-=--




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

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


Received: (at 70622) by debbugs.gnu.org; 28 Apr 2024 07:22:33 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Apr 28 03:22:33 2024
Received: from localhost ([127.0.0.1]:50023 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1s0yro-0002Lp-I9
	for submit <at> debbugs.gnu.org; Sun, 28 Apr 2024 03:22:32 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:42436)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1s0yrl-0002Le-Tb
 for 70622 <at> debbugs.gnu.org; Sun, 28 Apr 2024 03:22:30 -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 1s0yrM-0001Js-W2; Sun, 28 Apr 2024 03:22:05 -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=kqFWH5FvEGNyE3N4u+wJldUdT7vjHX4+jUBqM6aOadI=; b=mBGUuVAAysc8
 79bEtf+VPjTg1bbXQWg7kGL/w52YZj3PFnEZNT+ExvqAyxLC4l+gr+lvL2Gwl871hjxLrlUagnOec
 kIVv0o7MjJJtqETZCHBW/wrFHjUcCVWwhl0iB8xNxupYyBnS/+l6/D0mLvsUya2AtoOdUvRS5uENN
 KRr2p0tOI81fVd+Aw2PIMKb4cS8eXqo9WeAkKksfJ9lv40wtckyTk6r6ZjnbAVEix4OWyn+XqDDPZ
 4fCtOg4kNMunRf2aV/OEuYvvGX6WuR6SJCEuaHF9E8kEdahyB6WvZYV5UIBhSznymWrBEdQqjyrgs
 dq9HYLx3dmvCYFEuP/BAng==;
Date: Sun, 28 Apr 2024 10:22:02 +0300
Message-Id: <864jbmuf39.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Eshel Yaron <me@HIDDEN>
In-Reply-To: <m1il02ypau.fsf@HIDDEN> (bug-gnu-emacs@HIDDEN)
Subject: Re: bug#70622: [PATCH] New window parameter 'cursor-type'
References: <m1il02ypau.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 70622
Cc: 70622 <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: Sun, 28 Apr 2024 08:27:53 +0200
> From:  Eshel Yaron via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <bug-gnu-emacs@HIDDEN>
> 
> This patch makes it possible to set the cursor type in a specific window,
> without affecting other windows that may be showing the same buffer.

Thanks, I have a few comments and questions below.

> --- a/doc/lispref/windows.texi
> +++ b/doc/lispref/windows.texi
> @@ -6691,6 +6691,15 @@ Window Parameters
>  window and should be used, with due care, exclusively by those
>  applications.  It might be replaced by an improved solution in future
>  versions of Emacs.
> +
> +@item cursor-type
> +@vindex cursor-type@r{, a window parameter}
> +If this parameter is set to a cons cell, its @sc{car} specifies the
> +shape of the cursor in this window, using the same format as the
> +buffer-local variable @code{cursor-type}.  @xref{Cursor Parameters}.
> +Use this window parameter instead of the @code{cursor-type} variable or
> +frame parameter when a buffer is displayed in multiple windows and you
> +want to change the cursor for one window without affecting the others.
>  @end table

This doesn't say what happens when the buffer-local variable and the
window parameter don't agree.

Also, the "Cursor Parameters" node should mention this window-specific
parameter, with a cross-reference.

> +*** New window parameter 'cursor-type'.
> +If this parameter is set to a cons cell, its 'car' specifies the shape
> +of the window's cursor, using the same format as the buffer-local
> +variable 'cursor-type'.

Why only cons cells are supported?

> +  win_cursor = window_parameter (w, Qcursor_type);
> +  if (CONSP (win_cursor))
>      {
> -      cursor_type = FRAME_DESIRED_CURSOR (f);
> -      *width = FRAME_CURSOR_WIDTH (f);
> +      cursor_type = get_specified_cursor_type (XCAR (win_cursor), width);
>      }

Same question here.

And I have a question: is this supposed to work for non-selected
windows as well?  The documentation you added says nothing about that,
but I wonder what was the intent?  The reason I ask is that we have two
buffer-local variables, not one, for both selected and non-selected
windows, whereas your patch provides just one window parameter.  How
will it interact with the buffer-local variables in both cases?

Also, what about the cursor in mini-windows?

In addition, what is supposed to happen when this new window-parameter
is changed? is the cursor supposed to be redrawn in the new shape
immediately, i.e. do you expect redisplay to happen right away to
update the relevant window?  If so, I'm not sure the patch ensures
such an update.  In particular, non-selected windows are not
guaranteed to be updated by redisplay cycles, unless redisplay is
told, either directly or indirectly, about the need to do so.  To test
this, bind to a simple key, like F8, a command that changes the
window-parameter, and see if the change takes effect as soon as you
expect.




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

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


Received: (at submit) by debbugs.gnu.org; 28 Apr 2024 06:28:25 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Apr 28 02:28:25 2024
Received: from localhost ([127.0.0.1]:49993 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1s0y1Q-0001gv-QR
	for submit <at> debbugs.gnu.org; Sun, 28 Apr 2024 02:28:25 -0400
Received: from lists.gnu.org ([2001:470:142::17]:59762)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <me@HIDDEN>) id 1s0y1O-0001gm-Mb
 for submit <at> debbugs.gnu.org; Sun, 28 Apr 2024 02:28:23 -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 <me@HIDDEN>) id 1s0y0z-00008Q-No
 for bug-gnu-emacs@HIDDEN; Sun, 28 Apr 2024 02:27:57 -0400
Received: from mail.eshelyaron.com ([107.175.124.16] helo=eshelyaron.com)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <me@HIDDEN>) id 1s0y0y-0008VY-3n
 for bug-gnu-emacs@HIDDEN; Sun, 28 Apr 2024 02:27:57 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eshelyaron.com;
 s=mail; t=1714285675;
 bh=hbyucdiwapk5KNfAUkz2zq8/z7YS4OWvybeWEaks8j8=;
 h=From:To:Subject:Date:From;
 b=WwJbLndsuhv7RPv2Pvocoh1tkNWyHbbu4BhXrLrsTGzCRqC/WBVAxA7qgDMHlAG4g
 qoDBEYFgIz04BINQN+B5/LiKQVCDURvsmnckhuw5VulZDxgRYMchqcxfphu+RIDJGL
 JIO/3g9Rd+n03g6hAB6iRONP5k3jRtIQUmqRNGO+fEPrs6ceUAyEO+vll5FYVPa/j0
 StPJRmEEYw+9QpFlgqKVesP/Gf6mjWTuQRGRGyPBWlNcgEnpCzZqB/TpbiJctWgIaJ
 r9ukMQjzCvmlluy5w9kMZygrY/vfjerzZCyDo/sBXfhb5l45KMScxjiLQHJC02ut9P
 FF9LdW0rqUKGg==
From: Eshel Yaron <me@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: [PATCH] New window parameter 'cursor-type'
X-Hashcash: 1:20:240428:bug-gnu-emacs@HIDDEN::VDb4sqs9kz26Nlv6:5w2F
Date: Sun, 28 Apr 2024 08:27:53 +0200
Message-ID: <m1il02ypau.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
Received-SPF: pass client-ip=107.175.124.16; envelope-from=me@HIDDEN;
 helo=eshelyaron.com
X-Spam_score_int: -20
X-Spam_score: -2.1
X-Spam_bar: --
X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, 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
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 (/)

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

Tags: patch

This patch makes it possible to set the cursor type in a specific window,
without affecting other windows that may be showing the same buffer.


--=-=-=
Content-Type: text/patch
Content-Disposition: attachment;
 filename=0001-New-window-parameter-cursor-type.patch

From 518a6708c6d94f152c9cb9ca7a8c73aeffa4a03a Mon Sep 17 00:00:00 2001
From: Eshel Yaron <me@HIDDEN>
Date: Sat, 27 Apr 2024 20:47:34 +0200
Subject: [PATCH] New window parameter 'cursor-type'

* src/xdisp.c (get_window_cursor_type): Consult new window
parameter 'cursor-type'.
* doc/lispref/windows.texi (Window Parameters): Document it.
* etc/NEWS: Announce it.
---
 doc/lispref/windows.texi |  9 +++++++++
 etc/NEWS                 |  6 ++++++
 src/xdisp.c              | 28 ++++++++++++++++++----------
 3 files changed, 33 insertions(+), 10 deletions(-)

diff --git a/doc/lispref/windows.texi b/doc/lispref/windows.texi
index 104420235df..19154692056 100644
--- a/doc/lispref/windows.texi
+++ b/doc/lispref/windows.texi
@@ -6691,6 +6691,15 @@ Window Parameters
 window and should be used, with due care, exclusively by those
 applications.  It might be replaced by an improved solution in future
 versions of Emacs.
+
+@item cursor-type
+@vindex cursor-type@r{, a window parameter}
+If this parameter is set to a cons cell, its @sc{car} specifies the
+shape of the cursor in this window, using the same format as the
+buffer-local variable @code{cursor-type}.  @xref{Cursor Parameters}.
+Use this window parameter instead of the @code{cursor-type} variable or
+frame parameter when a buffer is displayed in multiple windows and you
+want to change the cursor for one window without affecting the others.
 @end table
 
 
diff --git a/etc/NEWS b/etc/NEWS
index 9c356e64bde..e08998e4b6f 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -340,6 +340,12 @@ and 'window-state-get'.  Then later another new variable
 'window-state-put' to restore positions of window points
 according to the context stored in a window parameter.
 
++++
+*** New window parameter 'cursor-type'.
+If this parameter is set to a cons cell, its 'car' specifies the shape
+of the window's cursor, using the same format as the buffer-local
+variable 'cursor-type'.
+
 ** Tab Bars and Tab Lines
 
 ---
diff --git a/src/xdisp.c b/src/xdisp.c
index 85802ec5083..ac2b2d186ff 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -33605,7 +33605,7 @@ get_window_cursor_type (struct window *w, struct glyph *glyph, int *width,
   struct frame *f = XFRAME (w->frame);
   struct buffer *b = XBUFFER (w->contents);
   int cursor_type = DEFAULT_CURSOR;
-  Lisp_Object alt_cursor;
+  Lisp_Object alt_cursor, win_cursor;
   bool non_selected = false;
 
   *active_cursor = true;
@@ -33644,18 +33644,26 @@ get_window_cursor_type (struct window *w, struct glyph *glyph, int *width,
       non_selected = true;
     }
 
-  /* Never display a cursor in a window in which cursor-type is nil.  */
-  if (NILP (BVAR (b, cursor_type)))
-    return NO_CURSOR;
-
-  /* Get the normal cursor type for this window.  */
-  if (EQ (BVAR (b, cursor_type), Qt))
+  win_cursor = window_parameter (w, Qcursor_type);
+  if (CONSP (win_cursor))
     {
-      cursor_type = FRAME_DESIRED_CURSOR (f);
-      *width = FRAME_CURSOR_WIDTH (f);
+      cursor_type = get_specified_cursor_type (XCAR (win_cursor), width);
     }
   else
-    cursor_type = get_specified_cursor_type (BVAR (b, cursor_type), width);
+    {
+      /* Never display a cursor in a window in which cursor-type is nil.  */
+      if (NILP (BVAR (b, cursor_type)))
+	return NO_CURSOR;
+
+      /* Get the normal cursor type for this window.  */
+      if (EQ (BVAR (b, cursor_type), Qt))
+	{
+	  cursor_type = FRAME_DESIRED_CURSOR (f);
+	  *width = FRAME_CURSOR_WIDTH (f);
+	}
+      else
+	cursor_type = get_specified_cursor_type (BVAR (b, cursor_type), width);
+    }
 
   /* Use cursor-in-non-selected-windows instead
      for non-selected window or frame.  */
-- 
2.44.0


--=-=-=--




Acknowledgement sent to Eshel Yaron <me@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#70622; 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: Sun, 12 May 2024 08:45:02 UTC

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