[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Emacs (in terminal): keeping clipboard synchronized with the system
Re: Emacs (in terminal): keeping clipboard synchronized with the system global one?
Sun, 8 Mar 2009 20:27:03 +0100
On Sun, Mar 8, 2009 at 3:37 PM, Miles Bader <address@hidden> wrote:
> Hugo Heden <address@hidden> writes:
>> (global-set-key "\M-w" 'ext-kill-ring-save)
>> (global-set-key "\C-w" 'ext-kill-region))
> Instead of redefining the keys, you should probably set the variables
> `interprogram-cut-function' and `interprogram-paste-function'
> (which are used by the default commands).
Thanks a lot Miles, yes I realized that after a while (as noted on
) -- the following works well:
(global-set-key "\C-w" 'clipboard-kill-region)
(global-set-key "\M-w" 'clipboard-kill-ring-save)
(global-set-key "\C-y" 'clipboard-yank)
(defun xsel-cut-function (text &optional push)
(call-process-region (point-min) (point-max) "xsel" nil 0 nil
(let ((xsel-output (shell-command-to-string "xsel -o")))
(unless (string= (car kill-ring) xsel-output)
(setq interprogram-cut-function 'xsel-cut-function)
(setq interprogram-paste-function 'xsel-paste-function)