35

我刚刚在我的 MacBook Pro 上安装了 emacs,但是当我在终端中输入“emacs”时,我收到了这个错误:

Emacs-x86_64-10_10[5647:247335] 无法初始化颜色列表 unarchiver: Error Domain=NSCocoaErrorDomain Code=4864 " * -[NSKeyedUnarchiver _initForReadingFromData:error:throwLegacyExceptions:]: non-keyed archive cannot be decoded by NSKeyedUnarchiver" UserInfo={ NSDebugDescription=* -[NSKeyedUnarchiver _initForReadingFromData:error:throwLegacyExceptions:]: 非密钥归档不能被 NSKeyedUnarchiver 解码}

然后emacs正确打开,但由于这个错误我无法编译文件。

4

3 回答 3

36

这是 macOS Mojave 上 Emacs 的一个已知错误。显然 Emacs 一直在使用已弃用且现已删除的 API。您可以关注“emacs-devel”邮件列表中的主题。

2019 年 7 月 25 日编辑:

由于人们似乎仍然在回答这个问题,因此截至 Fri, 28 Sep 2018已将针对此问题的补丁推送到 emacs-26 分支。来自源代码或https://emacsformacosx.com/的最新版本的 Emacs 26(或更高版本)将可以使用。如果您刚刚升级,并且在使用最新的 Emacs 时仍然出现错误/崩溃,请删除~/Library/Colors/Emacs.clr并重新启动您的新 Emacs。Emacs 将重新创建该文件的未损坏版本,如此所述。

于 2018-09-27T10:30:20.360 回答
27

Apparently the issue, mentioned here, can be fixed just by removing

~/Library/Colors/Emacs.clr

This file will be recreated the next time Emacs is run

EDIT: when you reboot though, it shows up again

于 2018-10-22T12:03:25.233 回答
15

谢谢你,@Fabrizio-Miano。我缺乏对您的回答发表评论的声誉,但它引导我朝着正确的方向前进。我能够通过在我的 init.el 末尾添加一个简单的单行来抑制这个错误。对于其他感兴趣的人,我只是添加了:

(delete-file "~/Library/Colors/Emacs.clr")

对于它的价值,我将它放在一个progn声明中,以便它在我的主题加载后发生。我不确定这会有所不同,但这似乎是合乎逻辑的事情。也许不是一个理想的解决方案,但比在 emacs-26 分支中等待解决问题要好。

于 2019-03-05T20:08:23.847 回答