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/
This commit is contained in:
Ihor Radchenko 2024-03-26 14:36:53 +03:00
parent d7f7b63a77
commit 6223f20a64
No known key found for this signature in database
GPG Key ID: 6470762A7DA11D8B
1 changed files with 1 additions and 1 deletions

View File

@ -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)))