Variable: x-lost-selection-functions

A list of functions to be called when Emacs loses an X selection.
(This happens when some other X client makes its own selection
or when a Lisp program explicitly clears the selection.)
The functions are called with one argument, the selection type
(a symbol, typically `PRIMARY', `SECONDARY', or `CLIPBOARD').