emacs-snap icon indicating copy to clipboard operation
emacs-snap copied to clipboard

emacsclient path not symlinked as part of installation

Open SreenivasVRao opened this issue 11 months ago • 7 comments

hi alex - many thanks for maintaining the emacs-snap :)

I did a clean-install of emacs / ubuntu 22.04 and had some trouble getting magit to use emacsclient. Based on https://github.com/magit/with-editor/issues/125 - I had to run this command:

sudo ln -s /snap/bin/emacsclient /usr/local/bin/emacsclient

would be helpful if this was added to the install workflow. unsure where it gets added or I'd have opened a PR

SreenivasVRao avatar Mar 24 '24 22:03 SreenivasVRao

The snap should set up an automatic alias for emacsclient - can you list the output of: snap aliases? There should already be a symlink in /snap/bin/emacsclient.

alexmurray avatar Mar 24 '24 23:03 alexmurray

sreenivas@arceus:~$ snap aliases
Command              Alias        Notes
emacs.ebrowse        ebrowse      -
emacs.emacsclient    emacsclient  -
firefox.geckodriver  geckodriver  -
sreenivas@arceus:~$ 

SreenivasVRao avatar Mar 24 '24 23:03 SreenivasVRao

Yep so the alias is there - and there should be a symlink in /snap/bin/emacsclient as well then. So from what I can see, the emacs snap is doing all that it can to ensure an emacsclient is in PATH - snaps are not able to write to /usr/local/bin so it is not feasible for the snap to add such a symlink. Do you know why with-editor is expecting such a symlink to exist?

alexmurray avatar Mar 24 '24 23:03 alexmurray

no sadly - just passing on what I found from the other issue, but looks like it may be a problem with with-editor in this case

SreenivasVRao avatar Mar 24 '24 23:03 SreenivasVRao

I think it may be more likely a problem with your system - have you by chance manually compiled and installed emacs previously? If so, I suspect there may be symlinks left over in /usr/local/bin - can you please have a look?

ls -la /usr/local/bin/emacs*

alexmurray avatar Mar 24 '24 23:03 alexmurray

no - this is all on a fresh install of ubuntu 22.04 - only installed via snap

sreenivas@arceus:~/.config$ ls -la /usr/local/bin/emacs*
lrwxrwxrwx 1 root root 21 Mar 24 18:27 /usr/local/bin/emacsclient -> /snap/bin/emacsclient

SreenivasVRao avatar Mar 24 '24 23:03 SreenivasVRao

Hmm weird - so I use magit myself and have never had any issues with it and the emacs snap. On my machine I see with-editor-emacsclient-executable has the value of /snap/emacs/2430/usr/bin/emacsclient - and I have no specific customisations for the with-editor package.

So I can only presume this is an issue with your local configuration... I'll close this issue since there isn't a lot we can do on the snap side of things but am happy to help you try and diagnose what is happening if you need.

alexmurray avatar Mar 24 '24 23:03 alexmurray