Move package mgmt config into config.org

This commit is contained in:
Camden Dixie O'Brien 2021-01-01 00:00:33 +00:00
parent 9115a59780
commit 7d6dbd5cbb
2 changed files with 33 additions and 19 deletions

View File

@ -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.

10
init.el
View File

@ -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")