Subject: Re: bug#1836: emacs -Q -fn "nonexistent" hangs

From: Jason Rumney <[email-masked]>
Date: Sat, 10 Jan 2009 11:53:56 +0800

The following change seems to fix the problem for me, but I haven't 
tested daemon mode, since I don't know the circumstances in which there 
was a problem in that case (surely a non-existent font should still 
cause an error in daemon mode, since it will prevent frames from being 
created later).

*** keyboard.c.~1.988.~    2009-01-10 00:01:32.703125000 +0800
--- keyboard.c    2009-01-10 11:50:39.984375000 +0800
***************
*** 1265,1282 ****
    /* If the window system or terminal frame hasn't been initialized
       yet, or we're not interactive, write the message to stderr and 
exit.  */
    else if (!sf->glyphs_initialized_p
!        /* We used to check if "This is the case of the frame dumped with
!               Emacs, when we're running under a window system" with
!             || (!NILP (Vwindow_system) && !inhibit_window_system
!                 && FRAME_TERMCAP_P (sf))
!           then the multi-tty code generalized this check to
!             || FRAME_INITIAL_P (sf)
!           but this leads to undesirable behavior in daemon mode where
!           we don't want to exit just because we got an error without
!           having a frame (bug#1310).
!           So I just removed the check, and rely instead on the `message_*'
!           functions properly using FRAME_INITIAL_P.  In the worst case
!           this should just make Emacs not exit when it should.  */
         || noninteractive)
      {
        print_error_message (data, Qexternal_debugging_output,
--- 1265,1271 ----
    /* If the window system or terminal frame hasn't been initialized
       yet, or we're not interactive, write the message to stderr and 
exit.  */
    else if (!sf->glyphs_initialized_p
!        || (!IS_DAEMON && FRAME_INITIAL_P (sf))
         || noninteractive)
      {
        print_error_message (data, Qexternal_debugging_output,