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.
This commit is contained in:
Kyle Meyer 2015-09-22 00:15:32 -04:00
parent fbf4fa8cc7
commit e3c2d211c1
1 changed files with 22 additions and 24 deletions

View File

@ -163,13 +163,12 @@ With prefix arg STOP, stop it entirely."
(let ((start-secs (org-float-time org-timer-start-time)) (let ((start-secs (org-float-time org-timer-start-time))
(pause-secs (org-float-time org-timer-pause-time))) (pause-secs (org-float-time org-timer-pause-time)))
(if org-timer-countdown-timer (if org-timer-countdown-timer
(progn (let ((new-secs (- start-secs pause-secs)))
(let ((new-secs (- start-secs pause-secs))) (setq org-timer-countdown-timer
(setq org-timer-countdown-timer (org-timer--run-countdown-timer
(org-timer--run-countdown-timer new-secs org-timer-countdown-timer-title))
new-secs org-timer-countdown-timer-title)) (setq org-timer-start-time
(setq org-timer-start-time (time-add (current-time) (seconds-to-time new-secs))))
(time-add (current-time) (seconds-to-time new-secs)))))
(setq org-timer-start-time (setq org-timer-start-time
;; Pass `current-time' result to `org-float-time' ;; Pass `current-time' result to `org-float-time'
;; (instead of calling without arguments) so that only ;; (instead of calling without arguments) so that only
@ -450,23 +449,22 @@ using three `C-u' prefix arguments."
(org-timer-show-remaining-time) (org-timer-show-remaining-time)
(let ((secs (org-timer-hms-to-secs (org-timer-fix-incomplete minutes))) (let ((secs (org-timer-hms-to-secs (org-timer-fix-incomplete minutes)))
(hl (org-timer--get-timer-title))) (hl (org-timer--get-timer-title)))
(if (or (not org-timer-countdown-timer) (if (and org-timer-countdown-timer
(equal opt '(16)) (not (or (equal opt '(16))
(y-or-n-p "Replace current timer? ")) (y-or-n-p "Replace current timer? "))))
(progn (message "No timer set")
(when (timerp org-timer-countdown-timer) (when (timerp org-timer-countdown-timer)
(cancel-timer org-timer-countdown-timer)) (cancel-timer org-timer-countdown-timer))
(setq org-timer-countdown-timer-title (setq org-timer-countdown-timer-title
(org-timer--get-timer-title)) (org-timer--get-timer-title))
(setq org-timer-countdown-timer (setq org-timer-countdown-timer
(org-timer--run-countdown-timer (org-timer--run-countdown-timer
secs org-timer-countdown-timer-title)) secs org-timer-countdown-timer-title))
(run-hooks 'org-timer-set-hook) (run-hooks 'org-timer-set-hook)
(setq org-timer-start-time (setq org-timer-start-time
(time-add (current-time) (seconds-to-time secs))) (time-add (current-time) (seconds-to-time secs)))
(setq org-timer-pause-time nil) (setq org-timer-pause-time nil)
(org-timer-set-mode-line 'on)) (org-timer-set-mode-line 'on))))))
(message "No timer set"))))))
(defun org-timer--run-countdown-timer (secs title) (defun org-timer--run-countdown-timer (secs title)
"Start countdown timer that will last SECS. "Start countdown timer that will last SECS.