Variable: window-selection-change-functions

window-selection-change-functions is a variable defined in window.c.

Value

nil

Documentation

Functions called during redisplay when the selected window has changed.

The value should be a list of functions that take one argument.

Functions specified buffer-locally are called for each window showing the corresponding buffer if and only if that window has been selected or deselected since the last redisplay. In this case the window is passed as argument and the respective buffer is temporarily made current.

Functions specified by the default value are called for each frame if the frame's selected window has changed since the last redisplay. In this case the frame is passed as argument.

View in manual

Probably introduced at or before Emacs version 27.1.

Source Code

// Defined in /usr/src/emacs/src/window.c
  DEFVAR_LISP ("window-selection-change-functions", Vwindow_selection_change_functions,
	       doc: /* Functions called during redisplay when the selected window has changed.
The value should be a list of functions that take one argument.

Functions specified buffer-locally are called for each window showing
the corresponding buffer if and only if that window has been selected or
deselected since the last redisplay.  In this case the window is passed
as argument and the respective buffer is temporarily made current.

Functions specified by the default value are called for each frame if
the frame's selected window has changed since the last redisplay.  In
this case the frame is passed as argument.  */);