Eli Zaretskii wrote: >> (x-set-selection 'PRIMARY value) >> ;should just stash value somewhere > > What would be the purpose of stashing the value ``somewhere''? The purpose is to emulate internally to emacs a primary selection facility otherwise missing from the platform in question. w32 emacs looks to have been treating the primary selection that way for the past 13 years or so. http://cvs.savannah.gnu.org/viewvc/emacs/lisp/w32-fns.el?revision=1.14&root=emacs&view=markup On recent w32 it might now be possible to use an accessibility API (at least with sufficient privileges) to record selections in some other applications, which might allow a closer to complete emulation of at least incoming primary, though it might be tricksy to actually implement and not especially worth it. > The > NEWS entry says: > > *** If `select-active-regions' is t, setting the mark automatically > makes the new region into the primary selection (for interaction with > other window applications). > Uh-huh. Note how it also says "makes the new region into the primary selection" ? > How can Emacs interact with other applications, if we just stash the > value in some internal variable? > Not all platforms have a primary selection as an OS-level entity in the first place, they only have a clipboard (well, the amiga actually had hundreds of distinct clipboards, but I'm not sure amiga support is worth worrying about even though AROS now exists), so emacs just has to interact with them via means other than a primary selection. But mixing up primary and clipboard within x-set-selection/x-get-selection/x-selection-owner-p is wrong not to mention phenomenally confusing. Waht's more, I suspect it also Just Won't Work Anyway, because on w32 AFAIK you set the system clipboard, on x11 you acquire the clipboard selection and applications ask you for the clipboard contents. Perhaps just regard select-active-regions as a feature aimed mostly at X11 users... If you do want select-active-regions to be able to affect the clipboard, a relatively sane way to do it would be to introduce customization variables: x-select-active-regions-enable-clipboard x-select-active-regions-enable-primary by analogy with x-select-enable-primary and x-select-enable-clipboard, that would allow customization of which selections to actually affect during select-active-regions. Note that x-select-enable-primary and x-select-enable-clipboard would be completely UNsuitable for reuse there, if you don't see why you probably haven't quite understood the issue. See attached (illstrative) patch.