patch 7.4.2193
Problem:    With Gnome when the GUI can't start test_startup hangs.
Solution:   Call gui_mch_early_init_check(). (Hirohito Higashi)
diff --git a/src/gui_gtk_x11.c b/src/gui_gtk_x11.c
index 939ecde..7c63a49 100644
--- a/src/gui_gtk_x11.c
+++ b/src/gui_gtk_x11.c
@@ -542,8 +542,10 @@
 	}
 
 	/* These arguments make gnome_program_init() print a message and exit.
-	 * Must start the GUI for this, otherwise ":gui" will exit later! */
-	if (option->flags & ARG_NEEDS_GUI)
+	 * Must start the GUI for this, otherwise ":gui" will exit later!
+	 * Only when the GUI can start. */
+	if ((option->flags & ARG_NEEDS_GUI)
+				      && gui_mch_early_init_check(FALSE) == OK)
 	    gui.starting = TRUE;
 
 	if (option->flags & ARG_KEEP)
@@ -1663,7 +1665,7 @@
  * Return OK or FAIL.
  */
     int
-gui_mch_early_init_check(void)
+gui_mch_early_init_check(int give_message)
 {
     char_u *p;
 
@@ -1672,7 +1674,8 @@
     if (p == NULL || *p == NUL)
     {
 	gui.dying = TRUE;
-	EMSG(_((char *)e_opendisp));
+	if (give_message)
+	    EMSG(_((char *)e_opendisp));
 	return FAIL;
     }
     return OK;