mirror of
https://github.com/tuna/mirror-web.git
synced 2025-12-25 20:32:46 +00:00
3.2 KiB
3.2 KiB
| category | layout | mirrorid |
|---|---|---|
| help | help | elpa |
ELPA 镜像使用帮助
ELPA 是 Emacs 内建包管理器 package.el 的软件源,本镜像支持了常见的 ELPA。
| ELPA | 镜像地址 |
|---|---|
| GNU ELPA | http://{{ site.hostname }}/elpa/gnu/ |
| MELPA | http://{{ site.hostname }}/elpa/melpa/ |
| MELPA Stable | http://{{ site.hostname }}/elpa/melpa-stable/ |
| Marmalade | http://{{ site.hostname }}/elpa/marmalade/ |
| Org | http://{{ site.hostname }}/elpa/org/ |
根据你的需求,设置 package-archives ,比如用 GNU ELPA 和 MELPA:
(setq package-archives '(("gnu" . "http://{{ site.hostname }}/elpa/gnu/")
("melpa" . "http://{{ site.hostname }}/elpa/melpa/")))
(package-initialize) ;; You might already have this line
Spacemacs 用户
master 分支
添加下面的代码到.spacemacs的dotspacemacs/user-init()
(setq configuration-layer--elpa-archives
'(("melpa-cn" . "http://{{ site.hostname }}/elpa/melpa/")
("org-cn" . "http://{{ site.hostname }}/elpa/org/")
("gnu-cn" . "http://{{ site.hostname }}/elpa/gnu/")))
develop 分支
使用 configuration-layer-elpa-archives 代替原来的 configuration-layer--elpa-archives ( -- 换成 - )
(setq configuration-layer-elpa-archives
'(("melpa-cn" . "http://{{ site.hostname }}/elpa/melpa/")
("org-cn" . "http://{{ site.hostname }}/elpa/org/")
("gnu-cn" . "http://{{ site.hostname }}/elpa/gnu/")))
Cask 用户
Cask 是一个 Emacs Lisp 的项目管理工具。这里还是以 GNU ELPA 和 MELPA 为例,在添加下面的代码到 Cask
(source "gnu" "http://{{ site.hostname }}/elpa/gnu/")
(source "melpa" "http://{{ site.hostname }}/elpa/melpa/")
关于 ELPA 的选择
(来自@xuchunyang)
假如不清楚需要用哪些 ELPA 的话
gnu一般是必备的,其它的 elpa 中的包会依赖gnu中的包melpa滚动升级,收录了的包的数量最大melpa-stable依据源码的 Tag (Git)升级,数量比melpa少,因为很多包作者根本不打 Tagorg仅仅为了org-plus-contrib这一个包,org 重度用户使用marmalade似乎已经不维护了,个人不推荐
上游
本镜像的上游为 http://elpa.emacs-china.org/,本文档也参考了emacs-china提供的帮助。
URL Bug
各个仓库的URL末尾一定要加/,否则会无法拉取,提示Failed to download melpa archive。
事实上,末尾没有/的话,emacs会去尝试取以下链接:
- <http://{{ site.hostname }}/elpa/melpaarchive-contents>
而正常的链接应该是
- <http://{{ site.hostname }}/elpa/melpa/archive-contents>
这个是emacs自己的bug。在 https://github.com/melpa/melpa/issues/2139 中有描述。