18

刚刚在 Windows 7 下安装了 Emacs 24

尝试在 emacs 中剪切和粘贴(kill & yank)时出现以下错误,例如

C-k, C-y

杀死一行并将其复制到其他地方:

Symbol's function definition is void: x-cut-buffer-or-selection-value

我已从我的 .emacs 中注释掉以下内容并重新启动了 emacs,但错误仍然存​​在:

;; get copy and paste to work between emacs and other windows
;; (setq x-select-enable-clipboard t)
;; (setq interprogram-paste-function 'x-cut-buffer-or-selection-value)

在linux下使用具有相同.emacs文件的emacs 24我没有类似的问题

我已经完成了最初的 googel 拖网,但我发现的所有信息都表明该错误已被修复,这并没有太大帮助

不幸的是,这使我无法在 Windows 下使用 emacs

更新

这条线似乎没有引起问题:

;; get copy and paste to work between emacs and other windows
(setq x-select-enable-clipboard t)

但是这些行可以:

;; this line causes cut/paste errors under windows (emacs 24)
;; (setq interprogram-paste-function 'x-cut-buffer-or-selection-value)

;; this alternative fixes windows problems but causes errors under linux (emacs 24)
(setq interprogram-paste-function 'x-selection-value)

我已经尝试过让我的 .emacs 平台有条件,例如:

;; this line causes cut/paste errors under windows (emacs 24)
(if (eq system-type 'gnu-linux) (setq interprogram-paste-function 'x-cut-buffer-or-selection-value) )
;; (setq interprogram-paste-function 'x-cut-buffer-or-selection-value)

;; this alternative causes errors under linux (emacs 24)
(if (eq system-type 'windows-nt) (setq interprogram-paste-function 'x-selection-value) )
;;(setq interprogram-paste-function 'x-selection-value)

这解决了问题,但这似乎有点杂乱无章......

4

2 回答 2

7

EMACS 24 中更改了变量名称:

current-kill: Symbol 的函数定义为 void: x-cut-buffer-or-selection-value

打开您的 .emacs 并更改:'x-cut-buffer-or-selection-value)

to: (setq interprogram-paste-function 'x-selection-value)

我在这篇文章中找到了答案:http: //lists.gnu.org/archive/html/emacs-devel/2010-09/msg00638.html

于 2013-01-28T20:11:11.967 回答
2

如果您根本不进行自定义,Emacs 的行为会如何?即从

emacs -Q

?

我面前没有 Windows 机器,但我的配置中没有任何特定于 Windows 的剪切/粘贴功能,而且我从未遇到过 24 的任何问题,尽管我还没有尝试过稳定版本。

于 2012-06-25T10:41:11.233 回答