diff options
author | Phillip Lord <phillip.lord@newcastle.ac.uk> | 2016-04-30 08:43:39 +0100 |
---|---|---|
committer | Phillip Lord <phillip.lord@newcastle.ac.uk> | 2016-04-30 14:46:44 +0100 |
commit | b52ebd4f20ecc3f207a88cf7ac18c745b6e8ef80 (patch) | |
tree | 3d08e69af7af68d17b1fc1dec0c9374c22898934 | |
parent | 86aa4094d7f8bb68863759cf109a046f4bad450d (diff) |
org-map-entries: Fix org-agenda-prepare-buffers call
* lisp/org.el (org-map-entries): Check that buffer-file-name is non-nil
before passing to org-agenda-prepare-buffers.
This is a backport of commit 44c8cd7136e3fcd1e6bfa08895cac437b7a691fa
from upstream org-mode. Addresses bug #23365.
-rw-r--r-- | lisp/org/org.el | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lisp/org/org.el b/lisp/org/org.el index 231daa9a6a..61bcb451d7 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) |