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

Doesn't work with Nix #24

Open
nosewings opened this issue Jun 20, 2022 · 1 comment
Open

Doesn't work with Nix #24

nosewings opened this issue Jun 20, 2022 · 1 comment

Comments

@nosewings
Copy link

When running an Emacs built with emacsWithPackages from Nix, restart-emacs picks the wrong Emacs binary to start.

emacsWithPackages creates a wrapper script that sets up the Emacs load path before running the Emacs binary. So what ends up happening is that restart-emacs executes the Emacs binary (obtained via invocation-directory), but without the load-path set properly.

The easiest solution I can see would be to allow the user to configure the command used to start a new Emacs instance.

@nosewings
Copy link
Author

nosewings commented Jun 25, 2022

For what it's worth, I was able to get this working with something like the following:

(defun nosewings/restart-emacs-advice (function &rest args)
  (let ((invocation-directory "~/.nix-profile/bin/"))
    (apply function args)))
(advice-add #'restart-emacs :around #'nosewings/restart-emacs-advice)

However, this relies on the implementation detail that restart-emacs uses invocation-directory.

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

No branches or pull requests

1 participant