Mercurial > emacs
diff src/frame.c @ 47731:755c4233cfba
* frame.c (Vdelete_frame_functions): New variable.
(syms_of_frame): Initialize and defvar it.
(Fdelete_frame): Use it instead of delete-frame-hook. Don't run
it when frame's `tooltip' parameter is non-nil.
* xfns.c (x_create_tip_frame): Set `tooltip' frame parameter to t.
* w32fns.c (x_create_tip_frame): Likewise
* macfns.c (x_create_tip_frame): Likewise.
| author | John Paul Wallington <jpw@pobox.com> |
|---|---|
| date | Wed, 02 Oct 2002 08:28:17 +0000 |
| parents | 9d848dcc4b5d |
| children | 23a1cea22d13 |
line wrap: on
line diff
--- a/src/frame.c Tue Oct 01 20:27:23 2002 +0000 +++ b/src/frame.c Wed Oct 02 08:28:17 2002 +0000 @@ -80,6 +80,7 @@ Lisp_Object Vdefault_frame_alist; Lisp_Object Vmouse_position_function; Lisp_Object Vmouse_highlight; +Lisp_Object Vdelete_frame_functions; static void set_menu_bar_lines_1 (window, n) @@ -1092,8 +1093,9 @@ Normally, you may not delete a frame if all other frames are invisible, but if the second optional argument FORCE is non-nil, you may do so. -This function runs `delete-frame-hook' before actually deleting the -frame. The hook is called with one argument FRAME. */) +This function runs `delete-frame-functions' before actually deleting the +frame, unless the frame is a tooltip. +The functions are run with one arg, the frame to be deleted. */) (frame, force) Lisp_Object frame, force; { @@ -1152,11 +1154,12 @@ } } - /* Run `delete-frame-hook'. */ - if (!NILP (Vrun_hooks)) + /* Run `delete-frame-functions' unless frame is a tooltip. */ + if (!NILP (Vrun_hooks) + && NILP (Fframe_parameter (frame, intern ("tooltip")))) { Lisp_Object args[2]; - args[0] = intern ("delete-frame-hook"); + args[0] = intern ("delete-frame-functions"); args[1] = frame; Frun_hook_with_args (2, args); } @@ -2529,6 +2532,12 @@ when the mouse is over clickable text. */); Vmouse_highlight = Qt; + DEFVAR_LISP ("delete-frame-functions", &Vdelete_frame_functions, + doc: /* Functions to be run before deleting a frame. +The functions are run with one arg, the frame to be deleted. +See `delete-frame'. */); + Vdelete_frame_functions = Qnil; + DEFVAR_KBOARD ("default-minibuffer-frame", Vdefault_minibuffer_frame, doc: /* Minibufferless frames use this frame's minibuffer.
