Emacs无法加载初始化文件

时间:2018-10-10 02:08:15

标签: emacs initialization package

我正在Windows 10平台下使用Emacs 25.3。

在我一次启动它并收到以下消息之前,它工作正常:

Warning (initialization): An error occurred while loading ‘ 
c:/Users/shore/AppData/Roaming/.emacs’:

Wrong type argument: listp, <html>

To ensure normal operation, you should investigate and remove the
cause of the error in your initialization file.  Start Emacs with
the ‘--debug-init’ option to view a complete error backtrace.

按照指示,我使用--debug-init选项启动并收到以下消息:

Debugger entered--Lisp error: (wrong-type-argument listp <html>)
  package--read-archive-file("archives/gnu/archive-contents")
  package-read-archive-contents("gnu")
  package-read-all-archive-contents()
  package-initialize()
  eval-buffer(#<buffer  *load*> nil "c:/Users/shore/AppData/Roaming/.emacs" nil t)  ; Reading at buffer position 275
  load-with-code-conversion("c:/Users/shore/AppData/Roaming/.emacs" "c:/Users/shore/AppData/Roaming/.emacs" t t)
  load("~/.emacs" t t)
    [init-file-user system-type delayed-warnings-list user-init-file inhibit-default-init inhibit-startup-screen ms-dos "~" "/_emacs" windows-nt "/.emacs" directory-files nil "^\\.emacs\\(\\.elc?\\)?$" "~/.emacs" "^_emacs\\(\\.elc?\\)?$" initialization format-message "`_emacs' init file is deprecated, please use `.emacs'" "~/_emacs" t load expand-file-name "init" file-name-as-directory "/.emacs.d" file-name-extension "elc" file-name-sans-extension ".el" file-exists-p file-newer-than-file-p message "Warning: %s is newer than %s" sit-for 1 "default"] 7]()
  command-line()
  normal-top-level()

谁能告诉我我的问题在哪里以及如何解决?

1 个答案:

答案 0 :(得分:1)

这是告诉您,当它尝试读取文件archives/gnu/archive-contents时,它希望读取Lisp(更具体地说是Lisp列表)。相反,它遇到了<html>(可能是文件中的文本)。

一种猜测是,您以某种方式下载或获取了HTML文件(也许是描述存档文件或具有下载链接的HTML文件),而不是下载或获取了Lisp代码文件。再次尝试获取该存档文件。