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

How to reliably locate the executable of emacsclient #15

Open
akirak opened this issue Mar 7, 2021 · 0 comments · May be fixed by #16
Open

How to reliably locate the executable of emacsclient #15

akirak opened this issue Mar 7, 2021 · 0 comments · May be fixed by #16
Labels
enhancement *sigh* what now?

Comments

@akirak
Copy link
Contributor

akirak commented Mar 7, 2021

Hello, thanks for creating this great package. I found it to be extremely useful, but I have encountered an issue relating to my installation.

I am using nix run (a feature from Nix flakes) to run Emacs without installing it. If you don't know nix run, think of it like docker run. It can start a program without installing its executable to a global location. emacs-everywhere tries to spawn emacsclient from inside an Emacs session, which fails, because emacsclient is unavailable in my PATH.

In my case, replacing the executable name with

(expand-file-name "emacsclient" invocation-directory)

would work. It would be possible to handle the issue by adding a custom variable named emacs-everywhere-emacsclient-executable. It can be done quickly.

A more thorough solution, however, would be to use with-editor package developed by tarsius, the person behind magit. This package contains with-editor-locate-emacsclient function which locates emacsclient executable in a reliable manner, which will be better than the solution I showed above.

It also seems to contain helper functions for emacsclient sessions, such as with-editor-finish, with-editor-cancel, etc. Those functions might be useful to you for a more consistent behaviour. At a first glance, it doesn't look easy to rewrite your package to utilize those utilities, due to some duplicated logic between the two packages. I haven't examined the idea in detail.

What do you think? Would you consider use of with-editor package? For me, use of with-editor-locate-emacsclient would probably be sufficient, so if you can accept the extra dependency, I will submit a PR.

@akirak akirak linked a pull request Mar 7, 2021 that will close this issue
@tecosaur tecosaur added the enhancement *sigh* what now? label Mar 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement *sigh* what now?
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants