aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/ChangeLog16
-rw-r--r--lisp/frame.el45
-rw-r--r--src/ChangeLog5
-rw-r--r--src/frame.c30
4 files changed, 49 insertions, 47 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index f2d2f732222..d8b176fad65 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,11 @@
12013-11-25 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * frame.el (handle-focus-in, handle-focus-out): Move from frame.c.
4 Remove blink-cursor code.
5 (blink-cursor-timer-function, blink-cursor-suspend):
6 Don't special-case GUIs.
7 (blink-cursor-mode): Use focus-in/out-hook.
8
12013-11-25 Dmitry Gutov <dgutov@yandex.ru> 92013-11-25 Dmitry Gutov <dgutov@yandex.ru>
2 10
3 * vc/vc-git.el (vc-git-annotate-extract-revision-at-line): Make it 11 * vc/vc-git.el (vc-git-annotate-extract-revision-at-line): Make it
@@ -86,13 +94,13 @@
86 94
872013-11-21 Leo Liu <sdl.web@gmail.com> 952013-11-21 Leo Liu <sdl.web@gmail.com>
88 96
89 * progmodes/octave.el (octave-mode, inferior-octave-mode): Fix 97 * progmodes/octave.el (octave-mode, inferior-octave-mode):
90 obsolete variable comment-use-global-state. 98 Fix obsolete variable comment-use-global-state.
91 99
922013-11-21 RĂ¼diger Sonderfeld <ruediger@c-plusplus.de> 1002013-11-21 RĂ¼diger Sonderfeld <ruediger@c-plusplus.de>
93 101
94 * progmodes/octave.el (octave-mode-map, octave-mode-menu): Add 102 * progmodes/octave.el (octave-mode-map, octave-mode-menu):
95 `octave-source-file'. 103 Add `octave-source-file'.
96 (octave-source-file): New function. (Bug#15935) 104 (octave-source-file): New function. (Bug#15935)
97 105
982013-11-21 Kenjiro Nakayama <nakayamakenjiro@gmail.com> (tiny change) 1062013-11-21 Kenjiro Nakayama <nakayamakenjiro@gmail.com> (tiny change)
diff --git a/lisp/frame.el b/lisp/frame.el
index 87756f78f1c..57f9395b935 100644
--- a/lisp/frame.el
+++ b/lisp/frame.el
@@ -120,6 +120,21 @@ appended when the minibuffer frame is created."
120 (delete-frame frame t) 120 (delete-frame frame t)
121 ;; Gildea@x.org says it is ok to ask questions before terminating. 121 ;; Gildea@x.org says it is ok to ask questions before terminating.
122 (save-buffers-kill-emacs)))) 122 (save-buffers-kill-emacs))))
123
124(defun handle-focus-in (_event)
125 "Handle a focus-in event.
126Focus-in events are usually bound to this function.
127Focus-in events occur when a frame has focus, but a switch-frame event
128is not generated.
129This function runs the hook `focus-in-hook'."
130 (run-hooks 'focus-in-hook))
131
132(defun handle-focus-out (_event)
133 "Handle a focus-out event.
134Focus-out events are usually bound to this function.
135Focus-out events occur when no frame has focus.
136This function runs the hook `focus-out-hook'."
137 (run-hooks 'focus-out-hook))
123 138
124;;;; Arrangement of frames at startup 139;;;; Arrangement of frames at startup
125 140
@@ -1727,12 +1742,11 @@ command starts, by installing a pre-command hook."
1727 "Timer function of timer `blink-cursor-timer'." 1742 "Timer function of timer `blink-cursor-timer'."
1728 (internal-show-cursor nil (not (internal-show-cursor-p))) 1743 (internal-show-cursor nil (not (internal-show-cursor-p)))
1729 ;; Each blink is two calls to this function. 1744 ;; Each blink is two calls to this function.
1730 (when (memq window-system '(x ns w32)) 1745 (setq blink-cursor-blinks-done (1+ blink-cursor-blinks-done))
1731 (setq blink-cursor-blinks-done (1+ blink-cursor-blinks-done)) 1746 (when (and (> blink-cursor-blinks 0)
1732 (when (and (> blink-cursor-blinks 0) 1747 (<= (* 2 blink-cursor-blinks) blink-cursor-blinks-done))
1733 (<= (* 2 blink-cursor-blinks) blink-cursor-blinks-done)) 1748 (blink-cursor-suspend)
1734 (blink-cursor-suspend) 1749 (add-hook 'post-command-hook 'blink-cursor-check)))
1735 (add-hook 'post-command-hook 'blink-cursor-check))))
1736 1750
1737 1751
1738(defun blink-cursor-end () 1752(defun blink-cursor-end ()
@@ -1747,15 +1761,14 @@ itself as a pre-command hook."
1747 (setq blink-cursor-timer nil))) 1761 (setq blink-cursor-timer nil)))
1748 1762
1749(defun blink-cursor-suspend () 1763(defun blink-cursor-suspend ()
1750 "Suspend cursor blinking on NS, X and W32. 1764 "Suspend cursor blinking.
1751This is called when no frame has focus and timers can be suspended. 1765This is called when no frame has focus and timers can be suspended.
1752Timers are restarted by `blink-cursor-check', which is called when a 1766Timers are restarted by `blink-cursor-check', which is called when a
1753frame receives focus." 1767frame receives focus."
1754 (when (memq window-system '(x ns w32)) 1768 (blink-cursor-end)
1755 (blink-cursor-end) 1769 (when blink-cursor-idle-timer
1756 (when blink-cursor-idle-timer 1770 (cancel-timer blink-cursor-idle-timer)
1757 (cancel-timer blink-cursor-idle-timer) 1771 (setq blink-cursor-idle-timer nil)))
1758 (setq blink-cursor-idle-timer nil))))
1759 1772
1760(defun blink-cursor-check () 1773(defun blink-cursor-check ()
1761 "Check if cursor blinking shall be restarted. 1774 "Check if cursor blinking shall be restarted.
@@ -1789,13 +1802,15 @@ terminals, cursor blinking is controlled by the terminal."
1789 (if blink-cursor-idle-timer (cancel-timer blink-cursor-idle-timer)) 1802 (if blink-cursor-idle-timer (cancel-timer blink-cursor-idle-timer))
1790 (setq blink-cursor-idle-timer nil) 1803 (setq blink-cursor-idle-timer nil)
1791 (blink-cursor-end) 1804 (blink-cursor-end)
1805 (remove-hook 'focus-in-hook #'blink-cursor-check)
1806 (remove-hook 'focus-out-hook #'blink-cursor-suspend)
1792 (when blink-cursor-mode 1807 (when blink-cursor-mode
1793 ;; Hide the cursor. 1808 (add-hook 'focus-in-hook #'blink-cursor-check)
1794 ;;(internal-show-cursor nil nil) 1809 (add-hook 'focus-out-hook #'blink-cursor-suspend)
1795 (setq blink-cursor-idle-timer 1810 (setq blink-cursor-idle-timer
1796 (run-with-idle-timer blink-cursor-delay 1811 (run-with-idle-timer blink-cursor-delay
1797 blink-cursor-delay 1812 blink-cursor-delay
1798 'blink-cursor-start)))) 1813 #'blink-cursor-start))))
1799 1814
1800 1815
1801;; Frame maximization/fullscreen 1816;; Frame maximization/fullscreen
diff --git a/src/ChangeLog b/src/ChangeLog
index 7f417ccca8a..9947ba4b070 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,8 @@
12013-11-25 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * frame.c (Fhandle_focus_in, Fhandle_focus_out): Move to frame.el.
4 (syms_of_frame): Don't defsubr them.
5
12013-11-25 Glenn Morris <rgm@gnu.org> 62013-11-25 Glenn Morris <rgm@gnu.org>
2 7
3 * lread.c (load_path_default): Change the sense of the argument. 8 * lread.c (load_path_default): Change the sense of the argument.
diff --git a/src/frame.c b/src/frame.c
index fbfc7722681..84293e27d0d 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -887,31 +887,6 @@ This function returns FRAME, or nil if FRAME has been deleted. */)
887 return do_switch_frame (frame, 1, 0, norecord); 887 return do_switch_frame (frame, 1, 0, norecord);
888} 888}
889 889
890DEFUN ("handle-focus-in", Fhandle_focus_in, Shandle_focus_in, 1, 1, "e",
891 doc: /* Handle a focus-in event.
892Focus in events are usually bound to this function.
893Focus in events occur when a frame has focus, but a switch-frame event
894is not generated.
895This function runs the hook `focus-in-hook'.
896It also checks if blink-cursor timers should be turned on again. */)
897 (Lisp_Object event)
898{
899 Frun_hooks (1, &Qfocus_in_hook);
900 return call0 (intern ("blink-cursor-check"));
901}
902
903DEFUN ("handle-focus-out", Fhandle_focus_out, Shandle_focus_out, 1, 1, "e",
904 doc: /* Handle a focus-out event.
905Focus out events are usually bound to this function.
906Focus out events occur when no frame has focus.
907This function runs the hook `focus-out-hook'.
908It also checks if blink-cursor timers should be turned off. */)
909 (Lisp_Object event)
910{
911 Frun_hooks (1, &Qfocus_out_hook);
912 return call0 (intern ("blink-cursor-suspend"));
913}
914
915DEFUN ("handle-switch-frame", Fhandle_switch_frame, Shandle_switch_frame, 1, 1, "e", 890DEFUN ("handle-switch-frame", Fhandle_switch_frame, Shandle_switch_frame, 1, 1, "e",
916 doc: /* Handle a switch-frame event EVENT. 891 doc: /* Handle a switch-frame event EVENT.
917Switch-frame events are usually bound to this function. 892Switch-frame events are usually bound to this function.
@@ -926,7 +901,8 @@ to that frame. */)
926 /* Preserve prefix arg that the command loop just cleared. */ 901 /* Preserve prefix arg that the command loop just cleared. */
927 kset_prefix_arg (current_kboard, Vcurrent_prefix_arg); 902 kset_prefix_arg (current_kboard, Vcurrent_prefix_arg);
928 Frun_hooks (1, &Qmouse_leave_buffer_hook); 903 Frun_hooks (1, &Qmouse_leave_buffer_hook);
929 Fhandle_focus_in (event); // switch-frame implies a focus in. 904 /* `switch-frame' implies a focus in. */
905 call1 (intern ("handle-focus-in"), event);
930 return do_switch_frame (event, 0, 0, Qnil); 906 return do_switch_frame (event, 0, 0, Qnil);
931} 907}
932 908
@@ -4542,8 +4518,6 @@ automatically. See also `mouse-autoselect-window'. */);
4542 defsubr (&Swindow_system); 4518 defsubr (&Swindow_system);
4543 defsubr (&Smake_terminal_frame); 4519 defsubr (&Smake_terminal_frame);
4544 defsubr (&Shandle_switch_frame); 4520 defsubr (&Shandle_switch_frame);
4545 defsubr (&Shandle_focus_in);
4546 defsubr (&Shandle_focus_out);
4547 defsubr (&Sselect_frame); 4521 defsubr (&Sselect_frame);
4548 defsubr (&Sselected_frame); 4522 defsubr (&Sselected_frame);
4549 defsubr (&Sframe_list); 4523 defsubr (&Sframe_list);