diff --git a/README.org b/README.org index 7369873..6dbb5ab 100644 --- a/README.org +++ b/README.org @@ -337,12 +337,13 @@ the contents of packages and allows to update packages to the latest version. ;; Install and require `no-littering'. (package-install 'no-littering) (require 'no-littering) - ;; https://emacs.stackexchange.com/a/45939 answers - ;; "How to shadow automatically a built-in package by installing it?" + ;; Stolen from (find-function-other-window 'eglot-upgrade-eglot): (defun shadow-builtin-by-install (pkg) - (when-let ((desc (cadr (assq pkg package-archive-contents)))) - (package-install desc 'dont-select))) + (unless (bound-and-true-p package-archive-contents) + (package-refresh-contents)) + (package-install (cadr (assoc pkg package-archive-contents)))) ;; Shadow built-in `org' by installing `org'. + ;; Note (package-reinstall 'org) deletes the shadowing `org'. (shadow-builtin-by-install 'org) ;; Install the selected packages. (package-install-selected-packages)))