* interprogram-cut/paste-functions
@ 2005-08-02 12:52 Björn Lindström
0 siblings, 0 replies; only message in thread
From: Björn Lindström @ 2005-08-02 12:52 UTC (permalink / raw)
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)
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2005-08-02 12:52 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-08-02 12:52 interprogram-cut/paste-functions Björn Lindström
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).