Stefan Monnier wrote: > Sorry, don't mind me, I was completely confused. > > No worries. Anyway, there's probably a much more elegant way: (Background: I «gasp» read the docstring for x-set-selection, and _thought_ I'd found a better way - it can take a cons of markers to _lazily_ find the selection data as whatever's between the markers when something requests the selection. However, it turns out that the emacs point is _not_ in fact a marker, so you can't use mark-marker and point-marker to find the region on-demand (point-marker just returns a marker to the instantaneous position of the point)) *** Sooo - Here's a solution that seems generally saner, though does wander deeper into the emacs core - allow x-set-selection to take a function that will be funcalled on demand to return a string to use as the selection data, not just a cons of markers. Avoids performance issues that the moronic string-equal or hash in the timer would introduce, and the (theoretical, for inhumanly fast users) potential flakiness of an idle timer.