]> git.eshelyaron.com Git - emacs.git/commitdiff
(cmd_error_internal): Exit when errors occur before
authorJason Rumney <jasonr@gnu.org>
Sun, 11 Jan 2009 13:26:39 +0000 (13:26 +0000)
committerJason Rumney <jasonr@gnu.org>
Sun, 11 Jan 2009 13:26:39 +0000 (13:26 +0000)
frame creation and not in daemon mode.  (Bug#1836)

src/ChangeLog
src/keyboard.c

index 5b5375ae423023045b500e7fe26efdbf72dcf6b2..2e4e22508cc35aaad21f4a4f28fde7edafe4a88c 100644 (file)
@@ -1,3 +1,8 @@
+2009-01-11  Jason Rumney  <jasonr@gnu.org>
+
+       * keyboard.c (cmd_error_internal): Exit when errors occur before
+       frame creation and not in daemon mode.  (Bug#1836)
+
 2009-01-10  Chong Yidong  <cyd@stupidchicken.com>
 
        * xdisp.c (pos_visible_p): When iterator stops on the last glyph
index 7fb035929dc5268ea397c9ebfc047d303391ee37..00c8a2af67a9a04f34c35d46c01ad9539fb4af32 100644 (file)
@@ -1265,18 +1265,17 @@ cmd_error_internal (data, context)
   /* 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.  */
+          /* The initial frame is a special non-displaying frame. It
+             will be current in daemon mode when there are no frames
+             to display, and in non-daemon mode before the real frame
+             has finished initializing.  If an error is thrown in the
+             latter case while creating the frame, then the frame
+             will never be displayed, so the safest thing to do is
+             write to stderr and quit.  In daemon mode, there are
+             many other potential errors that do not prevent frames
+             from being created, so continuing as normal is better in
+             that case.  */
+          || (!IS_DAEMON && FRAME_INITIAL_P (sf))
           || noninteractive)
     {
       print_error_message (data, Qexternal_debugging_output,