diff options
author | Andrew Choi <akochoi@shaw.ca> | 2000-12-12 04:50:33 +0000 |
---|---|---|
committer | Andrew Choi <akochoi@shaw.ca> | 2000-12-12 04:50:33 +0000 |
commit | 1abce464182f2992bd66a6cf0932e0f9c5718192 (patch) | |
tree | d710407c7ffc8a070db921d7e317cf15dbf0464c /mac | |
parent | a47a168c5f556b39e6830846641aebf9c71b2fab (diff) | |
download | emacs-1abce464182f2992bd66a6cf0932e0f9c5718192.tar.gz |
* src/macfns.c (x_create_tip_frame, Fx_hide_tip): change to handle
Lisp_Object type tip_frame (was struct frame *) as in xfns.c.
Diffstat (limited to 'mac')
-rw-r--r-- | mac/ChangeLog | 5 | ||||
-rw-r--r-- | mac/src/macfns.c | 39 |
2 files changed, 32 insertions, 12 deletions
diff --git a/mac/ChangeLog b/mac/ChangeLog index 42e230e751f..91c0fd6c029 100644 --- a/mac/ChangeLog +++ b/mac/ChangeLog @@ -1,3 +1,8 @@ +2000-12-12 Andrew Choi <akochoi@i-cable.com> + + * src/macfns.c (x_create_tip_frame, Fx_hide_tip): change to handle + Lisp_Object type tip_frame (was struct frame *) as in xfns.c. + 2000-11-26 Andrew Choi <akochoi@i-cable.com> * src/macterm.c (x_handle_tool_bar_click): diff --git a/mac/src/macfns.c b/mac/src/macfns.c index bb3ba197cac..490da7979fe 100644 --- a/mac/src/macfns.c +++ b/mac/src/macfns.c @@ -8970,7 +8970,7 @@ static Lisp_Object x_create_tip_frame P_ ((struct w32_display_info *, /* The frame of a currently visible tooltip, or null. */ -struct frame *tip_frame; +Lisp_Object tip_frame; /* If non-nil, a timer started that hides the last tooltip when it fires. */ @@ -9272,7 +9272,7 @@ TIMEOUT nil means use the default timeout of 5 seconds.") /* Create a frame for the tooltip, and record it in the global variable tip_frame. */ frame = x_create_tip_frame (FRAME_MAC_DISPLAY_INFO (f), parms); - tip_frame = f = XFRAME (frame); + f = XFRAME (frame); /* Set up the frame's root window. Currently we use a size of 80 columns x 40 lines. If someone wants to show a larger tip, he @@ -9363,28 +9363,43 @@ DEFUN ("x-hide-tip", Fx_hide_tip, Sx_hide_tip, 0, 0, 0, Value is t is tooltip was open, nil otherwise.") () { - int count = specpdl_ptr - specpdl; - int deleted_p = 0; + int count; + Lisp_Object deleted; + + /* Return quickly if nothing to do. */ + if (NILP (tip_timer) && !FRAMEP (tip_frame)) + return Qnil; + count = BINDING_STACK_SIZE (); + deleted = Qnil; specbind (Qinhibit_redisplay, Qt); + specbind (Qinhibit_quit, Qt); if (!NILP (tip_timer)) { - call1 (intern ("cancel-timer"), tip_timer); + Lisp_Object tem; + struct gcpro gcpro1; + tem = tip_timer; + GCPRO1 (tem); tip_timer = Qnil; + call1 (intern ("cancel-timer"), tem); + UNGCPRO; } - if (tip_frame) + if (FRAMEP (tip_frame)) { Lisp_Object frame; - - XSETFRAME (frame, tip_frame); - Fdelete_frame (frame, Qt); - tip_frame = NULL; - deleted_p = 1; + struct gcpro gcpro1; + + frame = tip_frame; + GCPRO1 (frame); + tip_frame = Qnil; + Fdelete_frame (frame, Qnil); + deleted = Qt; + UNGCPRO; } - return unbind_to (count, deleted_p ? Qt : Qnil); + return unbind_to (count, deleted); } |