From cd1d850fd1eef0e98a018c224ed2fe4852c17de3 Mon Sep 17 00:00:00 2001 From: John Paul Wallington Date: Wed, 2 Oct 2002 08:28:17 +0000 Subject: [PATCH] * 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. --- src/ChangeLog | 13 +++++++++++++ src/frame.c | 19 ++++++++++++++----- src/macfns.c | 5 +++++ src/w32fns.c | 5 +++++ src/xfns.c | 7 ++++++- 5 files changed, 43 insertions(+), 6 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 05d56cc6b4..e7055f1af2 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,16 @@ +2002-10-02 John Paul Wallington + + * 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. + 2002-09-30 Kenichi Handa * xterm.c (x_encode_char): For DIM=1 charset, set ccl->reg[2] to diff --git a/src/frame.c b/src/frame.c index ffd0c5ade1..b8fb2e1546 100644 --- a/src/frame.c +++ b/src/frame.c @@ -80,6 +80,7 @@ Lisp_Object Vterminal_frame; 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 @@ A frame may not be deleted if its minibuffer is used by other frames. 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 @@ frame. The hook is called with one argument FRAME. */) } } - /* 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 @@ is over the clickable text. However, the mouse shape still indicates 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. diff --git a/src/macfns.c b/src/macfns.c index 49e4aad78c..f1e42d17ae 100644 --- a/src/macfns.c +++ b/src/macfns.c @@ -9471,6 +9471,11 @@ x_create_tip_frame (dpyinfo, parms) f->height = 0; SET_FRAME_WIDTH (f, 0); change_frame_size (f, height, width, 1, 0, 0); + + /* Add `tooltip' frame parameter's default value. */ + if (NILP (Fframe_parameter (frame, intern ("tooltip")))) + Fmodify_frame_parameters (frame, Fcons (Fcons (intern ("tooltip"), Qt), + Qnil)); f->no_split = 1; diff --git a/src/w32fns.c b/src/w32fns.c index 574b321a93..2e0352ab68 100644 --- a/src/w32fns.c +++ b/src/w32fns.c @@ -13812,6 +13812,11 @@ x_create_tip_frame (dpyinfo, parms, text) SET_FRAME_WIDTH (f, 0); change_frame_size (f, height, width, 1, 0, 0); + /* Add `tooltip' frame parameter's default value. */ + if (NILP (Fframe_parameter (frame, intern ("tooltip")))) + Fmodify_frame_parameters (frame, Fcons (Fcons (intern ("tooltip"), Qt), + Qnil)); + /* Set up faces after all frame parameters are known. This call also merges in face attributes specified for new frames. diff --git a/src/xfns.c b/src/xfns.c index 2703565dbe..c20c0d0480 100644 --- a/src/xfns.c +++ b/src/xfns.c @@ -11143,7 +11143,12 @@ x_create_tip_frame (dpyinfo, parms, text) f->height = 0; SET_FRAME_WIDTH (f, 0); change_frame_size (f, height, width, 1, 0, 0); - + + /* Add `tooltip' frame parameter's default value. */ + if (NILP (Fframe_parameter (frame, intern ("tooltip")))) + Fmodify_frame_parameters (frame, Fcons (Fcons (intern ("tooltip"), Qt), + Qnil)); + /* Set up faces after all frame parameters are known. This call also merges in face attributes specified for new frames. -- 2.20.1