[O] org pomodoro

2013-09-28 Thread Devin Homan
I've put up some code on github that I use for tracking time using the Pomodoro 
method. Perhaps
others might find it useful. https://github.com/dwhoman/org-pomodoro



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

2013-09-03 Thread Devin Homan
The current implementation of org-timer-set-timer calls org-notify with
the PLAY-SOUND argument set to 't', which gets passed to
org-clock-play-sound that then in turn calls the beep function. The
value of this argument should be defined in a defvar so as to allow the
user to modify or dynamically set its value. Additionally, a similar
behaviour should be allowed for the message by having the first cond
case, in the cond that sets hl, return the value of a defvar should that
defvar be a string type.

Sincerely,

Devin



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

2013-09-03 Thread Devin Homan
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:
+
+nilNo 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