aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2014-04-06 09:08:00 -0400
committerStefan Monnier2014-04-06 09:08:00 -0400
commit0beb7fb72378b007f67e729d34727f99b38faff3 (patch)
treea5d5d6cb03b0fb0495541424db19ddc762e1db6a
parent50ea0f87d6e13642ae3851e3516a5e716a39584b (diff)
downloademacs-0beb7fb72378b007f67e729d34727f99b38faff3.tar.gz
emacs-0beb7fb72378b007f67e729d34727f99b38faff3.zip
* lisp/mpc.el (mpc--status-timer-run): Disable timer if not displayed.
(mpc--status-idle-timer-run): Use mpc--status-timer-run.
-rw-r--r--lisp/ChangeLog12
-rw-r--r--lisp/mpc.el14
2 files changed, 16 insertions, 10 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 2084cbbb7b6..88cff6fe014 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
12014-04-06 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * mpc.el (mpc--status-timer-run): Disable timer if not displayed.
4 (mpc--status-idle-timer-run): Use mpc--status-timer-run.
5
12014-04-05 Glenn Morris <rgm@gnu.org> 62014-04-05 Glenn Morris <rgm@gnu.org>
2 7
3 * help.el (view-lossage): Doc tweak. 8 * help.el (view-lossage): Doc tweak.
@@ -13,15 +18,14 @@
13 face-spec-choose. (Bug#16378) 18 face-spec-choose. (Bug#16378)
14 (make-face-x-resource-internal): Do nothing when 19 (make-face-x-resource-internal): Do nothing when
15 inhibit-x-resources is non-nil. Don't touch the default face if 20 inhibit-x-resources is non-nil. Don't touch the default face if
16 reversed video is given--as was done in previous versions of 21 reversed video is given--as was done in previous versions of Emacs.
17 Emacs.
18 (face-set-after-frame-default): Don't call 22 (face-set-after-frame-default): Don't call
19 make-face-x-resource-internal here. (Bug#16434) 23 make-face-x-resource-internal here. (Bug#16434)
20 24
212014-04-04 Tassilo Horn <tsdh@gnu.org> 252014-04-04 Tassilo Horn <tsdh@gnu.org>
22 26
23 * doc-view.el (doc-view-bookmark-jump): Use 27 * doc-view.el (doc-view-bookmark-jump):
24 `bookmark-after-jump-hook' to jump to the right page after the 28 Use `bookmark-after-jump-hook' to jump to the right page after the
25 buffer is shown in a window. (bug#16090) 29 buffer is shown in a window. (bug#16090)
26 30
272014-04-04 Eli Zaretskii <eliz@gnu.org> 312014-04-04 Eli Zaretskii <eliz@gnu.org>
diff --git a/lisp/mpc.el b/lisp/mpc.el
index 921b5fc8b89..d89231e81b9 100644
--- a/lisp/mpc.el
+++ b/lisp/mpc.el
@@ -491,9 +491,13 @@ to call FUN for any change whatsoever.")
491 (cancel-timer mpc--status-timer) 491 (cancel-timer mpc--status-timer)
492 (setq mpc--status-timer nil))) 492 (setq mpc--status-timer nil)))
493(defun mpc--status-timer-run () 493(defun mpc--status-timer-run ()
494 (with-demoted-errors "MPC: %s" 494 (with-demoted-errors "MPC: %S"
495 (when (process-get (mpc-proc) 'ready) 495 (when (process-get (mpc-proc) 'ready)
496 (with-local-quit (mpc-status-refresh))))) 496 (let* ((buf (mpc-proc-buffer (mpc-proc) 'status))
497 (win (get-buffer-window buf t)))
498 (if (not win)
499 (mpc--status-timer-stop)
500 (with-local-quit (mpc-status-refresh)))))))
497 501
498(defvar mpc--status-idle-timer nil) 502(defvar mpc--status-idle-timer nil)
499(defun mpc--status-idle-timer-start () 503(defun mpc--status-idle-timer-start ()
@@ -518,10 +522,8 @@ to call FUN for any change whatsoever.")
518 ;; client starts playback, we may get a chance to notice it. 522 ;; client starts playback, we may get a chance to notice it.
519 (run-with-idle-timer 10 t 'mpc--status-idle-timer-run)))) 523 (run-with-idle-timer 10 t 'mpc--status-idle-timer-run))))
520(defun mpc--status-idle-timer-run () 524(defun mpc--status-idle-timer-run ()
521 (when (process-get (mpc-proc) 'ready) 525 (mpc--status-timer-start)
522 (with-demoted-errors "MPC: %s" 526 (mpc--status-timer-run))
523 (with-local-quit (mpc-status-refresh))))
524 (mpc--status-timer-start))
525 527
526(defun mpc--status-timers-refresh () 528(defun mpc--status-timers-refresh ()
527 "Start/stop the timers according to whether a song is playing." 529 "Start/stop the timers according to whether a song is playing."