Stop cursor blink after blink-cursor-blinks (10), stop timers when not blinking.
authorJan Djärv <jan.h.d@swipnet.se>
Tue, 16 Jul 2013 11:41:06 +0000 (13:41 +0200)
committerJan Djärv <jan.h.d@swipnet.se>
Tue, 16 Jul 2013 11:41:06 +0000 (13:41 +0200)
commit18c26d81cde21b841a8f5f81b81118e5f8c6b07d
tree72be27efcb214d2a038bf8551f8e88e191ec9f02
parentc7ddc792b747fdf4fde822df0cf9c7b712be4219
Stop cursor blink after blink-cursor-blinks (10), stop timers when not blinking.

* etc/NEWS: Document blink-cursor-blinks and blink timers stopped.

* lisp/frame.el (blink-cursor-blinks): New defcustom.
(blink-cursor-blinks-done): New defvar.
(blink-cursor-start): Set blink-cursor-blinks-done to 1.
(blink-cursor-timer-function): Check if number of blinks has been
done on X and NS.
(blink-cursor-suspend, blink-cursor-check): New defuns.

* src/frame.c (Fhandle_focus_in, Fhandle_focus_out): New functions.
(Fhandle_switch_frame): Call Fhandle_focus_in.
(syms_of_frame): defsubr handle-focus-in/out.

* src/keyboard.c (Qfocus_in, Qfocus_out): New static objects.
(make_lispy_focus_in, make_lispy_focus_out): Declare and define.
(kbd_buffer_get_event): For FOCUS_IN, make a focus_in event if no
switch frame event is made.  Check ! NILP (event->arg) if X11 (moved
from xterm.c). Make focus_out event for FOCUS_OUT_EVENT if NS or X11
and there is a focused frame.
(head_table): Add focus-in and focus-out.
(keys_of_keyboard): Add focus-in and focus-out to Vspecial_event_map,
bind to handle-focus-in/out.

* src/nsterm.m (windowDidResignKey): If this is the focused frame, generate
FOCUS_OUT_EVENT.

* src/termhooks.h (enum event_kind): Add FOCUS_OUT_EVENT.

* src/xterm.c (x_focus_changed): Always generate FOCUS_IN_EVENT.
Set event->arg to Qt if switch-event shall be generated.
Generate FOCUS_OUT_EVENT for FocusOut if this is the focused frame.
etc/ChangeLog
etc/NEWS
lisp/ChangeLog
lisp/frame.el
src/ChangeLog
src/frame.c
src/keyboard.c
src/nsterm.m
src/termhooks.h
src/xterm.c