mac emacs 共享剪切板

使用 bpcopy 和bppaste 替代剪切  x-clipborad

elisp code :

;;osx should using pbpaste and pbcopy to share clipboard

(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))))





(when (string= system-type "darwin")

        (setq interprogram-cut-function 'paste-to-osx)

        (setq interprogram-paste-function 'copy-from-osx))

 

你可能感兴趣的:(emacs)