How to copy text from Emacs to another application on Linux

后端 未结 13 2291
被撕碎了的回忆
被撕碎了的回忆 2020-12-07 07:29

When I cut (kill) text in Emacs 22.1.1 (in its own window on X, in KDE, on Kubuntu), I can\'t paste (yank) it in any other application.

相关标签:
13条回答
  • 2020-12-07 08:26

    This works with M-w on Mac OSX. Just add to your .emacs file.

    (defun copy-from-osx ()
       (shell-command-to-string "pbpaste"))
    (defun paste-to-osx (text &optional push)
       (let ((process-connection-type nil))
          (let ((proc (start-process "pbcopy" "*Messages*" "pbcopy")))
             (process-send-string proc text)
             (process-send-eof proc))))
    
    (setq interprogram-cut-function 'paste-to-osx)
    (setq interprogram-paste-function 'copy-from-osx)
    

    Source https://gist.github.com/the-kenny/267162

    0 讨论(0)
提交回复
热议问题