diff options
Diffstat (limited to 'src/frame.c')
| -rw-r--r-- | src/frame.c | 57 |
1 files changed, 40 insertions, 17 deletions
diff --git a/src/frame.c b/src/frame.c index 648687a7cb4..5fa54052cd2 100644 --- a/src/frame.c +++ b/src/frame.c @@ -389,7 +389,7 @@ make_frame (int mini_p) etc. Running Lisp functions at this point surely ends in a SEGV. */ set_window_buffer (root_window, buf, 0, 0); - fset_buffer_list (f, Fcons (buf, Qnil)); + fset_buffer_list (f, list1 (buf)); } if (mini_p) @@ -726,15 +726,15 @@ affects all frames on the same terminal device. */) calculate_costs (f); XSETFRAME (frame, f); Fmodify_frame_parameters (frame, parms); - Fmodify_frame_parameters (frame, Fcons (Fcons (Qtty_type, - build_string (t->display_info.tty->type)), - Qnil)); + Fmodify_frame_parameters + (frame, list1 (Fcons (Qtty_type, + build_string (t->display_info.tty->type)))); if (t->display_info.tty->name != NULL) - Fmodify_frame_parameters (frame, Fcons (Fcons (Qtty, - build_string (t->display_info.tty->name)), - Qnil)); + Fmodify_frame_parameters + (frame, list1 (Fcons (Qtty, + build_string (t->display_info.tty->name)))); else - Fmodify_frame_parameters (frame, Fcons (Fcons (Qtty, Qnil), Qnil)); + Fmodify_frame_parameters (frame, list1 (Fcons (Qtty, Qnil))); /* Make the frame face alist be frame-specific, so that each frame could change its face definitions independently. */ @@ -887,6 +887,26 @@ This function returns FRAME, or nil if FRAME has been deleted. */) return do_switch_frame (frame, 1, 0, norecord); } +DEFUN ("handle-focus-in", Fhandle_focus_in, Shandle_focus_in, 1, 1, "e", + doc: /* Handle a focus-in event. +Focus in events are usually bound to this function. +Focus in events occur when a frame has focus, but a switch-frame event +is not generated. +This function checks if blink-cursor timers should be turned on again. */) + (Lisp_Object event) +{ + return call0 (intern ("blink-cursor-check")); +} + +DEFUN ("handle-focus-out", Fhandle_focus_out, Shandle_focus_out, 1, 1, "e", + doc: /* Handle a focus-out event. +Focus out events are usually bound to this function. +Focus out events occur when no frame has focus. +This function checks if blink-cursor timers should be turned off. */) + (Lisp_Object event) +{ + return call0 (intern ("blink-cursor-suspend")); +} DEFUN ("handle-switch-frame", Fhandle_switch_frame, Shandle_switch_frame, 1, 1, "e", doc: /* Handle a switch-frame event EVENT. @@ -902,6 +922,7 @@ to that frame. */) /* Preserve prefix arg that the command loop just cleared. */ kset_prefix_arg (current_kboard, Vcurrent_prefix_arg); Frun_hooks (1, &Qmouse_leave_buffer_hook); + Fhandle_focus_in (event); // switch-frame implies a focus in. return do_switch_frame (event, 0, 0, Qnil); } @@ -2731,7 +2752,7 @@ x_set_frame_parameters (FRAME_PTR f, Lisp_Object alist) { left_no_change = 1; if (f->left_pos < 0) - left = Fcons (Qplus, Fcons (make_number (f->left_pos), Qnil)); + left = list2 (Qplus, make_number (f->left_pos)); else XSETINT (left, f->left_pos); } @@ -2739,7 +2760,7 @@ x_set_frame_parameters (FRAME_PTR f, Lisp_Object alist) { top_no_change = 1; if (f->top_pos < 0) - top = Fcons (Qplus, Fcons (make_number (f->top_pos), Qnil)); + top = list2 (Qplus, make_number (f->top_pos)); else XSETINT (top, f->top_pos); } @@ -2874,13 +2895,13 @@ x_report_frame_params (struct frame *f, Lisp_Object *alistptr) if (f->left_pos >= 0) store_in_alist (alistptr, Qleft, tem); else - store_in_alist (alistptr, Qleft, Fcons (Qplus, Fcons (tem, Qnil))); + store_in_alist (alistptr, Qleft, list2 (Qplus, tem)); XSETINT (tem, f->top_pos); if (f->top_pos >= 0) store_in_alist (alistptr, Qtop, tem); else - store_in_alist (alistptr, Qtop, Fcons (Qplus, Fcons (tem, Qnil))); + store_in_alist (alistptr, Qtop, list2 (Qplus, tem)); store_in_alist (alistptr, Qborder_width, make_number (f->border_width)); @@ -3739,7 +3760,7 @@ x_default_parameter (struct frame *f, Lisp_Object alist, Lisp_Object prop, tem = x_frame_get_arg (f, alist, prop, xprop, xclass, type); if (EQ (tem, Qunbound)) tem = deflt; - x_set_frame_parameters (f, Fcons (Fcons (prop, tem), Qnil)); + x_set_frame_parameters (f, list1 (Fcons (prop, tem))); return tem; } @@ -3871,9 +3892,9 @@ On Nextstep, this just calls `ns-parse-geometry'. */) Lisp_Object element; if (x >= 0 && (geometry & XNegative)) - element = Fcons (Qleft, Fcons (Qminus, Fcons (make_number (-x), Qnil))); + element = list3 (Qleft, Qminus, make_number (-x)); else if (x < 0 && ! (geometry & XNegative)) - element = Fcons (Qleft, Fcons (Qplus, Fcons (make_number (x), Qnil))); + element = list3 (Qleft, Qplus, make_number (x)); else element = Fcons (Qleft, make_number (x)); result = Fcons (element, result); @@ -3884,9 +3905,9 @@ On Nextstep, this just calls `ns-parse-geometry'. */) Lisp_Object element; if (y >= 0 && (geometry & YNegative)) - element = Fcons (Qtop, Fcons (Qminus, Fcons (make_number (-y), Qnil))); + element = list3 (Qtop, Qminus, make_number (-y)); else if (y < 0 && ! (geometry & YNegative)) - element = Fcons (Qtop, Fcons (Qplus, Fcons (make_number (y), Qnil))); + element = list3 (Qtop, Qplus, make_number (y)); else element = Fcons (Qtop, make_number (y)); result = Fcons (element, result); @@ -4449,6 +4470,8 @@ automatically. See also `mouse-autoselect-window'. */); defsubr (&Swindow_system); defsubr (&Smake_terminal_frame); defsubr (&Shandle_switch_frame); + defsubr (&Shandle_focus_in); + defsubr (&Shandle_focus_out); defsubr (&Sselect_frame); defsubr (&Sselected_frame); defsubr (&Sframe_list); |
