Explorar o código

Make `org-timer-cancel-timer' turn off the modeline countdown.

Also bind `org-timer-cancel-timer' to `C-c C-x :' in org-mode.
We may want to bind this command in org-agenda-mode as well but
I don't have any good idea of a keybinding now.
Bastien Guerry %!s(int64=14) %!d(string=hai) anos
pai
achega
8f173ce843
Modificáronse 2 ficheiros con 4 adicións e 1 borrados
  1. 3 1
      lisp/org-timer.el
  2. 1 0
      lisp/org.el

+ 3 - 1
lisp/org-timer.el

@@ -303,7 +303,9 @@ VALUE can be `on', `off', or `pause'."
   (when (eval org-timer-current-timer)
     (run-hooks 'org-timer-cancel-hook)
     (cancel-timer org-timer-current-timer)
-    (setq org-timer-current-timer nil))
+    (setq org-timer-current-timer nil)
+    (setq org-timer-timer-is-countdown nil)
+    (org-timer-set-mode-line 'off))
   (message "Last timer canceled"))
 
 (defun org-timer-show-remaining-time ()

+ 1 - 0
lisp/org.el

@@ -16380,6 +16380,7 @@ BEG and END default to the buffer boundaries."
 (org-defkey org-mode-map "\C-c\C-xo"    'org-toggle-ordered-property)
 (org-defkey org-mode-map "\C-c\C-xi"    'org-insert-columns-dblock)
 (org-defkey org-mode-map [(control ?c) (control ?x) ?\;] 'org-timer-set-timer)
+(org-defkey org-mode-map [(control ?c) (control ?x) ?\:] 'org-timer-cancel-timer)
 
 (org-defkey org-mode-map "\C-c\C-x."    'org-timer)
 (org-defkey org-mode-map "\C-c\C-x-"    'org-timer-item)