|
From: | David De La Harpe Golden |
Subject: | Re: mouse-yank-primary and bug #7699 |
Date: | Thu, 23 Dec 2010 16:38:27 +0000 |
User-agent: | Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.16) Gecko/20101211 Icedove/3.0.11 |
On 23/12/10 09:08, Eli Zaretskii wrote:
All this selection stuff is a bit messy now.
>
Ideally x-get-selection should use x-select-request-type and we could reduce the number of function that gets selection on X. However, one would have to check all platforms and all uses of the current routines to do a good refactoring.One way forward would be for Someone™ to suggest the refactoring on X, and then ask experts for other platforms to adapt the platform-specific emulations to that.
That sorta presupposes continuation of the "make other platforms emulate x11" approach. In this area, interposing another layer of indirection/abstraction might be more appropriate.
Actually we have half a (slightly strange) one (interprogram-blah) that's used in some areas, but then other places use the x11y layer "below" directly. So there's a "level mixed" api thing going on, and I reckon a fair bit of the messy is arising _because_ of that.
Jan just suggested expanding x-get-selection directly, but desire for its expansion may be arising mostly because it currently constitutes part of said level mixed api. There shouldn't _be_ those direct calls to x-get-selection and x-set-selection in mouse.el and simple.el*, they should be hidden behind interprogram-get-selection-function and interpogram-set-selection-function (or something), like the way in the clipboard case they're hidden behind interprogram-cut-function and interprogram-paste-function.
(Alternatively existing stabs at cross platform abstraction should be ripped out and the exact x11 api used consistently (whether real or emulated on the various platforms) rather than the current muddle, but I suspect that's a rather less attractive option for most people)
P.S. there's the multitty can of worms to worry about. Sometimes it works out vaguely okay implicitly - the real x11 apis use the current frame's x11 display IIRC. Other times I suspect not so much.
(* despite my name being pretty directly attached to some of the changes, I don't view them as ideal. Some earlier attempts by myself to introduce such an abstraction layer were shot down, possibly because I didn't articulate well enough why it was desirable going on necessary)
[Prev in Thread] | Current Thread | [Next in Thread] |