emacs-devel
[Top][All Lists]
Advanced

[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: Sun, 3 Feb 2008 11:38:19 +0000

On 02/02/2008, David De La Harpe Golden wrote:
> (Some mouse.el interactions need additional options too I think - yet
> another mail to follow with them...)

See attached patch (n.b. depends on previously sent patch
"enhanced-x-selection.diff", guess l should do an aggregate patch with
all proposed stuff...)

Goal here was mouse behaviour that fits in nicely with
select-active-regions, three main issues (one for each button as it
happens...):


*** 1. mouse-set-point vs. select-active-regions issue:

Add a deactivate-mark in mouse-set-point: This prevents copying
different text than expected to primary when select-active-regions is
true and you mouse-1 click to move the point (otherwise it ends up
setting the X11 selection to the region between the mark and new place
you clicked, which is not right).

However blindly deactivating the mark when the mouse is used to set
the point may be a bit too heavy-handed/sweeping, there may be
subtleties I haven't spotted?


*** 2. mouse-save-then-kill-copy-region:

Similar to mouse-drag-copy-region, only for mouse-3 clicks rather than
mouse-1 drags: allows mouse-save-then-kill to possibly:

nil =>  merely adjust active region

t => original behaviour: single-click: save double-click: kill.

:double => require "one more click" over original behaviour, i
.e. single click just for adjustment of region, double-click for kill
ring save, and triple click for kill.

Note that while select-active-regions is on, adjusting the active
region might set the primary x11 selection, and if
mouse-save-then-kill does interact with the kill ring, it might
(indirectly) set the clipboard x11 selection via the
interprogram-cut-function called by the kill routines.

Not hugely happy with my ad-hoc changes to mouse-save-then-kill code
to add this, I guess the function could be rewritten more clearly, but
at least the "nil" new behaviour is need for mouse interaction to be
unsurprising when select-active-region is on, and I then just thought
the :double behaviour was a useful option to add.


*** 3. mouse-yank-at-click-action,

introduces X11-like lightweight insert operation, allows mouse-2
mouse-yank-at-click to possibly just paste in a  selection from
(introduced) interprogram-lightins-function (*) rather than yanking
from kill ring.

x-select-enable-[primary|clipboard|cutbuffer] customizations also expanded,
added a fourth kind of operation, :lightins, to go with the X11
interprogram-lightins-function, that is to say
x-cut-buffer-or-selection-value-for-lightins

* interprogram-[cut|paste]-function and
interprogram-[highlight|lightins]-function are notionally paired. (Of
course in another sense cut/highlight being output from emacs
functions and paste/lightins being input to emacs functions make
pairs), yay for symmetry.

Attachment: mouse-behaviours-nice-with-select-active-regions.diff
Description: Text Data


reply via email to

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