bhavin192/emacs-pretest

Pretest version builds: https://alpha.gnu.org/gnu/emacs/pretest/

Instructions not filled in by author. Author knows what to do. Everybody else should avoid this repo.


This is a companion discussion topic for the original entry at https://copr.fedorainfracloud.org/coprs/bhavin192/emacs-pretest/

Thanks for the package. I get this error everytime I run Emacs: “You are trying to run Emacs configured with the pure-GTK interface under the X Window System. That configuration is unsupported and will lead to sporadic crashes during transfer of large selection data. It will also lead to various problems with keyboard input.”

I’m running Emacs on the KDE Plasma Spin of Fedora 38, using the X server. Apparently the binary should be compiled without the --with-pgtk flag.

A binary for running under X is included in the package… instead of starting emacs with ‘emacs’ start it with ‘emacs-gtk+x11’.

If someone wants to test this on Silverblue, they’ll have an issue as the emacs-filesystem package is included in the base image.

To work around this, you can do like this (after removing any Emacs-related overrides you may have previously):

  • Download the COPR repo file and copy it to /etc/yum.repos.d/bhavin192-emacs-pretest.repo
    Run rpm-ostree override replace 'https://download.copr.fedorainfracloud.org/results/bhavin192/emacs-pretest/fedora-37-x86_64/05870602-emacs/emacs-filesystem-29.0.90-1.fc37.noarch.rpm' (replace with link matching the build you want).
  • Run rpm-ostree install emacs. This should now get the same build from the COPR that matches the emacs-filesystem you updated to.

Your rpm-ostree status should now have something like

LocalOverrides: emacs-filesystem 1:28.2-3.fc37 -> 1:29.0.90-1.fc37
LayeredPackages: emacs

To upgrade to a newer build, you’ll need to remove these overrides and start over with the new emacs-filesystem link.

Like @jbotz said, install emacs-gtk+x11 package. And then launching Emacs normally with application entry should open the Emacs compiled without pgtk. Let me know if that doesn’t work. Also, can you share output of following command:

echo $XDG_SESSION_TYPE 

You can remove the emacs package afterwards. I’m thinking of modifying that error message with a hint about emacs-gkt+x11 package.

@jbotz @bhavin192

Running the emacs-gkt+x11 binary works fine. However, I couldn’t manage to make it work with the systemd service.

The output of

echo $XDG_SESSION_TYPE 

is

x11

Understood. Uninstalling the emacs package might help with the systemd service as alternatives will update the /usr/bin/emacs so it starts pointing to emacs-gtk+x11. But that will also remove the emacs.desktop file i.e. entry from the applications list in your desktop environment. I will see what can be done for this.

Another temporary workaround is to use alternatives and select gtk+x11 Emacs.

sudo update-alternatives --config emacs

@bhavin192 Thanks! The latter method worked fine for me. Best wishes.

I filed a bug about the unnecessarily strict dependency on having the exact matching version of emacs-filesystem here: 2212452 – Unnecessarily strict dependency on emacs-filesystem

I guess we should patch emacs.service to call emacs-desktop instead of emacs.

Could someone affected by this issue try running systemctl --user edit emacs.service and see if adding the following lines solves the problem?

[Service]
ExecStart=/usr/bin/emacs-desktop --fg-daemon

Hi @bhavin192! Can you please turn on builds for aarch64 too? I forked your copr and submitted a build and it worked.

Since this was fixed in Fedora 41, it’s now possible to use this COPR on Silverblue without any rpm-ostree override commands.