Przeglądaj źródła

org-timer: Fix "No running timer" error

* lisp/org-timer.el (org-timer-stop): Do not look after
  `org-timer-current-timer', which is a variable related to countdown
  timer, whereas the function is related to relative timer.

Reported-by: Randy Smith <perlstalker@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/93081>
Nicolas Goaziou 10 lat temu
rodzic
commit
bbacea55f5
1 zmienionych plików z 6 dodań i 8 usunięć
  1. 6 8
      lisp/org-timer.el

+ 6 - 8
lisp/org-timer.el

@@ -160,14 +160,12 @@ With prefix arg STOP, stop it entirely."
 (defun org-timer-stop ()
   "Stop the relative timer."
   (interactive)
-  (if (not org-timer-current-timer)
-      (message "No running timer")
-    (run-hooks 'org-timer-stop-hook)
-    (setq org-timer-start-time nil
-	  org-timer-pause-time nil
-	  org-timer-current-timer nil)
-    (org-timer-set-mode-line 'off)
-    (message "Timer stopped")))
+  (run-hooks 'org-timer-stop-hook)
+  (setq org-timer-start-time nil
+	org-timer-pause-time nil
+	org-timer-current-timer nil)
+  (org-timer-set-mode-line 'off)
+  (message "Timer stopped"))
 
 ;;;###autoload
 (defun org-timer (&optional restart no-insert-p)