使用 el-get 進行自動包管理
el-get 是 GNU Emacs 的開源包管理系統。el-get 適用於 melpa
,以及許多常見的版本控制系統。它的文件包含一個簡單的自安裝程式,用於你的 .emacs
:
(unless (require 'el-get nil t)
(url-retrieve
"https://raw.github.com/dimitri/el-get/master/el-get-install.el"
(lambda (s)
(let (el-get-master-branch)
(goto-char (point-max))
(eval-print-last-sexp)))))
(el-get 'sync)
el-get 在~/.emacs.d/el-get
的目錄結構中維護包安裝。它從~/.emacs.d/el-get/.loaddefs.el
載入定義並使用~/.emacs.d/el-get/.status.el
跟蹤包狀態。(el-get 'sync)
安裝或刪除軟體包以使實際機器狀態與軟體包 .status.el
同步。
el-get 是自我託管的 - 這是 .status.el
自己的狀態:
(el-get status "installed" recipe
(:name el-get :website "https://github.com/dimitri/el-get#readme" :description "Manage the external elisp bits and pieces you depend upon." :type github :branch "master" :pkgname "dimitri/el-get" :info "." :compile
("el-get.*\\.el$" "methods/")
:features el-get :post-init
(when
(memq 'el-get
(bound-and-true-p package-activated-list))
(message "Deleting melpa bootstrap el-get")
(unless package--initialized
(package-initialize t))
(when
(package-installed-p 'el-get)
(let
((feats
(delete-dups
(el-get-package-features
(el-get-elpa-package-directory 'el-get)))))
(el-get-elpa-delete-package 'el-get)
(dolist
(feat feats)
(unload-feature feat t))))
(require 'el-get))))