unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Eshel Yaron <me@eshelyaron.com>, martin rudalics <rudalics@gmx.at>
Cc: 70622@debbugs.gnu.org
Subject: bug#70622: [PATCH] New window parameter 'cursor-type'
Date: Sun, 28 Apr 2024 18:29:30 +0300	[thread overview]
Message-ID: <8634r5tsit.fsf@gnu.org> (raw)
In-Reply-To: <m1zftdr0q6.fsf@dazzs-mbp.kpn> (message from Eshel Yaron on Sun,  28 Apr 2024 17:00:33 +0200)

> From: Eshel Yaron <me@eshelyaron.com>
> Cc: 70622@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.





  reply	other threads:[~2024-04-28 15:29 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 [this message]
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
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=8634r5tsit.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).