Tweak installation of selected packages

This commit is contained in:
Gerard Vermeulen 2021-12-29 10:03:44 +01:00
parent f5fb65404f
commit cd2f934bcb
1 changed files with 18 additions and 3 deletions

View File

@ -276,7 +276,11 @@ the ~custom-file~ as [[info:emacs#Saving Customizations][saving customizations (
'(kill-ring-max 300) '(kill-ring-max 300)
'(package-archives '(("gnu" . "https://elpa.gnu.org/packages/") '(package-archives '(("gnu" . "https://elpa.gnu.org/packages/")
("nongnu" . "https://elpa.nongnu.org/nongnu/") ("nongnu" . "https://elpa.nongnu.org/nongnu/")
("melpa" . "https://melpa.org/packages/")))) ("melpa" . "https://melpa.org/packages/")))
;; Pin those packages to GNU ELPA to get the info documentation.
'(package-pinned-packages '((consult . "gnu")
(marginalia . "gnu")
(vertico . "gnu"))))
#+end_src #+end_src
#+caption[Customize the second set of Emacs variables]: #+caption[Customize the second set of Emacs variables]:
@ -318,6 +322,7 @@ the ~custom-file~ as [[info:emacs#Saving Customizations][saving customizations (
rainbow-mode ; set background color to color string rainbow-mode ; set background color to color string
smartparens ; smart editing of character pairs smartparens ; smart editing of character pairs
toml-mode ; Tom's Obvious Minimal Language mode toml-mode ; Tom's Obvious Minimal Language mode
undo-tree ; more advanced yet simpler undo system
vertico ; VERTical Interactive Completion vertico ; VERTical Interactive Completion
wgrep ; open a writable grep buffer wgrep ; open a writable grep buffer
which-key ; on the fly key-binding help which-key ; on the fly key-binding help
@ -366,7 +371,7 @@ archives:
1. The [[https://elpa.gnu.org/][GNU Emacs Lisp Package Archive]] 1. The [[https://elpa.gnu.org/][GNU Emacs Lisp Package Archive]]
2. The [[https://elpa.nongnu.org/][NonGNU Emacs Lisp Package Archive]]. 2. The [[https://elpa.nongnu.org/][NonGNU Emacs Lisp Package Archive]].
3. The [[https://melpa.org/#/][Milkypostmans Emacs Lisp Package Archive (MELPA)]]. 3. The [[https://melpa.org/#/][Milkypostmans Emacs Lisp Package Archive (MELPA)]].
Finally, the [[https://github.com/quelpa/quelpa][quelpa]] tool allows to fetch code from any source and build a In addition, the [[https://github.com/quelpa/quelpa][quelpa]] tool allows to fetch code from any source and build a
package on your computer before installation. package on your computer before installation.
The code in listing [[lst:install-selected-packages]] assumes that the package The code in listing [[lst:install-selected-packages]] assumes that the package
@ -374,7 +379,10 @@ system is in a *virgin* state in case the package [[https://github.com/emacscoll
Refreshing the contents of available packages at least once is a requirement in Refreshing the contents of available packages at least once is a requirement in
order to be able to install and load any packages, hence also [[https://github.com/emacscollective/no-littering][no-littering]]. order to be able to install and load any packages, hence also [[https://github.com/emacscollective/no-littering][no-littering]].
The call src_emacs-lisp{(package-install-selected-packages)} checks the Then, it ensures installation of [[https://github.com/quelpa/quelpa][quelpa]] before ensuring installation of
[[https://www.reddit.com/r/emacs/comments/l6rcqh/undotree_repositorys_new_home_gitlab/][undo-tree]].
Finally, the call src_emacs-lisp{(package-install-selected-packages)} checks the
installation status of all packages in src_emacs-lisp{package-selected-packages} installation status of all packages in src_emacs-lisp{package-selected-packages}
and installs the missing packages after the user has agreed to its prompt. In and installs the missing packages after the user has agreed to its prompt. In
case of normal Emacs usage, src_emacs-lisp{(package-list-packages)} refreshes case of normal Emacs usage, src_emacs-lisp{(package-list-packages)} refreshes
@ -389,6 +397,13 @@ the contents of packages and allows to update packages to the latest version.
(package-install 'no-littering) (package-install 'no-littering)
(require 'no-littering)) (require 'no-littering))
(unless (package-installed-p 'quelpa)
(package-install 'quelpa))
(unless (package-installed-p 'undo-tree)
;; Neither GNU ELPA, nor MELPA have the latest version.
(quelpa '(undo-tree :repo "tsc25/undo-tree" :fetcher gitlab)))
(unless noninteractive (unless noninteractive
(package-install-selected-packages)) (package-install-selected-packages))
#+end_src #+end_src