Subject: Re: bug#63555: closed (Re: bug#63555: emacs 29 complains that it can't connect to the display)

From: Robert Pluim <[email-masked]>
Date: Mon, 22 May 2023 19:05:57 +0200

>>>>> On Mon, 22 May 2023 12:44:40 -0400, Phillip Susi <[email-masked]> said:

    Phillip> This patch works for me.

    Phillip> Index: b/src/dispnew.c
    Phillip> ===================================================================
    Phillip> --- a/src/dispnew.c
    Phillip> +++ b/src/dispnew.c
    Phillip> @@ -6559,8 +6558,20 @@ init_display_interactive (void)
    Phillip>  #ifdef HAVE_PGTK
    Phillip>    if (!inhibit_window_system && !will_dump_p ())
    Phillip>      {
    Phillip> -      Vinitial_window_system = Qpgtk;
    Phillip> -      return;
    Phillip> +      char *display, *wayland_display;
    Phillip> +      display = getenv ("DISPLAY");
    Phillip> +      wayland_display = getenv ("WAYLAND_DISPLAY");
    Phillip> +
    Phillip> +      if (display == NULL && wayland_display == NULL)
    Phillip> +	{
    Phillip> +	  fprintf (stderr, "Neither DISPLAY nor WAYLAND_DISPLAY are set, simulating -nw\n");
    Phillip> +	  inhibit_window_system = 1;
    Phillip> +	}
    Phillip> +      else
    Phillip> +	{
    Phillip> +	  Vinitial_window_system = Qpgtk;
    Phillip> +	  return;
    Phillip> +	}
    Phillip>      }
    Phillip>  #endif
 
I think you need to check for them being non-empty as well

Robert
--