2

I am using Emacs 24.4 on Windows 10. I only ever use it in -nw (no-window) mode.

I would like Emacs to paste from the Windows clipboard only on Shift-Insert and not on yank (Ctrl-y). I have tried this:

(setq x-select-enable-clipboard nil)
(setq x-select-enable-primary nil)

but this disables pasting from the Windows clipboard on both Shift-Insert and yank. I want Shift-Insert to paste only from the Window clipboard and yank to paste only from the Emacs kill ring.

Here is an example of what I want:

  1. Copy the text hello to the Windows clipboard.
  2. Start emacs.
  3. Do a yank (Ctrl-y); desired result: nothing is inserted.
  4. Do a Shift-Insert; desired result: hello is inserted.

Is this possible? If so, how?

2 Answers 2

2

By default (at least in Emacs 25), <S-Insert> is bound to the same command as C-y: they both invoke the yank command.

You could try rebinding one of the them to clipboard-yank instead.

(global-set-key (kbd "<S-Insert>") #'clipboard-yank)
1
  • This does not achieve my desired result, namely, that the yank buffer is separate from the clipboard buffer. Binding the key as you suggest, I still get the clipboard buffer when I do a yank.
    – rlandster
    Jan 25, 2017 at 4:26
1

Try simpleclip. I believe it does exactly what you want, keeping a distinct clipboard to interact with the system, separate from emacs's kill ring.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.