【问题标题】:Initialization error trying to install elpy for emacs尝试为 emacs 安装 elpy 的初始化错误
【发布时间】:2020-12-13 11:38:38
【问题描述】:

晚上,

我正在尝试为以前从未安装过的 emacs 安装一个软件包。我正在使用以下指南 https://realpython.com/emacs-the-best-python-editor/ 打算安装 elpy。

以下信息放在~/.emacs.d/init.el

;; .emacs.d/init.el 2 3;; =================================== 4;; MELPA Package Support 5;; =================================== 6;; Enables basic packaging support 7(require 'package) 8 9;; Adds the Melpa archive to the list of available repositories 10(add-to-list 'package-archives 11 '("melpa" . "http://melpa.org/packages/") t) 12 13;; Initializes the package infrastructure 14(package-initialize) 15 16;; If there are no archived package contents, refresh them 17(when (not package-archive-contents) 18 (package-refresh-contents)) ;; Installs packages 21;; 22;; myPackages contains a list of package names 23(defvar myPackages 24 '(better-defaults elpy ;; Set up some better Emacs defaults 25 material-theme ;; Theme 26 ) 27 ) 28 29;; Scans the list in myPackages 30;; If the package listed is not already installed, install it 31(mapc #'(lambda (package) 32 (unless (package-installed-p package) 33 (package-install package))) 34 myPackages) ;; =================================== 37;; Basic Customization 38;; =================================== 39 40(setq inhibit-startup-message t) ;; Hide the startup message 41(load-theme 'material t) ;; Load material theme 42(global-linum-mode t) ;; Enable line numbers globally 43;; ==================================== 46;; Development Setup 47;; ==================================== 48;; Enable elpy 49(elpy-enable) 50 51;; User-Defined init.el ends here

但是,我在保存后加载时在 emacs 中抽出了这个。

Warning (initialization): An error occurred while loading ‘/Users/jay/.emacs.d/init.el’:

Symbol's function definition is void: t

以前有人遇到过这个问题吗?谢谢

【问题讨论】:

    标签: installation emacs package initialization elpy


    【解决方案1】:

    在您正在评估的某些代码(例如您正在加载的代码)中的某处,您正尝试将 t 作为函数调用。

    您很可能要引用汽车为t:'(t ...) 的列表,而您忘记了引号:(t ...)

    Lisp 试图将不带引号的列表解释为函数调用,函数是列表的汽车。

    我在您显示的代码中没有看到这样一个未加引号的列表。也许它在该代码加载的某些代码中。要找到问题,请将您的 init 文件一分为二。您可以使用命令comment-region 来注释(并使用C-u 取消注释)代码区域。

    【讨论】:

      猜你喜欢
      • 2021-11-24
      • 1970-01-01
      • 2015-02-01
      • 2018-12-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-07-25
      • 1970-01-01
      相关资源
      最近更新 更多