From: Phillip Lord Date: Sat, 30 Apr 2016 07:43:39 +0000 (+0100) Subject: org-map-entries: Fix org-agenda-prepare-buffers call X-Git-Tag: emacs-25.0.94~125 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=b52ebd4f20ecc3f207a88cf7ac18c745b6e8ef80;p=emacs.git 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. --- diff --git a/lisp/org/org.el b/lisp/org/org.el index 231daa9a6a7..61bcb451d70 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)