I am using the following init file to download and load packages from melpa-stable in fresh Emacs installations:
(require 'package) (add-to-list 'package-archives '("melpa-stable" . "https://stable.melpa.org/packages/")) (setq use-package-always-pin "melpa-stable") (package-initialize) ;; Download use-package (unless (package-installed-p 'use-package) (package-refresh-contents) (package-install 'use-package)) ;; Reduce load time (eval-when-compile (require 'use-package)) ;; Get packages (use-package foo :ensure t) ;;... etc
I have two questions/problems.
(eval-when-compile (require 'use-package)) is suggested by github.com/jwiegley/use-package, to speed-up the init, but to me it gives the non-critical error:
Eager macro-expansion failure: (file-missing "Cannot open load file" "No such file or directory" "use-package")
Secondly, while use-package is proposes a safe approach to automatically install packages, the author does not tell how to do same with use-package itself. The test
(package-installed-p 'use-package) works, but since it requires initialising all packages, I suspect it can slow-down the init, and wonder if there is a faster way.
It seems that after switching from
https://melpa.org/packages the eager macro-expansion failure disappeared from the Messages buffer.