Emacs: How to separate the kill ring from the syst

2019-06-28 08:49发布

问题:

By default Emacs 23.x seems to copy content that's killed to the kill ring and to the system clipboard. Is it possible to keep the kill ring and clipboard separate?

As in, ctrl+k puts stuff on the kill ring, cmd+x puts stuff on the system clipboard and leaves the kill ring alone.

回答1:

That was discussed in this thread:

Setting interprogram-cut-function to nil should do the trick.

if I do a selection the Windows way and do a Ctrl-C or CTRL-Insert, then whatever I selected should be copied to the clipboard.

I think there's no way of doing this out of the box, but you should be able to write a simple command that calls x-select-text, and bind it to whatever keys you want.



回答2:

Put into your .emacs file:

(setq interprogram-cut-function nil)