diff --git a/config.org b/config.org index 5bf4174..8008a7e 100644 --- a/config.org +++ b/config.org @@ -2,17 +2,41 @@ #+AUTHOR: Camden Dixie O'Brien #+ATTR_LATEX: :float t -Shout out to Harry R. Schwartz; A whole bunch of this config -(including the idea of embeddeding the lot in an Org document) is -yanked from [[https://github.com/hrs/dotfiles][his dotfiles repo]]. +* Package Management +** MELPA + Let's be real here, all the good stuff's on MELPA. -The rest of this config grabs packages via =use-package=, so that -needs to be set up to install them if they aren't already. + #+begin_src emacs-lisp + (require 'package) + (add-to-list 'package-archives + '("melpa" . "https://melpa.org/packages/")) + #+end_src -#+begin_src emacs-lisp - (require 'use-package-ensure) - (setq use-package-always-ensure t) -#+end_src + We then need to run [[help:package-initialize][package-initialize]] to load and activate + packages. The documentation advises doing this early in + configuration. + + #+begin_src emacs-lisp + (package-initialize) + #+end_src + +** =use-package= + The rest of this config grabs packages via =use-package=, so that + needs to be installed: + + #+begin_src emacs-lisp + (when (not (package-installed-p 'use-package)) + (package-refresh-contents) + (package-install 'use-package)) + #+end_src + + The wanted behaviour for =use-package= here is to ensure all used + packages are present. + + #+begin_src emacs-lisp + (require 'use-package-ensure) + (setq use-package-always-ensure t) + #+end_src * UI The start-up message gets pretty annoying, so disable that. diff --git a/init.el b/init.el index 5eca94a..d4b751f 100644 --- a/init.el +++ b/init.el @@ -1,11 +1 @@ -(require 'package) -(add-to-list 'package-archives '("gnu" . "https://elpa.gnu.org/packages/") t) -(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t) -(add-to-list 'package-archives '("org" . "http://orgmode.org/elpa/") t) -(package-initialize) - -(when (not (package-installed-p 'use-package)) - (package-refresh-contents) - (package-install 'use-package)) - (org-babel-load-file "~/.emacs.d/config.org")