I'm trying to get my text mode Emacs session to interoperate with my X
clipboard, using xsel (http://www.vergenet.net/~conrad/software/xsel/).
The following sort of works, except that when I yank something in Emacs,
the empty string gets pushed to kill-ring. I suspect that I
misunderstand when interprogram-paste-function is supposed to return
nil, but I need help figuring out how.
Here's my attempt so far:
(defun bkhl-cut-function (text &optional push)
(with-temp-buffer
(insert text)
(call-process-region (point-min) (point-max) "xsel" nil 0 "--input")))
(setq interprogram-cut-function 'bkhl-cut-function)
(defun bkhl-paste-function ()
(let ((text (with-output-to-string
(with-current-buffer standard-output
(call-process "xsel" nil standard-output nil "--output")))))
(unless (string= (car kill-ring) text)
text)))
(setq interprogram-paste-function 'bkhl-paste-function)
_______________________________________________
Help-gnu-emacs mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-gnu-emacs