summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Dominik <carsten.dominik@gmail.com>2009-11-09 22:58:34 +0100
committerCarsten Dominik <carsten.dominik@gmail.com>2009-11-09 22:58:34 +0100
commit9f6102f9e756e4f0d097eb2ee144ffe06c95ab87 (patch)
tree6c2f71b3b4932e59f406a95d22a7ce42ec4841ba
parent1d6570928aa41817fb9b3e463356904a50e2ee90 (diff)
downloadorg-mode-9f6102f9e756e4f0d097eb2ee144ffe06c95ab87.tar.gz
Fix clock issues related to with-current-buffer
Patch by Bernt Hansen
-rwxr-xr-xlisp/ChangeLog4
-rw-r--r--lisp/org-clock.el6
2 files changed, 8 insertions, 2 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 87ae306..0a87a4d 100755
--- a/lisp/ChangeLog
+++ b/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).
diff --git a/lisp/org-clock.el b/lisp/org-clock.el
index fc1e977..29cdf83 100644
--- a/lisp/org-clock.el
+++ b/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