Function: org-timer-pause-or-continue

org-timer-pause-or-continue is an autoloaded, interactive and byte-compiled function defined in org-timer.el.gz.

Signature

(org-timer-pause-or-continue &optional STOP)

Documentation

Pause or continue the relative or countdown timer.

With prefix arg STOP, stop it entirely.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/org/org-timer.el.gz
;;;###autoload
(defun org-timer-pause-or-continue (&optional stop)
  "Pause or continue the relative or countdown timer.
With prefix arg STOP, stop it entirely."
  (interactive "P")
  (cond
   (stop (org-timer-stop))
   ((not org-timer-start-time) (error "No timer is running"))
   (org-timer-pause-time
    (let ((start-secs (float-time org-timer-start-time))
	  (pause-secs (float-time org-timer-pause-time)))
      (if org-timer-countdown-timer
	  (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 nil new-secs)))
	(setq org-timer-start-time
	      (time-since (- pause-secs start-secs))))
      (setq org-timer-pause-time nil)
      (org-timer-set-mode-line 'on)
      (run-hooks 'org-timer-continue-hook)
      (message "Timer continues at %s" (org-timer-value-string))))
   (t
    ;; pause timer
    (when org-timer-countdown-timer
      (cancel-timer org-timer-countdown-timer)
      (setq org-timer-countdown-timer 'paused))
    (run-hooks 'org-timer-pause-hook)
    (setq org-timer-pause-time (current-time))
    (org-timer-set-mode-line 'paused)
    (message "Timer paused at %s" (org-timer-value-string)))))