reddit / emacs

init.el behaving very weirdly

Pay08 · 2022-10-19 18:21
This started with `package-selected-packages` not behaving correctly. For some reason it only evaluated to about 5 packages, while it listed over 20 in `custom-set-variables`. This continued whatever I did (`-Q` didn't help). So I tried moving my `init.el`. Without an `init.el`, `package-selected-packages` evaluates correctly. However, when I try to put it back, Emacs doesn't recognize it. What's going on? Edit: apparently, at some point, Emacs auto-generated a `.emacs` file. I've deleted it and `init.el` is recognised now, but the issue with `package-selected-packages` still remains.
7890yuiop · 2022-10-19 23:23
So the issue is that `C-h v package-selected-packages` shows only a list of 5 packages, even though it had been set to a larger list in your `custom-set-variables` section? If so I could only presume that something else in your init file is setting that value later on, but I have no specific insight.
Pay08 · 2022-10-20 01:57
You're right, it was set later. I removed the setq and now it returns nil. Edit: it works, after restarting Emacs a few times.