Browse Source

`org-timer-set-timer': fix bug about cancelling timer.

Bastien Guerry 10 years ago
parent
commit
3685d6b496
2 changed files with 7 additions and 1 deletions
  1. 5 0
      lisp/ChangeLog
  2. 2 1
      lisp/org-timer.el

+ 5 - 0
lisp/ChangeLog

@@ -1,3 +1,8 @@
+2010-05-24  Bastien Guerry  <bzg@altern.org>
+
+	* org-timer.el (org-timer-set-timer): Fix bug about cancelling
+	timers.
+
 2010-05-21  Carsten Dominik  <carsten.dominik@gmail.com>
 
 	* org.el (org-emph-re): Document the match groups.

+ 2 - 1
lisp/org-timer.el

@@ -338,7 +338,8 @@ VALUE can be `on', `off', or `pause'."
 		     (y-or-n-p "Replace current timer? "))
 		(not org-timer-current-timer))
 	  (progn
-	    (cancel-timer org-timer-current-timer)
+	    (when org-timer-current-timer
+	      (cancel-timer org-timer-current-timer))
 	    (setq org-timer-current-timer
 		  (run-with-timer
 		   secs nil `(lambda ()