From: Eshel Yaron Date: Sat, 18 May 2024 19:12:00 +0000 (+0200) Subject: Revert "New window parameter 'cursor-type'" X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=f7ac86d8fec2f4ebf8311ec1c1cdde3227fbd0df;p=emacs.git Revert "New window parameter 'cursor-type'" This reverts commit bab56b25149d5f86ac82272a3646893dfb58c41e. --- diff --git a/doc/lispref/frames.texi b/doc/lispref/frames.texi index b79879063fb..cae93acae9f 100644 --- a/doc/lispref/frames.texi +++ b/doc/lispref/frames.texi @@ -2341,9 +2341,8 @@ Display a horizontal bar @var{height} pixels high. @end table @vindex cursor-type -The @code{cursor-type} frame parameter may be overridden by the window -parameter @code{cursor-type} (@pxref{Definition of cursor-type window -parameter}), and by the variables @code{cursor-type} and +The @code{cursor-type} frame parameter may be overridden by the +variables @code{cursor-type} and @code{cursor-in-non-selected-windows}: @defopt cursor-type diff --git a/doc/lispref/windows.texi b/doc/lispref/windows.texi index 8b11f642066..34f7b260a52 100644 --- a/doc/lispref/windows.texi +++ b/doc/lispref/windows.texi @@ -6691,19 +6691,6 @@ applications that use large margins to center buffer text within a 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} -@anchor{Definition of cursor-type 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. -This window parameter takes precedence over the @code{cursor-type} -variable when the window is selected. For non-selected windows, the -variable @code{cursor-in-non-selected-windows} takes precedence. @end table diff --git a/etc/NEWS b/etc/NEWS index f774cb81eda..1f7d39d65d4 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -319,12 +319,6 @@ and 'window-state-get'. Then later another new variable 'window-state-put' to restore positions of window points according to the context stored in a window parameter. -+++ -*** 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'. - ** Tab Bars and Tab Lines --- diff --git a/src/window.c b/src/window.c index 95df13e22ed..aac5b087c2c 100644 --- a/src/window.c +++ b/src/window.c @@ -2401,10 +2401,6 @@ Return VALUE. */) (w, Fcons (Fcons (parameter, value), w->window_parameters)); else Fsetcdr (old_alist_elt, value); - - if (EQ (parameter, Qcursor_type)) - mark_window_display_accurate (window, false); - return value; } diff --git a/src/xdisp.c b/src/xdisp.c index 85f62a83f9e..63ff8670b79 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -33604,7 +33604,7 @@ get_window_cursor_type (struct window *w, struct glyph *glyph, int *width, struct frame *f = XFRAME (w->frame); struct buffer *b = XBUFFER (w->contents); int cursor_type = DEFAULT_CURSOR; - Lisp_Object alt_cursor, win_cursor; + Lisp_Object alt_cursor; bool non_selected = false; *active_cursor = true; @@ -33616,13 +33616,7 @@ get_window_cursor_type (struct window *w, struct glyph *glyph, int *width, { if (w == XWINDOW (echo_area_window)) { - win_cursor = window_parameter (w, Qcursor_type); - if (!NILP (win_cursor)) - return get_specified_cursor_type (EQ (win_cursor, Qnone) - ? Qnil - : win_cursor, - width); - else if (EQ (BVAR (b, cursor_type), Qt) || NILP (BVAR (b, cursor_type))) + if (EQ (BVAR (b, cursor_type), Qt) || NILP (BVAR (b, cursor_type))) { *width = FRAME_CURSOR_WIDTH (f); return FRAME_DESIRED_CURSOR (f); @@ -33649,27 +33643,18 @@ get_window_cursor_type (struct window *w, struct glyph *glyph, int *width, non_selected = true; } - win_cursor = window_parameter (w, Qcursor_type); - if (!NILP (win_cursor)) - cursor_type = get_specified_cursor_type (EQ (win_cursor, Qnone) - ? Qnil - : win_cursor, - width); - else - { - /* Never display a cursor in a window in which cursor-type is nil. */ - if (NILP (BVAR (b, cursor_type))) - return NO_CURSOR; + /* Never display a cursor in a window in which cursor-type is nil. */ + if (NILP (BVAR (b, cursor_type))) + return NO_CURSOR; - /* Get the normal cursor type for this window. */ - if (EQ (BVAR (b, cursor_type), Qt)) - { - cursor_type = FRAME_DESIRED_CURSOR (f); - *width = FRAME_CURSOR_WIDTH (f); - } - else - cursor_type = get_specified_cursor_type (BVAR (b, cursor_type), width); + /* Get the normal cursor type for this window. */ + if (EQ (BVAR (b, cursor_type), Qt)) + { + cursor_type = FRAME_DESIRED_CURSOR (f); + *width = FRAME_CURSOR_WIDTH (f); } + else + cursor_type = get_specified_cursor_type (BVAR (b, cursor_type), width); /* Use cursor-in-non-selected-windows instead for non-selected window or frame. */