* Package management
** package repositories and package manager
-#+BEGIN_SRC emacs-lisp
- (require 'package)
+Borrowed from https://github.com/nilcons/emacs-use-package-fast/ to
+load use-package even faster
+#+BEGIN_SRC emacs-lisp
+ (setq package-enable-at-startup nil)
+ (setq package--init-file-ensured t)
+ (eval-and-compile
+ (setq use-package-verbose (not (bound-and-true-p byte-compile-current-file))))
+ (mapc #'(lambda (add) (add-to-list 'load-path add))
+ (eval-when-compile
+ (package-initialize)
+ (unless (package-installed-p 'use-package)
+ (package-refresh-contents)
+ (package-install 'use-package))
+ (setq use-package-always-ensure t)
+ (let ((package-user-dir-real (file-truename package-user-dir)))
+ ;; The reverse is necessary, because outside we mapc
+ ;; add-to-list element-by-element, which reverses.
+ (nreverse (apply #'nconc
+ ;; Only keep package.el provided loadpaths.
+ (mapcar #'(lambda (path)
+ (if (string-prefix-p package-user-dir-real path)
+ (list path)
+ nil))
+ load-path))))))
+
(setq package-archives '(("gnu" . "https://elpa.gnu.org/packages/")
("melpa" . "https://melpa.org/packages/")
("org" . "http://orgmode.org/elpa/") ))
** [[https://github.com/jwiegley/use-package/][use-package]]
#+BEGIN_SRC emacs-lisp
(package-initialize)
- (condition-case nil
- (require 'use-package)
- (progn (package-install 'use-package)
- (require 'use-package)))
+ (eval-when-compile
+ (unless (package-installed-p 'use-package)
+ (package-refresh-contents)
+ (package-install 'use-package))
+ (require 'use-package))
#+END_SRC
** Paradox
#+BEGIN_SRC emacs-lisp