[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Emacs 27.1 init file not loading
From: |
Robert Pluim |
Subject: |
Re: Emacs 27.1 init file not loading |
Date: |
Fri, 21 May 2021 11:01:23 +0200 |
>>>>> On Thu, 20 May 2021 15:27:28 -0500, Skip Montanaro
>>>>> <skip.montanaro@gmail.com> said:
>> What's the value of 'user-init-file' when you run emacs normally
>> (without the symlink below)? Itʼs possible emacs is looking for
>> '~/.emacs.d/init.el'.
Skip> "~/.emacs"
Skip> I think I figured it out. In this manual section:
Skip>
https://www.gnu.org/software/emacs/manual/html_node/emacs/Find-Init.html
Skip> it explicitly mentions ~/.emacs.el, ~/.emacs, and ~/.emacs.d/init.el.
It
Skip> also states (emphasis mine):
Skip> Emacs can also look in an XDG-compatible location for init.el, the
default
Skip> is the directory ~/.config/emacs *[this existed but seemed to be
ignored]*.
Skip> This can be overridden by setting XDG_CONFIG_HOME in your
environment, its
Skip> value replaces ~/.config in the name of the default XDG init file.
However
Skip> ~/.emacs.d, ~/.emacs, and ~/.emacs.el are always preferred if they
exist,
Skip> which means that you must delete or rename them in order to use the
XDG
Skip> location.
Note the 'are always preferred' bit.
Skip> Note also that if neither the XDG location nor ~/.emacs.d exist, then
Emacs
Skip> will create ~/.emacs.d (*and therefore use it during subsequent
invocations*
Skip> ).
Skip> I had no XDG_CONFIG_HOME environment variable, so it created
~/.emacs.d
Skip> (probably silently), so after that, even when I did set
XDG_CONFIG_HOME, it
Skip> still preferred the virtually empty ~/.emacs.d. I set XDG_CONFIG_HOME,
Skip> removed ~/.emacs.d, and all is once again right with the world.
If XDG_CONFIG_HOME is unset, then emacs looks in ~/.config/emacs. I
wonder if you were initially running a version of emacs that used
~/.config/emacs/init.el even if ~/.emacs.d existed, but that was
changed before the emacs27 release.
In any case, Iʼm glad you solved it.
Robert
--