The current ebuilds for app-editors/emacs:29-vcs and app-editors/emacs:30-vcs set --with-pgtk only with USE=-X. However, at least emacs-30.0.9999 (I did not try earlier versions) can be compiled with support for pgtk and X simultaneously. It depends then on some environment variable settings whether emacs runs in wayland or X mode. In the latter case, a warning is displayed that emacs *might* crash, but it seems to work fine and is very useful if you are in an X session instead of a wayland session. Although this can be forced with EXTRA_ECONF=--with-pgtk, I think it would be great to have besides the USE-flags X also some USE-flag for --with-pgtk which can be enabled independently of the X flag. The ebuild might display a warning message if both are enabled as the combination is officially discouraged, but as mentioned above, at least in my setup it works fine if both are enabled. For users who switch sometimes between X and wayland sessions this would be a very useful feature.
I think with USE="gtk" all work in picking a X or wayland backend is "offloaded" to GTK+, so why bother with X UI then? > # Emacs supports these window systems: > # X11, pure GTK (without X11), or Nextstep (Aqua/Cocoa). > # General GUI support is enabled by the "gui" USE flag, then > # the window system is selected as follows: > # "aqua" -> Nextstep > # "gtk -X" -> pure GTK > # otherwise -> X11 > # For X11 there is the further choice of toolkits GTK, Motif, > # Athena (Lucid), or no toolkit. They are enabled (in order of > # preference) with the "gtk", "motif", "Xaw3d", and "athena" flags. So a important question here is whether the latest Emacs version runs on X11 when USE="gui -X" is set.
> So a important question here is whether the latest Emacs version runs on X11 > when USE="gui -X" is set. Reportedly it works but is very buggy.
> runs on X11 when USE="gui -X" is set. I had not tried, because I had not expected it. However, you are completely right: app-editor/emacs:30-vcs[gtk X] with EXTRA_ECONF='--with-pgtk' app-editor/emacs:30-vcs[gtk -X] behave functionally equivalent.