summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Dominik <carsten.dominik@gmail.com>2010-04-26 00:02:49 +0200
committerCarsten Dominik <carsten.dominik@gmail.com>2010-04-26 00:02:49 +0200
commit5faad3ce87aa43fcbbed26f33474092e792f6a5e (patch)
treeef083a91ed73add7abd5ef5775da838bcfb85029
parent5fd8d0ea333a451be4e0af4667be58e849c36af1 (diff)
downloadorg-mode-5faad3ce87aa43fcbbed26f33474092e792f6a5e.tar.gz
Make sure clock mode line display is removed when there is not clock
Patch by Sebastian Rose.
-rwxr-xr-xlisp/ChangeLog3
-rwxr-xr-xlisp/org-clock.el14
2 files changed, 13 insertions, 4 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 3d43cc1..9bcbbc6 100755
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,8 @@
2010-04-25 Carsten Dominik <carsten.dominik@gmail.com>
+ * org-clock.el (org-clock-cancel, org-clock-out): Make sure
+ the modeline display is removed.
+
* org-exp.el (org-export-format-drawer-function): Fix
docstring.
diff --git a/lisp/org-clock.el b/lisp/org-clock.el
index c8bf6cc..07c1083 100755
--- a/lisp/org-clock.el
+++ b/lisp/org-clock.el
@@ -1194,8 +1194,11 @@ line and position cursor in that line."
If there is no running clock, throw an error, unless FAIL-QUIETLY is set."
(interactive)
(catch 'exit
- (if (not (org-clocking-p))
- (if fail-quietly (throw 'exit t) (error "No active clock")))
+ (when (not (org-clocking-p))
+ (setq global-mode-string
+ (delq 'org-mode-line-string global-mode-string))
+ (force-mode-line-update)
+ (if fail-quietly (throw 'exit t) (error "No active clock")))
(let (ts te s h m remove)
(save-excursion ; Do not replace this with `with-current-buffer'.
(with-no-warnings (set-buffer (org-clocking-buffer)))
@@ -1263,8 +1266,11 @@ If there is no running clock, throw an error, unless FAIL-QUIETLY is set."
(defun org-clock-cancel ()
"Cancel the running clock be removing the start timestamp."
(interactive)
- (if (not (org-clocking-p))
- (error "No active clock"))
+ (when (not (org-clocking-p))
+ (setq global-mode-string
+ (delq 'org-mode-line-string global-mode-string))
+ (force-mode-line-update)
+ (error "No active clock"))
(save-excursion ; Do not replace this with `with-current-buffer'.
(with-no-warnings (set-buffer (org-clocking-buffer)))
(goto-char org-clock-marker)