Ubuntu 退出emacs的时候saving to x clipboard manager要卡很久怎么办?

Ubuntu 退出emacs的时候saving to x clipboard manager要卡很久怎么办?

如图,从emacs外复制到emacs中粘贴,然后在emacs中执行kill yank动作之后,退出emacs卡这个地方要卡很久.有时候系统都卡死了. 你们怎么解决的?

----------------解决办法-------------------------- 请教了QQ群里的大神。给了一个网址 https://m.baidu.com/from=1017188c/bd_page_type=1/ssid=0/uid=0/pu=usm%402%2Csz%40320_1003%2Cta%40iphone_2_6.0_1_/baiduid=FCEA34A0FA4FED6041D715104D94EE87/w=0_10_/t=iphone/l=3/tc?ref=www_iphone&lid=2088141867668452841&order=1&fm=alop&tj=www_normal_1_0_10_title&vit=osres&m=8&srd=1&cltj=cloud_title&asres=1&title=Clipboard-GNUEmacsManual&dict=32&w_qd=IlPT2AEptyoA_yi5IU_eCGEEfwXLKrGkGRODMW-N1zSvmkip&sec=23655&di=8846309e5ac33d11&bdenc=1&tch=124.0.69.242.0.0&nsrc=IlPT2AEptyoA_yixCFOxXnANedT62v3IEQGG_ydKB8S6j5byqRLwHtBuVT0hNTrIBUD9xWGRxBt8bSX-KjVqzBAxhOgtf5R6lCmwgPq3tcjPTdU1fLMX2tfSSisd9ui5l3t8uK&eqid=1cfa91f716ffb6001000000659a978a0&wd=&clk_info=%7B%22srcid%22%3A%221599%22%2C%22tplname%22%3A%22www_normal%22%2C%22t%22%3A1504278694319%2C%22sig%22%3A%224597%22%2C%22xpath%22%3A%22div-a-h3-em%22%7D&sfOpen=1&sfr_fb=0&qq-pf-to=pcqq.group

里面提到

Many X desktop environments support a feature called the clipboard manager. If you exit Emacs while it is the current “owner” of the clipboard data, and there is a clipboard manager running, Emacs transfers the clipboard data to the clipboard manager so that it is not lost. In some circumstances, this may cause a delay when exiting Emacs; if you wish to prevent Emacs from transferring data to the clipboard manager, change the variable x-select-enable-clipboard-manager to nil.

大概意思时emacs退出时保存数据到桌面的剪切板管理器,某些情况下会导致卡顿。解决方法就是在init.el文件中增加如下代码

(setq x-select-enable-clipboard-manager nil)

不解决,没有这个问题

参考:editor - How to stop Emacs from "contaminating" the clipboard? - Stack Overflow

(setq x-select-enable-clipboard nil) (global-set-key (kbd “C-y”) 'x-clipboard-yank) (global-set-key (kbd “C-w”) 'clipboard-kill-region) (global-set-key (kbd “M-w”) 'clipboard-kill-ring-save)