sunnyata · 2022-04-28 10:49
I thought I'd update the organisation of my config and store everything under `~/.config/emacs` in what seems to be the modern way. I did that and removed `~/.emacs.d/` altogether. The first time I start emacs everything is fine. However, `~/.emacs.d` is recreated and I get a session file and auto-save directory in there. The next time I start the init file isn't read at all. Removing `~/.emacs.d` and restarting fixes that. I could put a symlink in `~/.emacs.d` but that doesn't seem right -- what am I doing wrong?
mattias_jcb · 2022-04-28 10:56
There might be som package that has hard coded .emacs.d and if Emacs just looks for that directory (with or without an init.el) when deciding where to load config then what you're describing would happen.
Note: this is only speculation, but it's where I would begin looking.
akirakom · 2022-04-28 11:03
Did you run Emacs 26 (or 25) to test an Emacs Lisp package on your machine? Or did you run a third-party script for sandboxing your Emacs environment?
sunnyata · 2022-04-28 11:12
I was using 26.3 until recently, when I decided to give the latest snapshot a go, and I'm running 29.0.50 right now.
Phil-Hudson · 2022-04-28 15:20
On that note, I'd want to check customize settings, the area at the end of your init file that begins `(custom-set-variables...`
tdavey · 2022-04-28 17:36
See the commentary below, from the definition of #'startup--xdg-or-homedot() in startup.el (for 29.0.50). Emacs will look for your dot files in .emacs.d if it exists, notwithstanding the presence of .config/emacs:
;; Return the name of the init file directory for Emacs, assuming\
;; XDG-DIR is the XDG location and USER-NAME is the user name. If\
;; USER-NAME is nil or "", use the current user. Prefer the XDG\
;; location only if the .emacs.d location does not exist.\
I find it annoying that many packages and native libraries still write files to .emacs.d by default, even creating it if necessary. The transition to XDG will be rocky until older code is updated.
sunnyata · 2022-04-28 17:47
Thanks, that explains what's going on. Back to the old way for now.