+2013-11-19 Brian Jenkins <brian@brianjenkins.org> (tiny change)
+
+ Add hooks to run on gaining/losing focus. (Bug#15029)
+ * frame.c (Qfocus_in_hook, Qfocus_out_hook): New static lisp objects.
+ (Fhandle_focus_in, Fhandle_focus_out): Run focus hooks.
+ (syms_of_frame): Add focus-in-hook, focus-out-hook.
+
2013-11-18 Paul Eggert <eggert@cs.ucla.edu>
* data.c (bool_vector_binop_driver): Rename locals for sanity's sake.
Lisp_Object Qface_set_after_frame_default;
+static Lisp_Object Qfocus_in_hook;
+static Lisp_Object Qfocus_out_hook;
static Lisp_Object Qdelete_frame_functions;
static Lisp_Object Qgeometry, Qworkarea, Qmm_size, Qframes, Qsource;
This function checks if blink-cursor timers should be turned on again. */)
(Lisp_Object event)
{
+ Frun_hooks (1, &Qfocus_in_hook);
return call0 (intern ("blink-cursor-check"));
}
This function checks if blink-cursor timers should be turned off. */)
(Lisp_Object event)
{
+ Frun_hooks (1, &Qfocus_out_hook);
return call0 (intern ("blink-cursor-suspend"));
}
The pointer becomes visible again when the mouse is moved. */);
Vmake_pointer_invisible = Qt;
+ DEFVAR_LISP ("focus-in-hook", Vfocus_in_hook,
+ doc: /* Normal hook run when a frame gains input focus. */);
+ Vfocus_in_hook = Qnil;
+ DEFSYM (Qfocus_in_hook, "focus-in-hook");
+
+ DEFVAR_LISP ("focus-out-hook", Vfocus_out_hook,
+ doc: /* Normal hook run when a frame loses input focus. */);
+ Vfocus_out_hook = Qnil;
+ DEFSYM (Qfocus_out_hook, "focus-out-hook");
+
DEFVAR_LISP ("delete-frame-functions", Vdelete_frame_functions,
doc: /* Functions run before deleting a frame.
The functions are run with one arg, the frame to be deleted.