将Emacs复制粘贴与系统复制粘贴集成

将Emacs复制粘贴与系统复制粘贴集成,第1张

将Emacs复制/粘贴与系统复制/粘贴集成

这适用于我的机器:

;; CUA OS copypasta even in ncurses mode(case system-type  ('darwin (unless window-system  (setq interprogram-cut-function        (lambda (text &optional push)          (let* ((process-connection-type nil)      (pbproxy (start-process "pbcopy" "pbcopy" "/usr/bin/pbcopy"))) (process-send-string pbproxy text) (process-send-eof pbproxy))))))  ('gnu/linux (progn     (setq x-select-enable-clipboard t)     (defun xsel-cut-function (text &optional push)       (with-temp-buffer         (insert text)         (call-process-region (point-min) (point-max) "xsel" nil 0 nil "--clipboard" "--input")))     (defun xsel-paste-function()       (let ((xsel-output (shell-command-to-string "xsel --clipboard --output")))         (unless (string= (car kill-ring) xsel-output)xsel-output )))     (setq interprogram-cut-function 'xsel-cut-function)     (setq interprogram-paste-function 'xsel-paste-function))))


欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/zaji/4959490.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-11-13
下一篇 2022-11-13

发表评论

登录后才能评论

评论列表(0条)

保存