Browse Source

Fix clock issues related to with-current-buffer

Patch by Bernt Hansen
Carsten Dominik 15 years ago
parent
commit
9f6102f9e7
2 changed files with 8 additions and 2 deletions
  1. 4 0
      lisp/ChangeLog
  2. 4 2
      lisp/org-clock.el

+ 4 - 0
lisp/ChangeLog

@@ -1,5 +1,9 @@
 2009-11-09  Carsten Dominik  <carsten.dominik@gmail.com>
 
+	* org-clock.el (org-clock-out, org-clock-cancel): Revert to
+	instances to switching to with-current-buffer, because these seem
+	to cause problems - no idea why.
+
 	* org-agenda.el (org-agenda-add-entry-to-org-agenda-diary-file):
 	Require diary-lib for (diary-date-display-form).
 

+ 4 - 2
lisp/org-clock.el

@@ -1103,7 +1103,8 @@ If there is no running clock, throw an error, unless FAIL-QUIETLY is set."
     (if (not (marker-buffer org-clock-marker))
 	(if fail-quietly (throw 'exit t) (error "No active clock")))
     (let (ts te s h m remove)
-      (with-current-buffer (marker-buffer org-clock-marker)
+      (save-excursion
+	(set-buffer (marker-buffer org-clock-marker))
 	(save-restriction
 	  (widen)
 	  (goto-char org-clock-marker)
@@ -1168,7 +1169,8 @@ If there is no running clock, throw an error, unless FAIL-QUIETLY is set."
   (interactive)
   (if (not (marker-buffer org-clock-marker))
       (error "No active clock"))
-  (with-current-buffer (marker-buffer org-clock-marker)
+  (save-excursion
+    (set-buffer (marker-buffer org-clock-marker))
     (goto-char org-clock-marker)
     (delete-region (1- (point-at-bol)) (point-at-eol))
     ;; Just in case, remove any empty LOGBOOK left over