Emacs支持外部程序的粘贴
2017-05-03 16:17
197 查看
1、Linux图形化版本
在.emacs加入:
(setq x-select-enable-clipboard t)
这种方法仅对图形化emacs有效,如果用 emacs -nw 命令打开emacs的话,在命令行中是无效
2、Mac图形化与命令行版本
在.emacs加入:
(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)
3、Linux命令行版本
在.emacs加入:
适用于linux下的配置(http://hugoheden.wordpress.com/2009/03/08/copypaste-with-emacs-in-terminal/)
在.emacs加入:
(setq x-select-enable-clipboard t)
这种方法仅对图形化emacs有效,如果用 emacs -nw 命令打开emacs的话,在命令行中是无效
2、Mac图形化与命令行版本
在.emacs加入:
(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)
3、Linux命令行版本
在.emacs加入:
适用于linux下的配置(http://hugoheden.wordpress.com/2009/03/08/copypaste-with-emacs-in-terminal/)
(setq x-select-enable-clipboard t) (unless window-system (when (getenv "DISPLAY") (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) ))
相关文章推荐
- 在用Emacs Lisp调用外部程序
- 将emacs选中的内容复制到外部程序
- 让你的delphi程序支持外部参数
- 外部程序调用跨数据库的语句时:该事务管理器已经禁止了它对远程/网络事务的支持
- 让go语言调用外部程序时支持管道符
- emacs 运行外部程序
- 让你的程序支持插件
- 请教一个关于WEBFORM 调用外部EXE程序的问题
- 写了个下载程序 支持Socks5代理
- CreateProcess 运行外部或DOS程序
- 如何使Emacs支持C#
- Shark中调用外部程序的方法
- IIS下配置ActivePerl,使IIS支持CGI程序
- 使用VSA给程序加上脚本支持
- 让Windows 2003 Server支持ASP程序
- 怎样编写支持多国语言的程序, 让它能够根据所运行的操作系统自动显示相应的文字。
- 如何使用java程序界面上的按钮启动外部的exe程序
- 【原创醒目】为汉字注音的C程序代码,支持win32下C编译的都能用!
- 调用cmd.exe程序和外部程序(转)
- PHP中运行只有root用户才可以运行的外部程序