From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#70622: [PATCH] New window parameter 'cursor-type' Date: Sun, 28 Apr 2024 10:22:02 +0300 Message-ID: <864jbmuf39.fsf@gnu.org> References: Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="4129"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 70622@debbugs.gnu.org To: Eshel Yaron Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Apr 28 09:22:50 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1s0ys6-0000s7-Mx for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 28 Apr 2024 09:22:50 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s0ys0-0003fM-Si; Sun, 28 Apr 2024 03:22:44 -0400 Original-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 ) id 1s0yrz-0003Zk-Ed for bug-gnu-emacs@gnu.org; Sun, 28 Apr 2024 03:22:43 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s0yrz-0001R6-4E for bug-gnu-emacs@gnu.org; Sun, 28 Apr 2024 03:22:43 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1s0ysI-0002M5-Av for bug-gnu-emacs@gnu.org; Sun, 28 Apr 2024 03:23:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 28 Apr 2024 07:23:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70622 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 70622-submit@debbugs.gnu.org id=B70622.17142889539045 (code B ref 70622); Sun, 28 Apr 2024 07:23:02 +0000 Original-Received: (at 70622) by debbugs.gnu.org; 28 Apr 2024 07:22:33 +0000 Original-Received: from localhost ([127.0.0.1]:50023 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s0yro-0002Lp-I9 for submit@debbugs.gnu.org; Sun, 28 Apr 2024 03:22:32 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:42436) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s0yrl-0002Le-Tb for 70622@debbugs.gnu.org; Sun, 28 Apr 2024 03:22:30 -0400 Original-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 ) 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==; In-Reply-To: (bug-gnu-emacs@gnu.org) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:284079 Archived-At: > 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" > > 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.