I have been having some issues with Fedora 38 Workstation: it freezes and sometimes even does not start at all. These problems started after I setup the Emacs Daemon to auto start as a systemd service. To do that, I followed the instructions in section “31.6 Using Emacs as a Server” of the Emacs Manual.

systemctl --user enable emacs

However, this resulted in the emacsclient -c command not working because this systemd process stared before the Wayland session. It can be proven because if I killed the Emacs Daemon loaded by systemd (emacsclient -e "(kill-emacs)") and opened a new one (emacs --daemon), it then worked.

In the beginning I changed to XOrg in the login screen, but that brought all the problems with Fedora. Then I found another solution which seems to work. It is based on putting a .desktop configuration file in the set of auto load applications. This will load emacs --daemon only once we have started the session.

~ $ \emacs ~/.config/autostart/emacs-daemon.desktop

[Desktop Entry]
Name=Emacs
GenericName=Text Editor
Comment=Edit text
Exec=/usr/bin/emacs --daemon
Icon=emacs
Type=Application
Terminal=false
Categories=Development;TextEditor;
StartupNotify=true
StartupWMClass=Emacs

Note that I have used \emacs to open the files, because I had some aliases to open emacsclient when typed emacs. This escapes the alias and goes directly to the program itself.

Then, to have an Emacs Client icon in the desktop, I created another file with the following content:

~ $ \emacs /usr/share/applications/emacsclient.desktop

[Desktop Entry]
Name=EmacsClient
GenericName=Text Editor
Comment=Edit text
MimeType=text/english;text/plain;text/x-makefile;text/x-c++hdr;text/x-c++src;text/x-chdr;text/x-csrc;text/x-java;text/x-moc;text/x-pascal;text/x-tcl;text/x-tex;application/x-shellscript;text/x-c;text/x-c++;
Exec=/usr/bin/emacsclient -c -a 'emacs' -F "'(fullscreen . maximized)" %F
Icon=emacs
Type=Application
Terminal=false
Categories=Development;TextEditor;
StartupNotify=true
StartupWMClass=Emacs

This solved all the problems I was having with Fedora freezing and not responding.

⋇ ⋇ ⋇ ⋇ ⋇

Thanks for reading the post! Do not hesitate to write me an email, and share your point of view 😉: contact@poview.org