From 11e874910275c27d77a0293d0c720a92f50e2b0a Mon Sep 17 00:00:00 2001 From: Kyle Meyer Date: Sun, 9 Aug 2015 21:29:14 -0400 Subject: [PATCH] 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. --- lisp/org-clock.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lisp/org-clock.el b/lisp/org-clock.el index 6e344830e..e3c8958d2 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)) -- 2.11.4.GIT