emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] org-timer-set-timer org-notify message and sound arguments


From: Devin Homan
Subject: Re: [O] org-timer-set-timer org-notify message and sound arguments
Date: Tue, 03 Sep 2013 17:51:54 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:23.0) Gecko/20100101 Firefox/23.0 SeaMonkey/2.20

Here is a `git diff -p org-timer.el' of the changes that I am proposing.

diff --git a/lisp/org-timer.el b/lisp/org-timer.el
index 2351c4c..cb0ce45 100644
--- a/lisp/org-timer.el
+++ b/lisp/org-timer.el
@@ -93,6 +93,25 @@ nil          current timer is not displayed"
 (defvar org-timer-cancel-hook nil
   "Hook run before countdown timer is canceled.")

+(defvar org-timer-message nil
+  "Message displayed after countdown timer reaches zero. If
+  org-timer-message is not a string, then the default message
+  will be displayed.")
+
+(defcustom org-timer-clock-sound t
+  "Sound to play after the countdown timer reaches zero.
+Possible values are:
+
+nil        No sound played
+t          Standard Emacs beep
+file name  Play this sound file, fall back to beep"
+  :group 'org-time
+  ;; type is equivalent to `org-clock-sound'
+  :type '(choice
+         (const :tag "No sound" nil)
+         (const :tag "Standard beep" t)
+         (file  :tag "Play sound file")))
+
 ;;;###autoload
 (defun org-timer-start (&optional offset)
   "Set the starting time for the relative timer to now.
@@ -400,6 +419,7 @@ replace any running timer."
       (let* ((mins (string-to-number (match-string 0 minutes)))
             (secs (* mins 60))
             (hl (cond
+                 ((stringp org-timer-message) org-timer-message)
                  ((string-match "Org Agenda" (buffer-name))
                   (let* ((marker (or (get-text-property (point) 'org-marker)
                                      (org-agenda-error)))
@@ -429,7 +449,7 @@ replace any running timer."
                    (run-with-timer
                     secs nil `(lambda ()
                                 (setq org-timer-current-timer nil)
-                                (org-notify ,(format "%s: time out" hl) t)
+                                (org-notify ,(format "%s: time out" hl) 
,org-timer-clock-sound)
                                 (setq org-timer-timer-is-countdown nil)
                                 (org-timer-set-mode-line 'off)
                                 (run-hooks 'org-timer-done-hook))))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]