Emacs error when I call it in the terminal

ぃ、小莉子 提交于 2020-02-26 06:24:19

问题


I've just installed emacs on my MacBook Pro but when I cast "emacs" on my terminale I receive this type of error :

Emacs-x86_64-10_10[5647:247335] Failed to initialize color list unarchiver: Error Domain=NSCocoaErrorDomain Code=4864 "* -[NSKeyedUnarchiver _initForReadingFromData:error:throwLegacyExceptions:]: non-keyed archive cannot be decoded by NSKeyedUnarchiver" UserInfo={NSDebugDescription=* -[NSKeyedUnarchiver _initForReadingFromData:error:throwLegacyExceptions:]: non-keyed archive cannot be decoded by NSKeyedUnarchiver}

Then emacs opens correctly but I can't compile files because of this error.


回答1:


This is a known error for Emacs on macOS Mojave. Apparently Emacs has been using a deprecated, and now removed, API. You can follow the thread on the "emacs-devel" mailing list.

Edit 25 JUL 2019:

Since people still seem to be getting to this question, patches for this issue were pushed the emacs-26 branch as of Fri, 28 Sep 2018. The latest version of Emacs 26 (or greater) from source or https://emacsformacosx.com/ will work. If you're just now upgrading and you still get the error/crash with the latest Emacs, delete ~/Library/Colors/Emacs.clr and restart your new Emacs. Emacs will recreate a non-corrupted version of that file as documented here.




回答2:


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




回答3:


Thank you, @Fabrizio-Miano. I lack the reputation to comment on your answer, but it guided me in the right direction. I was able to suppress this error with a simple one-liner added to the end of my init.el. For others who are interested, I just added:

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

For what it's worth, I placed this in a progn statement so that it occurs after my theme gets loaded. I'm not sure that it makes a difference, but it seemed like a logical thing to do. Perhaps not an ideal solution, but better than waiting for things to get sorted out in the emacs-26 branch.



来源:https://stackoverflow.com/questions/52521587/emacs-error-when-i-call-it-in-the-terminal

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!