Starter Kit Package Manager
This is part of the Emacs Starter Kit.
Starter Kit Package Manager
Since emacs version 24, elisp code can be downloaded, installed and loaded
almost automatically with package.el
. There are still some discussions on how
to use it properly (see B. Batsov article for example). In this file, we use
the "usual" way through ELPA for most of the packages to be
installed. Nevertheless, we also define some el-get
command to install some
packages a bit oldy and not supported by any ELPA repository.
Checking internet connection
If there is no internet connection then no way to use any of the package
managers. This should not work under Windows system since it does not have the
network-interface-list
function
(defun starter-kit-elpa-online () "Check internet connectivity." (if (and (functionp 'network-interface-list) (network-interface-list)) (some (lambda (iface) (unless (equal "lo" (car iface)) (member 'up (first (last (network-interface-info (car iface))))))) (network-interface-list)) t))
el-get
el-get
allows you to install and manage elisp code for Emacs. It supports lots
of differents types of sources and is able to install them, update them and
remove them, but more importantly it will init them for you. The next pieces of
code are largely inspired by this article.
Checking el-get
(add-to-list 'load-path "~/.emacs.d/el-get/el-get") (unless (require 'el-get nil t) (with-current-buffer (url-retrieve-synchronously "https://raw.github.com/dimitri/el-get/master/el-get-install.el") (end-of-buffer) (eval-print-last-sexp)))
Setup packages
(setq el-get-sources '((:name cask :description "Emacs dependency management" :type github :pkgname "cask/cask") (:name pallet :description "A package management tool for Emacs, built on Cask" :type github :pkgname "rdallasgray/pallet") (:name trac-wiki :description "Simple but efficient interface to Trac." :type github :pkgname "tiborsimko/trac-wiki-el") (:name emacs-deferred :description "Facilities to manage asynchronous tasks." :type github :pkgname "kiwanami/emacs-deferred") (:name inertial-scroll :description "Soft mouse scrolling." :type github :pkgname "kiwanami/emacs-inertial-scroll") ) )
Install packages
(mapc (lambda (f) (let ((name (plist-get f :name))) (when (not (require name nil t)) (el-get-install name)))) el-get-sources)