unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: martin rudalics <rudalics@gmx.at>
Cc: me@eshelyaron.com, 70622@debbugs.gnu.org
Subject: bug#70622: [PATCH] New window parameter 'cursor-type'
Date: Fri, 10 May 2024 19:20:05 +0300	[thread overview]
Message-ID: <86cypt4p1m.fsf@gnu.org> (raw)
In-Reply-To: <283e9319-8863-44e7-be72-995b8b36c37e@gmx.at> (message from martin rudalics on Fri, 10 May 2024 10:58:58 +0200)

> Date: Fri, 10 May 2024 10:58:58 +0200
> Cc: 70622@debbugs.gnu.org
> From: martin rudalics <rudalics@gmx.at>
> 
>  >>> +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.





  reply	other threads:[~2024-05-10 16:20 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-28  6:27 bug#70622: [PATCH] New window parameter 'cursor-type' Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-28  7:22 ` Eli Zaretskii
2024-04-28 15:00   ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-28 15:29     ` Eli Zaretskii
2024-04-28 19:05       ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-29  6:31         ` Eli Zaretskii
2024-04-29  8:18           ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-29  9:08             ` Eli Zaretskii
2024-04-29  9:48               ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-29 11:10                 ` Eli Zaretskii
2024-04-30  9:03                   ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-30 12:12                     ` Eli Zaretskii
2024-05-09  7:44                       ` Eli Zaretskii
2024-05-09 10:56                         ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-09 11:25                           ` Eli Zaretskii
2024-05-09 14:19                             ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-10  8:58                               ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-10 16:20                                 ` Eli Zaretskii [this message]
2024-05-11  7:35                                   ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-11  8:34                                     ` Eli Zaretskii
2024-05-12  8:29                                       ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-12  9:39                                         ` Eli Zaretskii
2024-05-12 12:33                                           ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-13  8:05                                             ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-13 12:13                                               ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-18  9:43                                                 ` Eli Zaretskii
2024-05-18 13:45                                                   ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-10 16:19                               ` Eli Zaretskii
2024-04-29  9:48       ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86cypt4p1m.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=70622@debbugs.gnu.org \
    --cc=me@eshelyaron.com \
    --cc=rudalics@gmx.at \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).