GNU bug report logs - #63555
emacs 29 complains that it can't connect to the display

Previous Next

Package: emacs;

Reported by: Phillip Susi <phill <at> thesusis.net>

Date: Wed, 17 May 2023 13:55:03 UTC

Severity: normal

Found in version 29.0.90

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Robert Pluim <rpluim <at> gmail.com>
To: Phillip Susi <phill <at> thesusis.net>
Cc: Po Lu <luangruo <at> yahoo.com>, Eli Zaretskii <eliz <at> gnu.org>, 63555 <at> debbugs.gnu.org
Subject: bug#63555: closed (Re: bug#63555: emacs 29 complains that it can't connect to the display)
Date: Mon, 22 May 2023 09:29:10 +0200
>>>>> On Sat, 20 May 2023 13:35:56 -0400, Phillip Susi <phill <at> thesusis.net> said:

    Phillip> Eli Zaretskii <eliz <at> gnu.org> writes:

    >> > Can we invoke those same functions earlier during startup to realize
    >> > this fact where we still can start as -nw?
    >> 
    >> Unfortunately not.  At least, not enough to make a change suitable for
    >> the release branch.

    Phillip> Why not?  How hard can it be to set -nw if neither DISPLAY nor
    Phillip> WAYLAND_DISPLAY is set, as emacs always has, prior to
    Phillip> window-system-initialization?

Not too hard. Very much for master, though (and Iʼd need to check if
gtk_init_check has any GTK version dependencies).

diff --git a/src/dispnew.c b/src/dispnew.c
index a928a5d1b14..9a23fb5a182 100644
--- a/src/dispnew.c
+++ b/src/dispnew.c
@@ -6518,7 +6518,28 @@ init_display_interactive (void)
      try to use X, and if that fails output a line to stderr
      reporting that -nw will be simulated.  */
 
-#ifdef HAVE_X_WINDOWS
+#ifdef HAVE_PGTK
+  if (! inhibit_window_system)
+    {
+     if (! gtk_init_check (0, 0))
+	{
+	  fprintf (stderr, "PGTK display unavailable, simulating -nw\nCheck your $DISPLAY, $WAYLAND_DISPLAY, or $BROADWAY_DISPLAY\n");
+	  inhibit_window_system = 1;
+	}
+    }
+
+  if (!inhibit_window_system)
+    {
+      Vinitial_window_system = Qpgtk;
+#ifdef USE_NCURSES
+      /* In some versions of ncurses,
+	 tputs crashes if we have not called tgetent.
+	 So call tgetent.  */
+      { char b[2044]; tgetent (b, "xterm");}
+#endif
+      return;
+    }
+#elif defined (HAVE_X_WINDOWS)
   if (! inhibit_window_system && ! display_arg)
     {
       char *display;


Robert
-- 




This bug report was last modified 263 days ago.

Previous Next


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