-
Notifications
You must be signed in to change notification settings - Fork 150
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Autoload generated with wrong path when .emacs.d is a symlink and find-file-visit-truename is non-nil #944
Comments
…an-software#701) When find-file-visit-truename, a user option, is non-nil, make-directory-autoloads resolves symlinks in its second argument (as it uses find-file-noselect under the hood) but not in its first. This results in relative paths that are invalid when loaded. See radian-software#701, radian-software#944, and upstream bug report https://debbugs.gnu.org/cgi/bugreport.cgi?bug=52292.
…an-software#701) In Emacs 28.1, when find-file-visit-truename, a user option, is non-nil, make-directory-autoloads resolves symlinks in its second argument (as it uses find-file-noselect under the hood) but not in its first. This results in relative paths that are invalid when loaded. See radian-software#701, radian-software#944, and upstream bug report https://debbugs.gnu.org/cgi/bugreport.cgi?bug=52292.
I'll add the details to the upstream bug report; in the meantime I'm opening #945 to work around it in Emacs 28. |
Sounds good. I'll take a look at the pull once the upstream report thread has been bumped. |
I did not notice the Emacs bug thread getting bumped. Took the liberty of suggesting a patch there first. https://lists.gnu.org/archive/html/bug-gnu-emacs/2022-05/msg00795.html |
…an-software#701) In Emacs 28.1, when find-file-visit-truename, a user option, is non-nil, make-directory-autoloads resolves symlinks in its second argument (as it uses find-file-noselect under the hood) but not in its first. This results in relative paths that are invalid when loaded. See radian-software#701, radian-software#944, and upstream bug report https://debbugs.gnu.org/cgi/bugreport.cgi?bug=52292.
Just encountered this issue with Emacs 28.2. I take it the upstream issue has not been resolved yet. Is this only affecting |
Problem hasn't been addressed upstream. I suggest adding to any of the upstream threads mentioned here. |
What's wrong
My
~/.emacs.d
is a symlink to~/.dotfiles/emacs/.emacs.d
, and I setfind-file-visit-truename
to t.Autoloaded commands fail to load the files that they are associated with, even though
require
works.(I'll explain why this is happening below.)
Directions to reproduce
mkdir -p /tmp/home
,cd /tmp/home
,export HOME=$(pwd)
(to not be affected by existing config)mkdir -p .dotfiles/emacs/.emacs.d
,ln -s .dotfiles/emacs/.emacs.d .emacs.d
Put this into
/tmp/home/.emacs.d/init.el
:Try to run
ag
; this will fail as the autoloads file looks like this (docstring omitted):Why this is happening
(I don't know why it didn't happen in Emacs 27. Perhaps it's a change introduced by
make-directory-autoloads
.)make-directory-autoloads
does not resolve symlinks in its DIR argument (or files within that directory) even whenfind-file-visit-truename
is non-nil — this is as expected.However, it does visit its OUTPUT-FILE argument with
find-file
in a call toautoload-find-generated-file
.In the example, one of the input files in
make-directory-autoloads
would be/tmp/home/.emacs.d/straight/build/ag/ag.el
, but its associated output file would be resolved to/tmp/home/.dotfiles/emacs/.emacs.d/straight/build/ag/ag-autoloads.el
. This then turns into the train of../
s when it's made relative.To work around this,
find-file-visit-truename
should probably be let-bound to nil instraight--build-autoloads
.(This also happens for package.el, which makes it seem like an upstream bug.)
Version information
The text was updated successfully, but these errors were encountered: