Use org-notify to show a notification and possibly play a sound.
This commit is contained in:
parent
486e807b1b
commit
754694dd4b
|
@ -1,5 +1,11 @@
|
|||
2009-08-23 Bastien Guerry <bzg@altern.org>
|
||||
|
||||
* org-timer.el (org-timer-set-timer): Use `org-notify' and play a
|
||||
sound when showing the notification.
|
||||
|
||||
* org-clock.el (org-notify): New function.
|
||||
(org-clock-notify-once-if-expired): Use `org-notify'.
|
||||
|
||||
* org-gnus.el (org-gnus-store-link): Handle `gnus-summary-mode'
|
||||
and `gnus-article-mode' separately.
|
||||
(gnus-summary-article-header): Fix the declare-function.
|
||||
|
|
|
@ -439,12 +439,16 @@ Notification is shown only once."
|
|||
(if (>= clocked-time effort-in-minutes)
|
||||
(unless org-clock-notification-was-shown
|
||||
(setq org-clock-notification-was-shown t)
|
||||
(org-clock-play-sound)
|
||||
(org-show-notification
|
||||
(org-notify
|
||||
(format "Task '%s' should be finished by now. (%s)"
|
||||
org-clock-heading org-clock-effort)))
|
||||
org-clock-heading org-clock-effort) t))
|
||||
(setq org-clock-notification-was-shown nil)))))
|
||||
|
||||
(defun org-notify (notification &optional play-sound)
|
||||
"Send a NOTIFICATION and maybe PLAY-SOUND."
|
||||
(org-show-notification (notification))
|
||||
(if play-sound (org-clock-play-sound)))
|
||||
|
||||
(defun org-show-notification (notification)
|
||||
"Show notification.
|
||||
Use `org-show-notification-handler' if defined,
|
||||
|
|
|
@ -317,8 +317,8 @@ VALUE can be `on', `off', or `pause'."
|
|||
(if (not (or (eval timer) timer-set))
|
||||
(setq timer-set t
|
||||
timer
|
||||
(run-with-timer secs nil 'org-show-notification
|
||||
(format "%s: time out" hl))
|
||||
(run-with-timer
|
||||
secs nil 'org-notify (format "%s: time out" hl) t)
|
||||
org-timer-last-timer timer)))
|
||||
'(org-timer-timer1
|
||||
org-timer-timer2
|
||||
|
|
Loading…
Reference in New Issue