[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: mouse-yank-primary and bug #7699

From: Eli Zaretskii
Subject: Re: mouse-yank-primary and bug #7699
Date: Wed, 22 Dec 2010 21:17:29 +0200

> Date: Wed, 22 Dec 2010 15:16:59 +0000
> From: David De La Harpe Golden <address@hidden>
> CC: address@hidden, Djärv <address@hidden>
> Remember that w32 x-get-selection-value follows the funny 
> interprogram-paste-function protocol intended for kill-ring interactions 
> that returns nil if the text has already been got. It _is_ w32's 
> interprogram-paste-function after all!
> So when you click mouse-2 on w32, you presently might get the clipboard, 
> or you might get the emulated primary, depending on fairly complex 
> (though deterministic) details of the interaction path leading up to the 
> mouse-2 click. If you were to remove the call to x-get-selection on w32, 
> you'd get the clipboard once (probably) and then nowt for subsequent 
> clicks.
> If you were to remove the call to x-get-selection-value that was 
> inserted, on w32 you should get the emulated primary on all clicks if it 
> is available, consistent with the function name "mouse-yank-primary", 
> and bearing in mind it might or might not currently be being updated 
> properly elsewhere on w32 (I haven't looked recently).

Thanks.  I know all that.  My question was about this pair of calls on
X, not about Windows.

> But wait - why does X11 now have and call a function called 
> x-get-selection-value, then?  It was introduced because someone amended 
> mouse-yank-primary to call the function called x-get-selection-value if 
> it existed (which at the time it only did on w32/dos), then someone else 
> decided to fix a bug by reusing the name and call site on x11.
> 2010-08-14  Eli Zaretskii  <address@hidden>
>       * mouse.el (mouse-yank-primary): Fix mouse-2 on MS-Windows and
>       MS-DOS.  (Bug#6689)
> bzr diff -r101079..101080
> 2010-10-31  Jan Djärv  <address@hidden>
>       * term/x-win.el (x-get-selection-value): New function that gets
>       PRIMARY with type as specified in x-select-request-type. (Bug#6802).
>   bzr diff -r102166..102167

I know this as well.  But I trust Jan that if he made that change, he
had a good reason for it.  I just don't know what was that reason.  My
guess is that he wanted to call x-selection-value-internal, instead of
x-get-selection, that's all.

> So x11 x-get-selection-value is a function with the same name as one on 
> w32 but very different behaviour, that always returns the primary value 
> if available, handling encodings. It is is _not_ X11's 
> interprogram-paste function (that's x-selection-value, "obviously"...).

Yes, I know.  The very different semantics of x-get-selection-value on
DOS and Windows is because in other situations this is what users
expect from code that calls x-get-selection-value.  Again, this is not
what I need help with.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]