GNU bug report logs - #65886
29.1; pgtk emacs should assume --no-window-system when there is no window system

Previous Next

Package: emacs;

Reported by: "Trent W. Buck" <trentbuck <at> gmail.com>

Date: Tue, 12 Sep 2023 05:16:02 UTC

Severity: normal

Found in version 29.1

Full log


Message #8 received at 65886 <at> debbugs.gnu.org (full text, mbox):

From: Po Lu <luangruo <at> yahoo.com>
To: "Trent W. Buck" <trentbuck <at> gmail.com>
Cc: 65886 <at> debbugs.gnu.org
Subject: Re: bug#65886: 29.1; pgtk emacs should assume --no-window-system
 when there is no window system
Date: Tue, 12 Sep 2023 15:43:59 +0800
"Trent W. Buck" <trentbuck <at> gmail.com> writes:

> What I actually want is for "git mergetool" to open emacs in my terminal, not popup a GUI window.
> Because teaching /usr/lib/git-core/mergetools/emerge to (sometimes!) pass "-nw" to emacs seemed fiddly,
> I used to achieve this via a quick-and-dirty hack:
>
>     DISPLAY= git mergetool
>
> Right now this doesn't work in my pgtk emacs:
>
>     bash5$ DISPLAY= WAYLAND_DISPLAY= emacs -Q
>
>     (emacs:3064023): Gtk-WARNING **: 14:59:49.225: cannot open display: 
>
>     bash5$ env -i TERM="$TERM" emacs -Q
>
>     (emacs:3064224): Gtk-WARNING **: 15:00:32.320: cannot open display: 
>
> If there is no valid GUI and there is a valid terminal,
> I want emacs to open in the terminal -- not to error.

Unfortunately, this isn't possible without employing window system
specific APIs, the avoidance of which served as the impetus for the PGTK
port and still remains one of its principal design objectives.  Refer to
bug#63555, which details both the reason the approach taken by the X
port cannot function under PGTK, and why GDK's own initialization
functions are inadequate.

> Non-pgtk GTK emacs does this, i.e. this is a regression/inconsistency.

This is because here, Emacs knows exactly which GDK backend will be
loaded (X11) and what environment variable to check.




This bug report was last modified 1 year and 277 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.