summaryrefslogtreecommitdiff
path: root/lisp/org/org.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/org/org.el')
-rw-r--r--lisp/org/org.el4
1 files changed, 2 insertions, 2 deletions
diff --git a/lisp/org/org.el b/lisp/org/org.el
index b0e1e2047d..1921a59bbd 100644
--- a/lisp/org/org.el
+++ b/lisp/org/org.el
@@ -15069,7 +15069,7 @@ a *different* entry, you cannot use these techniques."
(if (not scope)
(progn
(org-agenda-prepare-buffers
- (list (buffer-file-name (current-buffer))))
+ (and buffer-file-name (list buffer-file-name)))
(setq res (org-scan-tags func matcher todo-only start-level)))
;; Get the right scope
(cond
@@ -15081,7 +15081,7 @@ a *different* entry, you cannot use these techniques."
(setq scope (org-agenda-files t))
(setq scope (org-add-archive-files scope)))
((eq scope 'file)
- (setq scope (list (buffer-file-name))))
+ (setq scope (and buffer-file-name (list buffer-file-name))))
((eq scope 'file-with-archives)
(setq scope (org-add-archive-files (list (buffer-file-name))))))
(org-agenda-prepare-buffers scope)