The following works for me:
- Start
emacs-w32 -Q
- Paste the following code into the
*scratch*
-buffer:
(progn
(cua-mode)
(global-set-key [S-drag-mouse-1] (lambda (click) (interactive "e") (let (mouse-drag-copy-region) (mouse-set-region click))))
(global-set-key [S-down-mouse-1] 'mouse-set-point))
111
222
333
- Execute the
progn
-form with C-x C-e
- Select the string "111" with
mouse-1
(down
and drag
) and copy with C-c
- Shift-select the string "222" with
S-down-mouse-1
and S-drag-mouse-1
- Kill the shift-selected string with del
- Insert the string "111" from the
kill-ring
with the key C-v
If I execute M-x emacs-version
I get:
GNU Emacs 24.5.1 (x86_64-unknown-cygwin) of 2015-04-10 on desktop-new
It also works with
GNU Emacs 24.3.1 (i686-pc-linux-gnu, GTK+ Version 3.10.7) of 2014-03-07 on toyol, modified by Debian
Note, that del runs delete-forward-char
while C-x runs indirectly cua-cut-region
which copies the cut text to kill-ring
.
delete-forward-char
deletes the active region if the variable delete-active-region
is set to a non-nil value other than 'kill
. The standard setting is t
.
(global-set-key [S-drag-mouse-1] (lambda (click) (interactive "e") (let (mouse-drag-copy-region) (mouse-set-region click))))
?