summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyle Meyer <kyle@kyleam.com>2015-08-09 21:29:14 -0400
committerKyle Meyer <kyle@kyleam.com>2015-08-09 21:39:18 -0400
commit11e874910275c27d77a0293d0c720a92f50e2b0a (patch)
tree9522c11b4a78d097165ed731d335a5cd32b0d919
parent04aea5ea6fffb6442fa22677176ebd43c37e10a1 (diff)
downloadorg-mode-11e874910275c27d77a0293d0c720a92f50e2b0a.tar.gz
org-clock: Fix org-agenda-prepare-buffers call
* lisp/org-clock.el (org-dblock-write:clocktable): Pass buffer to org-agenda-prepare-buffers when buffer is not visiting file. This surfaced as an error when 05efa7a ("Backport commit 3a5f751 from Emacs master branch", 2015-08-08) replaced a '(while (setq VAR (pop LIST)) BODY)' with '(dolist (VAR LIST) BODY)', resulting in the body being executed when '(nil)' was passed to org-agenda-prepare-buffers.
-rw-r--r--lisp/org-clock.el3
1 files changed, 2 insertions, 1 deletions
diff --git a/lisp/org-clock.el b/lisp/org-clock.el
index 6e34483..e3c8958 100644
--- a/lisp/org-clock.el
+++ b/lisp/org-clock.el
@@ -2419,7 +2419,8 @@ the currently selected interval size."
;; Just from the current file
(save-restriction
;; get the right range into the restriction
- (org-agenda-prepare-buffers (list (buffer-file-name)))
+ (org-agenda-prepare-buffers (list (or (buffer-file-name)
+ (current-buffer))))
(cond
((not scope)) ; use the restriction as it is now
((eq scope 'file) (widen))