jwiegley / use-package

A use-package declaration for simplifying your .emacs
https://jwiegley.github.io/use-package
GNU General Public License v3.0
4.42k stars 260 forks source link

use-package-always-ensure ignored #1041

Closed Ergus closed 10 months ago

Ergus commented 1 year ago

Hi:

I just tried using in my init:

(setq-default use-package-always-ensure t)
(use-package some-uninstalled-package : defer t)

Then I restart emacs, but the package is not installed. If I do C-x C-e to the use-package line then the installation starts. And if I add :ensure to the line the package is also installed on startup; but somehow the use-package-always-ensure is not working at the start moment...

I am using the use-package in vanilla and this used to work some tie ago... but I am not sure if there were some recent change?

zeeros commented 1 year ago

Same here.

ELISP> (emacs-version)
"GNU Emacs 29.0.90 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.34, cairo version 1.16.0)
 of 2023-04-17"
ELISP> use-package-version
"2.4.5"
ELISP> use-package-always-ensure
t
mmulich commented 10 months ago

Likewise...

Using Emacs 29.2 and also experienced in Emacs 27.1.

As of writing this, I'm using the latest MELPA release 20230426.2324.

โ›” Warning (initialization): An error occurred while loading โ€˜/Users/AAA/.emacs.d/init.elโ€™:

File is missing: Cannot open load file, No such file or directory, helm-lsp

The lines in my init.el to reproduce:

(eval-and-compile
  (setq use-package-always-ensure t
        use-package-expand-minimally t))

(use-package helm-lsp)
mmulich commented 10 months ago

Fixed by using adding (require 'use-package-ensure).

So in my case, I adjusted things to:

(eval-and-compile
  (require 'use-package-ensure)
  (setq use-package-always-ensure t
        use-package-expand-minimally t))

(use-package helm-lsp)

This is mentioned in the README. ๐Ÿ˜› Also, the commit that would best resolve this was 5604c24d0f13f045b89fcece3768aff1d9cf410d