开发者

emacs copy kill-ring to system clipboard in nowindow mode

I'm running "emacs -nw" under terminator program in Ubuntu. My issue, I couldn't g开发者_开发技巧et kill-ring to system clipboard with that. However, things works if run in X11 mode. Could you please help me with that?.

Thanks in advance..


Emacs in "nw" mode is not linked to any of the X11 libraries. Because of this, you have no access to the X11 clipboard. In other words, this just isn't possible by itself. There are utilities that allow command-line access to and from the X11 clipboard. You would have to write some elisp code to tie kill-ring activity to whatever command-line tools you may use.

One such program you might look at is xclip. Getting the selection from the kill-ring into the clipboard won't be as hard as getting from the clipboard into the kill-ring. This is because you have control over the event when you add to the kill-ring. But emacs has no knowledge of when X11 updates the clipboard. So you may have to have a custom command rather than the typical yanking from kill-ring, one that uses xclip to fetch the current clipboard content.

This seems to me like something that someone would have already solved. I don't know enough elisp to tackle it by any measure, or I'd dig into it myself. I did find this blog post that points to an elisp library that wraps xclip. I don't know if that will help or not.

Randy

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜