aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog16
-rw-r--r--lisp/frame.el45
2 files changed, 42 insertions, 19 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