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

Latest release changes behavior of `:custom` keyword #883

Closed gusbrs closed 4 years ago

gusbrs commented 4 years ago

I've seen the release notes, and the commit https://github.com/jwiegley/use-package/commit/b9f1fe64ee11cf99d84857d51ac74da36a0b744c and understand its reasons.

However, at least one customization of mine did stop working after the update to 2.4.1., presumably more, as I did not have yet time to fine comb my init (and I actually reverted to 2.4).

I have the following in my init:

(use-package elec-pair ; built-in
  :defer t
  :custom
  (electric-pair-mode t))

As far as I can tell, this is a legitimate way to enable a minor mode (correct me if I'm wrong). The customization interface does offer it to be customized, and explains "Setting this variable directly does not take effect; either customize it (see the info node ‘Easy Customization’) or call the function ‘electric-pair-mode’."

However, after update to use-package 2.4.1, this no longer works: electric-pair-mode is not enabled when I start Emacs. Reverting to 2.4 put this back to working condition. Hooking the mode's function to after-init-hook also did the trick. However, the point is not if there is a way around it, but that it seems to introduce breakage to the previous state of things. Personally, if I had to choose, I'd prefer the double entry in the custom file and stability of the init file. Of course, even better if we could have both things.

a13 commented 4 years ago

https://github.com/jwiegley/use-package/issues/856

gusbrs commented 4 years ago

@a13 You are right, it is a duplicate. I was probably less thorough in my search than I should have been, assuming the release was new. Thanks for pointing that out.

I'll close this one, as there is really no added content here, and focus can stay there. But I will leave a further comment about it. And please don't take this as a rant, I'm a happy and thankful user of use-package for quite some time now. Please take it as an "user experience data point", no more. This is the second time my init broke due to an use-package upgrade this year. The first time Emacs wouldn't even start, then I've decided to pin it to MELPA Stable, in the hope to get less bumps, and this is the first release since, and I was bitten again. True, the consequences are smaller this time, but it would still require quite some work to go around because I'd have to dig my init file for every instance of setting a minor mode in :custom (presuming this is the only change of behavior involved). And I must say I am surprised that #850 made the release when the problem was already known, and was still unresolved. Anyway, at this point, I do get weary when an use-package upgrade comes, because if a problem occurs, it tends to be wide rather than punctual, given the nature of what use-package does. And twice bitten, thrice shy.

That said, I would still like to register my thank you for the great package!

tzz commented 4 years ago

For @gusbrs and others visiting, we're working on a fix in #881

gusbrs commented 4 years ago

@tzz That's much appreciated. Thank you very much to all involved.

tangxinfa commented 3 years ago

My emacs broken because of the latest use-package, prevent it by use the stable version:

(add-to-list 'package-pinned-packages '(use-package . "melpa-stable"))