unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Robert Pluim <rpluim@gmail.com>
To: Phillip Susi <phill@thesusis.net>
Cc: Po Lu <luangruo@yahoo.com>, Eli Zaretskii <eliz@gnu.org>,
	63555@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	[thread overview]
Message-ID: <875y8klt89.fsf@gmail.com> (raw)
In-Reply-To: <87a5xyrjce.fsf@vps.thesusis.net> (Phillip Susi's message of "Sat, 20 May 2023 13:35:56 -0400")

>>>>> On Sat, 20 May 2023 13:35:56 -0400, Phillip Susi <phill@thesusis.net> said:

    Phillip> Eli Zaretskii <eliz@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
-- 





  reply	other threads:[~2023-05-22  7:29 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-17 13:51 bug#63555: emacs 29 complains that it can't connect to the display Phillip Susi
2023-05-17 14:09 ` Phillip Susi
2023-05-19  6:11 ` Eli Zaretskii
2023-05-19  7:22   ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-05-19 13:26     ` Robert Pluim
2023-05-19 14:52       ` Eli Zaretskii
2023-05-19 15:44         ` Robert Pluim
2023-05-20  1:40         ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-05-20  5:51           ` Eli Zaretskii
2023-05-20  6:33             ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-05-20  8:16               ` Eli Zaretskii
2023-05-20  8:28                 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-05-20 12:58                   ` Eli Zaretskii
2023-05-21  0:45                     ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-05-21  5:41                       ` Eli Zaretskii
2023-05-21  6:32                         ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-05-21 11:16                           ` Eli Zaretskii
2023-05-20  1:38       ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
     [not found] ` <handler.63555.D63555.168458752424255.notifdone@debbugs.gnu.org>
2023-05-20 17:35   ` bug#63555: closed (Re: bug#63555: emacs 29 complains that it can't connect to the display) Phillip Susi
2023-05-22  7:29     ` Robert Pluim [this message]
2023-05-22  9:26       ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-05-22 10:05         ` Robert Pluim
2023-05-22 11:15           ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-05-22 11:28             ` Robert Pluim
2023-05-22 12:50               ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-05-22 13:37             ` Phillip Susi
2023-05-23  0:31               ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-05-23 14:59                 ` Phillip Susi
2023-05-24  0:20                   ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-05-25 15:38                     ` Phillip Susi
2023-05-26  1:00                       ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-05-26  8:38                         ` Robert Pluim
2023-05-26 15:54                           ` Phillip Susi
2023-05-27  0:48                             ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-05-30 17:31                               ` Phillip Susi
2023-05-31  1:19                                 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-05-22 16:44       ` Phillip Susi
2023-05-22 17:05         ` Robert Pluim
2023-05-23 14:58           ` Phillip Susi
2023-06-08  6:02 ` Daan Ro

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=875y8klt89.fsf@gmail.com \
    --to=rpluim@gmail.com \
    --cc=63555@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=luangruo@yahoo.com \
    --cc=phill@thesusis.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).