summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyle Meyer <kyle@kyleam.com>2015-09-22 00:15:32 -0400
committerKyle Meyer <kyle@kyleam.com>2015-09-22 00:20:57 -0400
commite3c2d211c1c3adbc33028587c6993189a642cf6b (patch)
tree5a072334192120b2d44048ea5419fcde79dfa6f7
parentfbf4fa8cc786cf6c24ea4fcc9e38895cff46acbb (diff)
downloadorg-mode-e3c2d211c1c3adbc33028587c6993189a642cf6b.tar.gz
org-timer: Remove two progn's
* lisp/org-timer.el (org-timer-pause-or-continue): Remove unnecessary progn. (org-timer-set-timer): Reverse condition to remove progn.
-rw-r--r--lisp/org-timer.el46
1 files changed, 22 insertions, 24 deletions
diff --git a/lisp/org-timer.el b/lisp/org-timer.el
index dbab355..0a47737 100644
--- a/lisp/org-timer.el
+++ b/lisp/org-timer.el
@@ -163,13 +163,12 @@ With prefix arg STOP, stop it entirely."
(let ((start-secs (org-float-time org-timer-start-time))
(pause-secs (org-float-time org-timer-pause-time)))
(if org-timer-countdown-timer
- (progn
- (let ((new-secs (- start-secs pause-secs)))
- (setq org-timer-countdown-timer
- (org-timer--run-countdown-timer
- new-secs org-timer-countdown-timer-title))
- (setq org-timer-start-time
- (time-add (current-time) (seconds-to-time new-secs)))))
+ (let ((new-secs (- start-secs pause-secs)))
+ (setq org-timer-countdown-timer
+ (org-timer--run-countdown-timer
+ new-secs org-timer-countdown-timer-title))
+ (setq org-timer-start-time
+ (time-add (current-time) (seconds-to-time new-secs))))
(setq org-timer-start-time
;; Pass `current-time' result to `org-float-time'
;; (instead of calling without arguments) so that only
@@ -450,23 +449,22 @@ using three `C-u' prefix arguments."
(org-timer-show-remaining-time)
(let ((secs (org-timer-hms-to-secs (org-timer-fix-incomplete minutes)))
(hl (org-timer--get-timer-title)))
- (if (or (not org-timer-countdown-timer)
- (equal opt '(16))
- (y-or-n-p "Replace current timer? "))
- (progn
- (when (timerp org-timer-countdown-timer)
- (cancel-timer org-timer-countdown-timer))
- (setq org-timer-countdown-timer-title
- (org-timer--get-timer-title))
- (setq org-timer-countdown-timer
- (org-timer--run-countdown-timer
- secs org-timer-countdown-timer-title))
- (run-hooks 'org-timer-set-hook)
- (setq org-timer-start-time
- (time-add (current-time) (seconds-to-time secs)))
- (setq org-timer-pause-time nil)
- (org-timer-set-mode-line 'on))
- (message "No timer set"))))))
+ (if (and org-timer-countdown-timer
+ (not (or (equal opt '(16))
+ (y-or-n-p "Replace current timer? "))))
+ (message "No timer set")
+ (when (timerp org-timer-countdown-timer)
+ (cancel-timer org-timer-countdown-timer))
+ (setq org-timer-countdown-timer-title
+ (org-timer--get-timer-title))
+ (setq org-timer-countdown-timer
+ (org-timer--run-countdown-timer
+ secs org-timer-countdown-timer-title))
+ (run-hooks 'org-timer-set-hook)
+ (setq org-timer-start-time
+ (time-add (current-time) (seconds-to-time secs)))
+ (setq org-timer-pause-time nil)
+ (org-timer-set-mode-line 'on))))))
(defun org-timer--run-countdown-timer (secs title)
"Start countdown timer that will last SECS.