Skip to content
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

package-user-dir stays at ~/.emacs.d/elpa #16

Closed
kidd opened this issue Apr 18, 2021 · 4 comments · Fixed by #17
Closed

package-user-dir stays at ~/.emacs.d/elpa #16

kidd opened this issue Apr 18, 2021 · 4 comments · Fixed by #17

Comments

@kidd
Copy link
Contributor

kidd commented Apr 18, 2021

Recently there's been a change in emacs master branch, 9973019764250ac1f4d77a6b426cdd9c241151c5 ( emacs-mirror/emacs@9973019) where package-user-dir is loaded differently, making it bypass chemacs' directory linking.

c-h v package-user-dir before that commit gives ~/.emacs.default/elpa, but after it, you get ~/.emacs.d/elpa.

I'm still not 100% sure about the proper fix, but as of now this seems to fix it:

modified   chemacs.el
@@ -142,6 +142,7 @@
 (defun chemacs-load-user-init ()
   (when (chemacs-profile-get 'straight-p) (chemacs-load-straight))
   (let ((init-file (expand-file-name "init.el" user-emacs-directory)))
+    (setq package-user-dir (expand-file-name "elpa" user-emacs-directory))
     (load init-file t t)
     ;; Prevent customize from changing ~/.emacs (this file), but if
     ;; init.el has set a value for custom-file then don't touch it.

leaving it as an issue to give it some time

@plexus
Copy link
Owner

plexus commented Apr 19, 2021

Thanks for the report. If this works both before and after that change then I'm happy to merge in a PR.

@patrolli
Copy link

patrolli commented May 3, 2021

Recently there's been a change in emacs master branch, 9973019764250ac1f4d77a6b426cdd9c241151c5 ( emacs-mirror/emacs@9973019) where package-user-dir is loaded differently, making it bypass chemacs' directory linking.

c-h v package-user-dir before that commit gives ~/.emacs.default/elpa, but after it, you get ~/.emacs.d/elpa.

I'm still not 100% sure about the proper fix, but as of now this seems to fix it:

modified   chemacs.el
@@ -142,6 +142,7 @@
 (defun chemacs-load-user-init ()
   (when (chemacs-profile-get 'straight-p) (chemacs-load-straight))
   (let ((init-file (expand-file-name "init.el" user-emacs-directory)))
+    (setq package-user-dir (expand-file-name "elpa" user-emacs-directory))
     (load init-file t t)
     ;; Prevent customize from changing ~/.emacs (this file), but if
     ;; init.el has set a value for custom-file then don't touch it.

leaving it as an issue to give it some time

It works. I recently compile emacs28 to replace my old emacs27. I found when I enter emacs28 it will download packages automatically to the path "/.emacs.d" instead of loading from "/.emacs.default". I add this sentence in chemacs.el and emacs28 load the package dir correctly.

@plexus
Copy link
Owner

plexus commented May 4, 2021

@patrolli did you also try it out with the change on emacs 27?

@kidd or @patrolli would you mind making a PR for this?

@kidd
Copy link
Contributor Author

kidd commented May 4, 2021

sure! I'll prepare the PR later today, 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants