Function: set-window-cursor-type

set-window-cursor-type is a function defined in window.c.

Signature

(set-window-cursor-type WINDOW TYPE)

Documentation

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. The initial value for new windows is t, which says to respect the buffer-local value of cursor-type.

WINDOW nil means use the selected window. This setting persists across buffers shown in WINDOW, so set-window-buffer does not reset it.

View in manual

Probably introduced at or before Emacs version 30.1.

Source Code

// Defined in /usr/src/emacs/src/window.c
{
  struct window *w = decode_live_window (window);

  if (!(NILP (type)
	|| EQ (type, Qt)
	|| EQ (type, Qbox)
	|| EQ (type, Qhollow)
	|| EQ (type, Qbar)
	|| EQ (type, Qhbar)
	|| (CONSP (type)
	    && (EQ (XCAR (type), Qbox)
		|| EQ (XCAR (type), Qbar)
		|| EQ (XCAR (type), Qhbar))
	    && INTEGERP (XCDR (type)))))
    error ("Invalid cursor type");

  wset_cursor_type (w, type);

  /* Redisplay with updated cursor type.  */
  wset_redisplay (w);

  return type;
}