help-emacs-windows
[Top][All Lists]
Advanced

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

Re: [h-e-w] Emacs and Windows Clipboard


From: David Vanderschel
Subject: Re: [h-e-w] Emacs and Windows Clipboard
Date: 04 Oct 2002 01:16:18 -0500

On Wednesday, October 02, "Chris Lott" <address@hidden> wrote:
>If I am in a windows app and copy a selection to the clipboard, I can then
>switch to Emacs and "yank" and paste the selection into an emacs buffer.

>If, after copying from the windows app, I kill something in the emacs buffer
>and then yank, M-y goes back through previous kill entries, but the
>clipboard contents from the windows app don't show up as I go back. Is there
>a way to fix this/make this work?

This may not be what Chris has in mind, but I like to
keep the emacs kill-ring more firmly separated from
the Windows Clipboard.  Here is what I have for this
in my initialization:


;; Disable routine Windows Clipboard action and bind 
;; S-insert and C-insert to explicit Clipboard actions.
;;
(setq x-select-enable-clipboard nil)
(global-set-key [S-insert]      'clipboard-yank)
(global-set-key [C-insert]      'clipboard-kill-ring-save)


The setq disables the feature of always putting what
is killed on the Windows Clipboard and of having yank
do a 'paste' when there is something new on the
Windows Clipboard.  If I want something to go to the
Windows Clipboard from emacs, then I use the
clipboard-kill-ring-save function explicitly.  If I
want to 'paste' what is on the Windows Clipboard, I
use the clipboard-yank function explicitly.  (I also
use a utility called Clipboard Pile, which makes the
Windows Clipboard behave like a stack in a manner
similar to the way the emacs kill-ring works.  Very
handy, but especially annoying if it is accumulating
_every_ kill from inside emacs.)

(I came to ntemacs from the OS/2 port of emacs in
which the behaviour I describe above was the default.
I never thought of the kill-ring in direct connection
with the OS clipboard, so I was initally upset with
the ntemacs behaviour until I found how easy it was to
change the default behaviour to that which I was used
to.)

I do not experience the symptom mentioned in Chris'
last paragraph.  When I do a clipboard-yank, the
pasted text _does_ go into the kill-ring and it _can_
be yanked subsequently from the kill-ring using M-y.
This is true independent of the setting of
x-select-enable-clipboard and (when not nil)
independent of whether the "paste" was achieved by
regular yank or clipboard-yank.  However, even if it
is no longer going into the kill-ring in version 21 (a
change I would welcome), disabling the effect on the
Clipboard of killing text would assure that
clipboard-yank can still access the (unchanged)
content of the Windows Clipboard.

I am running emacs version 20.7.3 on Windows 98.

Regards,
  David V.





reply via email to

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