From 6223f20a641cb487c36aaaafb0d9631c39959109 Mon Sep 17 00:00:00 2001 From: Ihor Radchenko Date: Tue, 26 Mar 2024 14:36:53 +0300 Subject: [PATCH] org-map-entries: Fix when buffer is not a file buffer and SCOPE is nil * lisp/org.el (org-map-entries): Avoid triggering check for existence of file on FS when SCOPE is nil. Link: https://old.reddit.com/r/emacs/comments/1bnhz24/bug_nonexistent_agenda_file_s/ --- lisp/org.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/org.el b/lisp/org.el index a6d196ea5..d3ee1e6f4 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -12307,7 +12307,7 @@ a *different* entry, you cannot use these techniques." ;; agenda cache for non-file buffers. (when buffer-file-name (org-agenda-prepare-buffers - (and buffer-file-name (list buffer-file-name)))) + (and buffer-file-name (list (current-buffer))))) (setq res (org-scan-tags func matcher org--matcher-tags-todo-only start-level)))