使用 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))))