简体   繁体   English

无法在Emacs中复制文本并粘贴到另一个应用程序中

[英]Cannot copy text in Emacs and paste into another application

I'm running GNU Linux and GNU Emacs 23.4.2 我正在运行GNU Linux和GNU Emacs 23.4.2

When I copy text in Emacs (with Mw , or in CUA mode Cc ) and then type Cv in some other application to try to paste the copied text, it doesn't work -- the text from Emacs is not pasted. 当我在Emacs中复制文本(使用Mw或CUA模式Cc )然后在其他应用程序中键入Cv以尝试粘贴复制的文本时,它不起作用 - 不粘贴Emacs中的文本。

However, when I instead copy the text using the Emacs menus (Edit->Copy), this works -- I can successfully paste the copied text into another application with Cv . 但是,当我使用Emacs 菜单 (编辑 - >复制)复制文本时,这是有效的 - 我可以成功将复制的文本粘贴到另一个带有Cv的应用程序中。

How can I fix this, so that copying via the keybindings works the same as copying via the menus? 我该如何解决这个问题,以便通过键绑定进行复制与通过菜单进行复制相同?

Read the manual , section 25.1.5 Using the Clipboard : 阅读手册 ,第25.1.5使用剪贴板

You can customize the variable x-select-enable-clipboard to make the Emacs yank functions consult the clipboard before the primary selection, and to make the kill functions to store in the clipboard as well as the primary selection. 您可以自定义变量x-select-enable-clipboard以使Emacs yank函数在主选择之前查阅剪贴板,并使kill函数存储在剪贴板中以及主要选择中。 Otherwise, these commands do not access the clipboard at all. 否则,这些命令根本不会访问剪贴板。

You should probably also read section 25.1.3 Cut and Paste with Other Window Applications . 您可能还应阅读第25.1.3节“ 剪切和粘贴其他窗口应用程序”

把它放在你的.emacs中(setq x-select-enable-clipboard t)

Just try 试一试

(cua-mode t)

instead. 代替。

See also here: http://www.emacswiki.org/emacs/CuaMode 另见: http//www.emacswiki.org/emacs/CuaMode

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM