Menu

Add the system clipboard to the Emacs kill-ring

This post was originally titled “Prevent Emacs wiping the system clipboard”, which was a rubbish description of what this tip actually covers, so I renamed it! Apologies if you see it twice in your RSS reader.

By default, if you copy something to the system clipboard (e.g. some text in firefox) and then copy or kill some text in Emacs, then the text from firefox is lost. If you set the option below in your emacs config file then copying or killing text in Emacs will add the system clipboard text to the kill-ring so that you can find it when you cycle through your clipboard history in Emacs.

;; Save whatever’s in the current (system) clipboard before;; replacing it with the Emacs’ text.;; https://github.com/dakrone/eos/blob/master/eos.org(setq save-interprogram-paste-before-kill t)