# HG changeset patch # User Gerd Moellmann # Date 972562037 0 # Node ID 44cb0900a8587cc30503ae4b50461de1d2f07eba # Parent 7c15ab25a62c70509a05bd7c0d459ccc360ab329 (Fdelete_frame): Doc fix. Move running the hook down after the last error condition check. diff -r 7c15ab25a62c -r 44cb0900a858 src/frame.c --- a/src/frame.c Thu Oct 26 11:59:45 2000 +0000 +++ b/src/frame.c Thu Oct 26 12:07:17 2000 +0000 @@ -1137,7 +1137,10 @@ If omitted, FRAME defaults to the selected frame.\n\ A frame may not be deleted if its minibuffer is used by other frames.\n\ Normally, you may not delete a frame if all other frames are invisible,\n\ -but if the second optional argument FORCE is non-nil, you may do so.") +but if the second optional argument FORCE is non-nil, you may do so.\n\ +\n\ +This function runs `delete-frame-hook' before actually deleting the\n\ +frame. The hook is called with one argument FRAME.") (frame, force) Lisp_Object frame, force; { @@ -1169,14 +1172,6 @@ error ("Attempt to delete the only frame"); #endif - if (!NILP (Vrun_hooks)) - { - Lisp_Object args[2]; - args[0] = intern ("delete-frame-hook"); - args[1] = frame; - Frun_hook_with_args (2, args); - } - /* Does this frame have a minibuffer, and is it the surrogate minibuffer for any other frame? */ if (FRAME_HAS_MINIBUF_P (XFRAME (frame))) @@ -1198,6 +1193,15 @@ } } + /* Run `delete-frame-hook'. */ + if (!NILP (Vrun_hooks)) + { + Lisp_Object args[2]; + args[0] = intern ("delete-frame-hook"); + args[1] = frame; + Frun_hook_with_args (2, args); + } + minibuffer_selected = EQ (minibuf_window, selected_window); /* Don't let the frame remain selected. */