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

Previous Next

Package: emacs;

Reported by: Eshel Yaron <me <at> eshelyaron.com>

Date: Sun, 28 Apr 2024 06:29:01 UTC

Severity: normal

Tags: patch

Fixed in version 30.1

Done: Eshel Yaron <me <at> eshelyaron.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: martin rudalics <rudalics <at> gmx.at>
Cc: me <at> eshelyaron.com, 70622 <at> debbugs.gnu.org
Subject: bug#70622: [PATCH] New window parameter 'cursor-type'
Date: Sat, 11 May 2024 11:34:46 +0300
> Date: Sat, 11 May 2024 09:35:37 +0200
> Cc: me <at> eshelyaron.com, 70622 <at> debbugs.gnu.org
> From: martin rudalics <rudalics <at> gmx.at>
> 
>  >>   >> 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.




This bug report was last modified 1 year and 96 days ago.

Previous Next


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