From c1861b665856697fb01a6d7a273d2b85f6a92f01 Mon Sep 17 00:00:00 2001 From: adisbladis Date: Sat, 3 Sep 2022 15:10:04 +1200 Subject: [PATCH] emacs: Switch to lucid as the default toolkit Because of long standing bugs and stability issues & an uncollaborative upstream there has been talk on the emacs-devel mailing list to switch the default toolkit to Lucid (https://lists.gnu.org/archive/html/emacs-devel/2022-08/msg00752.html). The GTK build also has issues with Xinput2, something that both we and upstream want to enable by default in Emacs 29. This situation has prompted me to use both Lucid an no-toolkit (pure X11) Emacs as a daily driver in recent weeks to evaluate what the advantages/drawbacks are and I have concluded that, at least for me, switching the toolkit to Lucid is strictly an upgrade. It has resulted in better stability (there are far fewer tiny UX issues that are hard to understand/identify) & a snappier UI. On top of that the closure size is reduced by ~10%. In the pure X11 build I noticed some unsharpness around fonts so this is not a good default choice. As with everything there is a cost, and that is uglier (I think most would agree but of course this is subjective) menu bars for those that use them and no GTK scroll bars. For anyone who still wants to use GTK they could of course still choose to do so via the new `emacs-gtk` attribute but I think this is a bad default. A note to Wayland users: This does not affect Wayland compatibility in any way since that will already need a PGTK build variant in the future. --- .../doc/manual/from_md/release-notes/rl-2211.section.xml | 8 ++++++++ nixos/doc/manual/release-notes/rl-2211.section.md | 3 +++ pkgs/applications/editors/emacs/generic.nix | 2 +- pkgs/top-level/all-packages.nix | 5 +++++ 4 files changed, 17 insertions(+), 1 deletion(-) diff --git a/nixos/doc/manual/from_md/release-notes/rl-2211.section.xml b/nixos/doc/manual/from_md/release-notes/rl-2211.section.xml index e3c76918911a..0c23082ab0e3 100644 --- a/nixos/doc/manual/from_md/release-notes/rl-2211.section.xml +++ b/nixos/doc/manual/from_md/release-notes/rl-2211.section.xml @@ -384,6 +384,14 @@ cosigned binary anymore. + + + Emacs now uses the Lucid toolkit by default instead of GTK + because of stability and compatibility issues. Users who still + wish to remain using GTK can do so by using + emacs-gtk. + + riak package removed along with diff --git a/nixos/doc/manual/release-notes/rl-2211.section.md b/nixos/doc/manual/release-notes/rl-2211.section.md index afeaa7aaac73..c4dc8f0c4522 100644 --- a/nixos/doc/manual/release-notes/rl-2211.section.md +++ b/nixos/doc/manual/release-notes/rl-2211.section.md @@ -134,6 +134,9 @@ Available as [services.patroni](options.html#opt-services.patroni.enable). - `pkgs.cosign` does not provide the `cosigned` binary anymore. +- Emacs now uses the Lucid toolkit by default instead of GTK because of stability and compatibility issues. + Users who still wish to remain using GTK can do so by using `emacs-gtk`. + - riak package removed along with `services.riak` module, due to lack of maintainer to update the package. - xow package removed along with the `hardware.xow` module, due to the project being deprecated in favor of `xone`, which is available via the `hardware.xone` module. diff --git a/pkgs/applications/editors/emacs/generic.nix b/pkgs/applications/editors/emacs/generic.nix index 4243ad47a243..69061f044f34 100644 --- a/pkgs/applications/editors/emacs/generic.nix +++ b/pkgs/applications/editors/emacs/generic.nix @@ -18,7 +18,7 @@ , withX ? !stdenv.isDarwin , withNS ? stdenv.isDarwin , withGTK2 ? false, gtk2-x11 ? null -, withGTK3 ? true, gtk3-x11 ? null, gsettings-desktop-schemas ? null +, withGTK3 ? false, gtk3-x11 ? null, gsettings-desktop-schemas ? null , withXwidgets ? false, webkitgtk ? null, wrapGAppsHook ? null, glib-networking ? null , withMotif ? false, motif ? null , withSQLite3 ? false diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 8ff267fbc334..6df4a8fd9862 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -27084,6 +27084,7 @@ with pkgs; em = callPackage ../applications/editors/em { }; emacs = emacs28; + emacs-gtk = emacs28-gtk; emacs-nox = emacs28-nox; emacs28 = callPackage ../applications/editors/emacs/28.nix { @@ -27098,6 +27099,10 @@ with pkgs; inherit (darwin) sigtool; }; + emacs28-gtk = emacs28.override { + withGTK3 = true; + }; + emacs28-nox = lowPrio (emacs28.override { withX = false; withNS = false;