【问题标题】:Emacs definition is void: use-packageEmacs 定义无效:use-package
【发布时间】:2021-05-25 12:41:28
【问题描述】:

我有问题。如果我复制任何官方代码以将这样的 elpy 打包到我的配置中,我会得到:

Symbol的函数定义为void:use-package

(use-package elpy
  :ensure t
  :init
  (elpy-enable))

【问题讨论】:

  • 您是否安装并启用了use-package?
  • 将库 use-package 放入您的 load-path 并执行 (require 'use-package)。

标签: emacs


【解决方案1】:

请在使用 use-package 之前输入:

(require 'package)                   ; Bring in to the environment all package management functions

;; A list of package repositories
(setq package-archives '(("melpa" . "https://melpa.org/packages/")
                         ("org"   . "https://orgmode.org/elpa/")
                         ("elpa"  . "https://elpa.gnu.org/packages/")))

(package-initialize)                 ; Initializes the package system and prepares it to be used

(unless package-archive-contents     ; Unless a package archive already exists,
  (package-refresh-contents))        ; Refresh package contents so that Emacs knows which packages to load


;; Initialize use-package on non-linux platforms
(unless (package-installed-p 'use-package)        ; Unless "use-package" is installed, install "use-package"
  (package-install 'use-package))

(require 'use-package)                            ; Once it's installed, we load it using require

;; Make sure packages are downloaded and installed before they are run
;; also frees you from having to put :ensure t after installing EVERY PACKAGE.
(setq use-package-always-ensure t)

【讨论】:

    猜你喜欢
    • 2023-03-28
    • 1970-01-01
    • 2022-12-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-09-19
    相关资源
    最近更新 更多