#1077080 emacs-pgtk: When emacs-pgtk fails to find a Wayland display available, it fails to run instead of opening in -nw mode

Package:
emacs-pgtk
Source:
emacs-pgtk
Description:
GNU Emacs editor (with GTK+ Wayland GUI support)
Submitter:
Gunnar Wolf
Date:
2025-03-20 15:21:02 UTC
Severity:
normal
#1077080#5
Date:
2024-07-26 01:22:08 UTC
From:
To:
I have Emacs installed in all of my systems. Paricularly, I have
emacs-pgtk all systems where I often use a graphical environment (and
emacs-nox in those where I don't).

Back when I used X11, if I started Emacs and had no $DISPLAY set, it
would open in a terminal. With emacs-pgtk, the behavior is not the
same:

    $ emacs foobar

    (emacs:3988): Gtk-WARNING **: 19:19:10.887: cannot open display:
    $

This impacted me because I neede to use a remote machine to do work
via scripts (i.e. dch, debcommit) that call /usr/bin/editor and I
found impossible to hand-specify emacs to use -nw; I ended up
installing emacs-nox, but I don't find it to be an acceptable,
transparent-enough solution.

I think emacs-pgtk should behave just as emacs-gtk, falling back to
the console if a windowed environment is not found.

Thanks!

#1077080#10
Date:
2024-07-26 02:14:14 UTC
From:
To:
Hello,

You know about 'emacs -nw' right?

I guess this is an upstream bug.

#1077080#15
Date:
2025-03-20 15:16:03 UTC
From:
To:
For those who, like me, accidentally noticed the issue: the error
message from this bug report was added to etc/PROBLEMS with the
following comments.

I have not tried to find upstream bugs for Emacs and Gtk projects.