Simplify package bootstrapping

* Install always the newest packages from the archives.
* Stop using ~quelpa~, but keep it for future use.
* Use ~package-install~ to install ~eglot~.
* Add ~markdown-mode~ and ~rainbow-mode~.
This commit is contained in:
Gerard Vermeulen 2021-12-05 07:28:32 +01:00
parent 103679b1c6
commit 38d23d5077
1 changed files with 12 additions and 26 deletions

View File

@ -170,8 +170,6 @@ in the ~custom-set-variable~ function call below.
`(insert-directory-program ,(or (executable-find "gls")
(executable-find "ls")))
'(kill-ring-max 300)
'(package-archive-priorities '(("gnu" . 1)
("nongnu" . 1)))
'(package-archives '(("gnu" . "https://elpa.gnu.org/packages/")
("nongnu" . "https://elpa.nongnu.org/nongnu/")
("melpa" . "https://melpa.org/packages/")))
@ -215,13 +213,13 @@ in the ~custom-set-variable~ function call below.
:CUSTOM_ID: sec:package-bootstrapping
:END:
[[info:emacs#Package Installation][Emacs installs packages]] from archives on the internet.
This setup uses three archives in two decreasing levels of priority:
1. The [[https://elpa.gnu.org/][GNU Emacs Lisp Package Archive]] or the [[https://elpa.nongnu.org/][NonGNU Emacs Lisp Package Archive]].
[[info:emacs#Package Installation][Emacs installs packages]] from archives on the internet. This setup uses three
archives:
1. The [[https://elpa.gnu.org/][GNU Emacs Lisp Package Archive]]
2. The [[https://elpa.nongnu.org/][NonGNU Emacs Lisp Package Archive]].
3. The [[https://melpa.org/#/][MELPA - Milkypostmans Emacs Lisp Package Archive]].
Finally, the [[https://github.com/quelpa/quelpa][quelpa]] tool allows to fetch code from any source and build a
package on your computer before installation. It allows to install a package
from [[https://melpa.org/#/][MELPA]] instead of [[https://elpa.gnu.org/][GNU ELPA]] or [[https://elpa.nongnu.org/][NonGNU ELPA]], breaking the priority order.
package on your computer before installation.
The output of the byte-compiler may change with each new Emacs release.
Therefore, in order to prevent collisions between different Emacs versions, the
@ -241,8 +239,8 @@ any packages, hence also [[https://github.com/emacscollective/no-littering][no-l
You have to refresh the list of available packages yourself before updating
the installed packages.
Finally, ~my-install-packages~ ensures installation of all packages in a list of
packages.
Finally, ~my-install-packages~ facilitates installation of all packages in a
list of packages.
#+attr_latex: :options bgcolor=LightGoldenrodYellow
#+begin_src emacs-lisp
@ -280,6 +278,7 @@ compatibility with Emacs-28.1. The [[info:elisp#Backquote][info:backquote]] pag
citeproc ; bibliography handling
company-anaconda ; complete anything in anaconda-mode
consult ; consult completing-read
eglot ; Emacs polyGLOT LSP client
embark ; act on any buffer selection
htmlize ; convert buffer contents to HTML
leuven-theme ; beautiful color theme
@ -294,26 +293,11 @@ compatibility with Emacs-28.1. The [[info:elisp#Backquote][info:backquote]] pag
(my-install-packages my-packages)
#+end_src
Install ~eglot~ with [[https://github.com/quelpa/quelpa][quelpa]] to get the latest version from [[https://melpa.org/#/][MELPA]].
Facilitate installlation of the optional packages.
#+attr_latex: :options bgcolor=LightGoldenrodYellow
#+begin_src emacs-lisp
;; This is the 3rd package bootstrapping block.
(when (package-installed-p 'quelpa)
(defun my-install-sources (sources)
(mapc (lambda (source)
(unless (package-installed-p (car source))
(quelpa source)))
sources))
(my-install-sources
'((eglot :fetcher github :repo "joaotavora/eglot"))))
#+end_src
Install the optional packages.
#+attr_latex: :options bgcolor=LightGoldenrodYellow
#+begin_src emacs-lisp
;; The is the 4th package bootstrapping block.
;; The is the 3rd package bootstrapping block.
(defvar my-optional-packages
`(
,@(when (version< emacs-version "28.0")
@ -326,7 +310,9 @@ Install the optional packages.
iedit ; simultaneous multi-entity editing
laas ; LaTeX Auto-Activating Snippets
magit ; Git Text-based User Interface
markdown-mode ; markdown text mode
nov ; EPUB reader
rainbow-mode ; set background color to color string
smartparens ; smart editing of character pairs
toml-mode ; Tom's Obvious Minimal Language mode
wgrep ; open a writable grep buffer