I've installed Emacs 26.2 using snap
on Lubuntu 18.04. I'm trying to figure out how to get the server/client/daemon going.
I've done as instructed on EmacsWiki: "Emacs Client" by putting (server-start)
in .emacs.el
.
I've followed the examples on EmacsWiki: "Emacs as Daemon" by putting this in ~/.config/systemd/user/emacs.service
:
[Unit]
Description=Emacs text editor
Documentation=info:emacs man:emacs(1) https://gnu.org/software/emacs/
[Service]
Type=forking
ExecStart=/usr/bin/emacs --daemon
ExecStop=/usr/bin/emacsclient --eval "(kill-emacs)"
Environment=SSH_AUTH_SOCK=%t/keyring/ssh
Restart=on-failure
[Install]
WantedBy=default.target
When I tried to enable the unit by running:
systemctl enable --user emacs
systemctl start --user emacs
I got an error message about where Emacs lives on my filesystem, so I substituted /usr/
with /snap/
. I restarted my system (don't know if that was necessary, or if merely logging out and back in again would have been sufficient) and looked at my process list to see that /snap/emacs/45/usr/bin/emacs --daemon
is indeed there, so I figure all is well. An entry for Emacs (Client)
has appeared below the original Emacs
one in my launcher (though not with the right icon, but that's trivial).
Crucial questions
Is that pretty much all there is to it, or is there anything I should change?
How do I actually run Emacs now? When I click on
Emacs (Client)
in the launcher, the pointer whirls for a bit and then stops. No window shows up.
Definitely not crucial, but just because I'm curious
Where did the launcher get the actual text
Emacs (Client)
from?If I do decide to change the icon, how do I do so?
Responding to @alpaice
Freshly rebooted, ran htop
and found two processes: /snap/emacs/45/usr/bin/emacs --daemon
. I tried $ emacsclient -c .profile
and it came up beautifully! I've tested couple of other things, like opening a file from the file browser (PCManFM
) while an Emacs Client frame is already open. I discovered that I had to use "Open With..." once and choose "Emacs (Client)" which worked fine. I then right-clicked a different file and saw that PCManFM had added "Emacs (Client)" to the list (clever thing).
Unfortunately, this didn't work when there wasn't already an Emacs frame open. Much icon whirling, then nothing. I'm wondering if perhaps a bash
script might be needed to determine if a frame is already open. My knowledge of bash
is next to nothing, but I'm currently trying to learn it.
I didn't know about unsquashfs
. Thanks, I'll add it to my reading list.
Thank you for your help!