emacs-devel
[Top][All Lists]
Advanced

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

Re: Improving X selection?


From: Jeremy Maitin-Shepard
Subject: Re: Improving X selection?
Date: Mon, 15 Oct 2007 15:26:53 -0400
User-agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.990 (gnu/linux)

Richard Stallman <address@hidden> writes:

>     The change, if any, I'd like is that C-y and M-w operates on CLIPBOARD, 
> and
>     that PRIMARY is left to mouse operations.

> ISTR that there are environments where it is bad to use the clipboard
> at all.  I don't remember what they are -- are there people that don't
> use the clipboard at all?

> Also, the basic idea seems mistaken.  When I select something in
> another program, I select it with the mouse because that's the only
> way.  That doesn't mean I should only be able to grab it in Emacs with
> the mouse.  C-y should work.

This is precisely the reason I am currently unsatisfied with the Emacs
selection handling.  I never use the mouse or toolbars in Emacs, but in
some programs (most notably terminal emulators like xterm) I have to use
the mouse to select text.

I'd like there to be some convenient way to paste either the PRIMARY
selection or the CLIPBOARD selection using only keyboard commands.
Currently, setting `x-select-enable-clipboard' to t (the way to get
Emacs to sometimes paste from the clipboard with C-y) has a rather
serious problem: the behavior of C-y becomes unpredictable, because it
uses an unreliable heuristic.  Specifically, it attempts to determine
which of the PRIMARY or CLIPBOARD selections is newer.  Unfortunately,
because it doesn't poll constantly, it has no way of actually
determining this, and instead just chooses the one that changed since
Emacs last checked, and prefers the clipboard if both have changed.  In
practice, much of the time that I am trying to paste something from
another program, both selections have changed since Emacs last checked,
so effectively it always chooses the clipboard, which means that pasting
from terminals does not work well.

It seems that at the very least this unreliable heuristic in Emacs
should be replaced by something better, because I can't see how it is
very useful for anyone.  If it is left in, there should at least be a
way to choose alternative behavior (like "only use the clipboard").

Perhaps the only real solution for me is to write a program that
effectively copies the text in PRIMARY to the CLIPBOARD, and bind this
program to some key like mod4-y.

-- 
Jeremy Maitin-Shepard




reply via email to

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