[Top][All Lists]

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

Re: Improving X selection?

From: David De La Harpe Golden
Subject: Re: Improving X selection?
Date: Fri, 8 Feb 2008 02:50:44 +0000

On 07/02/2008, Stefan Monnier <address@hidden> wrote:
>> From what I can tell, there are 4 kinds of selections:
> >> - C-SPC + mouse movement.  I.e. select-only.
>              ^^^^^
>              cursor
> Duh!
> >> - same plus C-w.
> >> - selection with the mouse.
> >> - one of the above plus "copy" from the menu.
> >>
> >> No 4 should always use the CLIPBOARD.
> >> No 3 should always use the PRIMARY (plus optionally CLIPBOARD)
> >> No 2 may optionally use PRIMARY (plus optionally CLIPBOARD)
> >> No 1 should use neither or at most PRIMARY.
> >>
> >> I believe that currently No 2 and No 3 are always handled in the same
> >> way, and I don't know if we want to bother separating them.
> > I'm not 100% sure what you meant by "selection with mouse" there :
> > No 1 covers "selection [only] with mouse".
> Yes, sorry, the "mouse movement" above was a typo.

Okay, your 2. and 3. are already not necessarily handled the same way
in existing emacs - mouse-drag-copy-region nil exists to make
mouse-drag selection act like 1 only with the mouse.

[Aside: Part of the patch was just to make a setting for mouse-save-then-kill
(mouse-3) analogous to mouse-drag-copy-region for mouse-drag... -
mouse-save-then-kill-copy-region. Like a standalone fix for
select-active-regions, it could be a standalone thing applied
independent of rest of patch]

So, by setting mouse-drag-copy-region to nil and select-active-regions to t,
and sending to CLIPBOARD and kill ring for C-w and to PRIMARY in
select-active-regions,  outgoing freedesktop.org compliant behaviour
can be achieved while unifying the clipboard and kill ring.

> >> Why do you need `interprogram-highlight-function'?  Can't you just use
> >>
> >> (let ((x-select-enable-clipboard nil))
> >> (kill-ring-save beg end))
> >>
> >> like clipboard-kill-ring-save does?
> > No, that would affect the kill ring!
> Then add x-select-enable-kill-ring.  Big deal.

Do you mean as a customization telling select-active-regions not to
use kill-ring-save but rather its own call to
interprogram-cut-function with the locally rebound
x-select-enable-clipboard*? Or telling kill-ring-save to not use the
kill ring (heh)?

*And, er, then what if the heretic freedesktop.org-scorning user
/wants/ selection to affect the clipboard, like an xterm with "select
to clipboard" turned on?   The patch handles that situation fine.

I still think an interprogram-select/insert-function is simpler.
Selection and insertion are plain different interprogram operations to
cut/copy and paste after all.  In fact, outside X11, they're not even
interprogram operations.

reply via email to

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