[Top][All Lists]

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

Re: select-active-regions

From: David De La Harpe Golden
Subject: Re: select-active-regions
Date: Mon, 20 Jul 2009 01:22:20 +0100
User-agent: Mozilla-Thunderbird (X11/20090701)

Eli Zaretskii wrote:

> > When killing, emacs on X11 places text in
> > primary if x-select-enable-primary is t
> > clipboard if x-select-enable-clipboard is t
> >
> > When yanking, emacs on x11 gets text from
> > primary if x-select-enable-primary is t
> > clipboard if x-select-enable-clipboard is t

Since Windows only has the clipboard, putting and getting text from
there is the best it can do to emulate X in this regard.

For emulating an X11 clipboard, sure, that makes sense. Not for emulating an X11 primary. They are different things. And "in this regard" in the above is really in regard to killing and yanking, not

> As I explained elsewhere in this thread, Emacs on DOS and Windows
> thrashes the clipboard all the time anyway.  So anyone using Emacs on
> Windows ought to be accustomed to that already.  I know I am.

? Surely it only updates the system clipboard if you:
 * explicitly kill
 * {mouse-select text with mouse-drag-copy-region non-nil}

Normally though not necessarily, people who (setq select-active-regions t) would (setq mouse-drag-copy-region nil).

A basic point of select-active-regions is to allow, when selecting text with either the mouse or keyboard:
 * don't affect kill-ring_and_clipboard
 * affect primary

( x11 emacs users: you may or may  not agree with that spec. Please note
this is all carefully-kept-optional stuff.)

If we want such an option to be available to non-X platforms, we
should let users customize it in ways that are not specific to X.
What we have now in that area is horribly system-dependent.

There's some truth in that. Funny enough, I did in fact propose various revised schemes in 2007/2008 era which were less x11-y but were not eventually adopted. IMO they tried a bit too hard to be all things to all people, so became quite complex, eventually a big list of sources and a big list of destinations for each possible interaction that you could plumb together with a big matrix of boolean customizations. Sticking to things people definitely want might keep things simpler if less symmetrical.

Anyway - You apparently want a select-active-regions that clobbers the clipboard on w32 just like it quite deliberately avoids doing on x11. It sounds quite horrible, but it's doable. It's doable in a couple of ways:

1. the way that means it appears and works much the same on all platforms:

1.1. If the platform has a clipboard, allow turning on and off select-active-regions affecting the clipboard. This is like the way you can turn on and off kill and yank affecting the clipboard on both x11 and w32.

1.2. If the platform has a primary, allow turning on and off select-active-regions affecting the primary
This is like the way you can turn on and off kill and yank affecting
the primary on x11.

2. and the way that makes an unnecessary mess
 2.1. confuse clipboards and primaries at a deep level.

I recommend 1.

w32 presently uses x-select-enable-clipboard to control clipboard use AFAICS with much the same meaning as on x11. Yes it says "x-select-", but it probably should really be called "kill-and-yank-both-use-clipboard" given what it actually does on both platforms (AFAICS in the w32 case, since I haven't run it yet)

Anyway, an x-select-active-regions-enable-clipboard boolean customization could similarly control use of clipboard, only for select-active-regions not kill-and-yank, on w32 or x11. Can call it select-active-regions-enable-clipboard if you want to avoid "x-"

> Introduce  a portable customizable option for separating these
> two features, and I'm with you.

It might take a few days for me at least to come up with something
that actually works on w32, because of "lazy vs. eager" (not me,
the clipboard semantics).

Well, I did ask for a detailed explanation.

select-active-regions arranges to make primary correspond to the contents of the active region while the region is active. That's
what it's for.

reply via email to

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