bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#70622: [PATCH] New window parameter 'cursor-type'


From: Eshel Yaron
Subject: bug#70622: [PATCH] New window parameter 'cursor-type'
Date: Sun, 12 May 2024 14:33:45 +0200
User-agent: Gnus/5.13 (Gnus v5.13)

Hi,

Eli Zaretskii <eliz@gnu.org> writes:

>> Date: Sun, 12 May 2024 10:29:24 +0200
>> Cc: me@eshelyaron.com, 70622@debbugs.gnu.org
>> From: martin rudalics <rudalics@gmx.at>
>>
>>  > 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.
>
> Thanks.  Let's see what Eshel takes from this.

I think that given there are no strictly invalid cursor-type values,
designating some (most) values as invalid for set-window-cursor-type
reduces consistency for little practical gain.  OTOH, I don't think
there's any real harm to it either, so I added such a check in the
update patch below.

I've also extended the documentation of set-window-cursor-type to note
that this setting persists when you change the buffer of the window, as
Martin suggested.

I've added a FIXME comment about extending window-cursor-type with an
optional argument that asks for the effective cursor type, but I did not
implement it at this point.  I looked into it, but the implementation is
quite involved, it basically requires duplicating many of the careful
considerations of get_window_cursor_type, or refactoring it for reuse.
Since we do provide all the needed information for computing the
effective cursor in Lisp, and there's no concrete use case for doing
that ATM, I think we can leave it at for now.


Here's the updated patch:

Attachment: v5-0001-New-functions-set-window-cursor-type.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]