[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] trunk r115143: Add hooks to run on gaining/losing focus (t
From: |
Glenn Morris |
Subject: |
[Emacs-diffs] trunk r115143: Add hooks to run on gaining/losing focus (tiny change) |
Date: |
Tue, 19 Nov 2013 02:23:53 +0000 |
User-agent: |
Bazaar (2.6b2) |
------------------------------------------------------------
revno: 115143
revision-id: address@hidden
parent: address@hidden
fixes bug: http://debbugs.gnu.org/15029
author: Brian Jenkins <address@hidden>
committer: Glenn Morris <address@hidden>
branch nick: trunk
timestamp: Mon 2013-11-18 21:23:50 -0500
message:
Add hooks to run on gaining/losing focus (tiny change)
* src/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.
modified:
src/ChangeLog changelog-20091113204419-o5vbwnq5f7feedwu-1438
src/frame.c frame.c-20091113204419-o5vbwnq5f7feedwu-243
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog 2013-11-18 19:31:05 +0000
+++ b/src/ChangeLog 2013-11-19 02:23:50 +0000
@@ -1,3 +1,10 @@
+2013-11-19 Brian Jenkins <address@hidden> (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 <address@hidden>
* data.c (bool_vector_binop_driver): Rename locals for sanity's sake.
=== modified file 'src/frame.c'
--- a/src/frame.c 2013-11-06 18:41:31 +0000
+++ b/src/frame.c 2013-11-19 02:23:50 +0000
@@ -109,6 +109,8 @@
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;
@@ -893,6 +895,7 @@
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"));
}
@@ -903,6 +906,7 @@
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"));
}
@@ -4465,6 +4469,16 @@
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.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] trunk r115143: Add hooks to run on gaining/losing focus (tiny change),
Glenn Morris <=