首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法在emacs中安装一些melpa软件包

无法在emacs中安装一些melpa软件包
EN

Stack Overflow用户
提问于 2021-09-04 18:51:04
回答 1查看 1.2K关注 0票数 0

我只是在试用emacs (来自vim)。

代码语言:javascript
复制
$  emacs --version
GNU Emacs 27.2
Copyright (C) 2021 Free Software Foundation, Inc.
GNU Emacs comes with ABSOLUTELY NO WARRANTY.
You may redistribute copies of GNU Emacs
under the terms of the GNU General Public License.
For more information about these matters, see the file named COPYING.

$ cat ~/.emacs.d/init.el
(require 'package)
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t)
;; Comment/uncomment this line to enable MELPA Stable if desired.  See `package-archive-priorities`
;; and `package-pinned-packages`. Most users will not need or want to do this.
;;(add-to-list 'package-archives '("melpa-stable" . "https://stable.melpa.org/packages/") t)
(package-initialize)
(custom-set-faces
 ;; custom-set-faces was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 )

我已经运行了M-x package-refresh-contents多次,但仍然,许多软件包,我想要安装没有列出。例如,走模式

知道我在哪里搞砸了吗?谢谢!

编辑

我刚试了太空地图,我想要的包裹出现在清单上.

EN

回答 1

Stack Overflow用户

发布于 2021-09-05 10:50:31

根据您的描述,MELPA包似乎根本没有加载。

因此,首先,检查什么C-h v package-archives输出。它在返回列表中输出“melpa”吗?

您还可以运行M-x package-list-packages,并在列出的结果中查看是否有任何melpa存档包。

在我的配置中,我以这种方式显式地设置了包存档:

代码语言:javascript
复制
(require 'package)

(setq package-archives
      '(("gnu" . "https://elpa.gnu.org/packages/")
        ("gnu-devel" . "https://elpa.gnu.org/devel/")
        ("nongnu" . "https://elpa.nongnu.org/nongnu/")
        ("melpa" . "https://melpa.org/packages/")))

同时,自从Emacs 27.1 在你的init文件中

因此,您应该能够安全地删除(package-initialize)调用或有条件地使用它,例如:

代码语言:javascript
复制
(when (< emacs-major-version 27)
  (package-initialize))
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/69058138

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档