Browse Source

Fix bug in canceling clocks

Peter Frings writes:

> Clocking in on any task (C-c C-x C-i) and cancelling afterwards (C-c C-x
> C-x) results in the following backtrace:
> ,----
> | Debugger entered--Lisp error: (wrong-type-argument markerp org-clock-marker)
> |   move-marker(org-clock-marker nil)
> |   org-clock-cancel()
> |   call-interactively(org-clock-cancel nil nil)
> `----
> Culprit are two erroneous quotes in front of org-clock-marker in org-clock-el. The patch (output
> of git diff -u on a clean checkout) fixes the problem:
>
> diff --git a/lisp/org-clock.el b/lisp/org-clock.el
> index e279898..91a4bcb 100644
> --- a/lisp/org-clock.el
> +++ b/lisp/org-clock.el
> @@ -818,8 +818,8 @@ If there is no running clock, throw an error, unless FAIL-QUIETLY is set."
>     (set-buffer (marker-buffer org-clock-marker))
>     (goto-char org-clock-marker)
>     (delete-region (1- (point-at-bol)) (point-at-eol)))
> -  (move-marker 'org-clock-marker nil)
> -  (move-marker 'org-clock-hd-marker nil)
> +  (move-marker org-clock-marker nil)
> +  (move-marker org-clock-hd-marker nil)
>   (setq global-mode-string
> 	(delq 'org-mode-line-string global-mode-string))
>   (force-mode-line-update)
Carsten Dominik 11 years ago
parent
commit
4020e2a8c4
2 changed files with 5 additions and 2 deletions
  1. 3 0
      lisp/ChangeLog
  2. 2 2
      lisp/org-clock.el

+ 3 - 0
lisp/ChangeLog

@@ -1,5 +1,8 @@
 2009-10-01  Carsten Dominik  <carsten.dominik@gmail.com>
 
+	* org-clock.el (org-clock-cancel): Remove quotes from marker
+	variables.
+
 	* org.el (org-read-date-prefer-future): New allowed value `time'.
 	(org-read-date-analyze): Shift day to tomorrow depending on time
 	entered and value of `org-read-date-prefer-future'.

+ 2 - 2
lisp/org-clock.el

@@ -818,8 +818,8 @@ If there is no running clock, throw an error, unless FAIL-QUIETLY is set."
     (set-buffer (marker-buffer org-clock-marker))
     (goto-char org-clock-marker)
     (delete-region (1- (point-at-bol)) (point-at-eol)))
-  (move-marker 'org-clock-marker nil)
-  (move-marker 'org-clock-hd-marker nil)
+  (move-marker org-clock-marker nil)
+  (move-marker org-clock-hd-marker nil)
   (setq global-mode-string
 	(delq 'org-mode-line-string global-mode-string))
   (force-mode-line-update)