Skip to content

Commit 88c85d6

Browse files
committed
org-map-entries: Do not demand file buffer when SCOPE is nil
* lisp/org.el (org-map-entries): Avoid calling `org-agenda-prepare-buffers' for non-file buffers. `org-agenda-prepare-buffers' expects a file buffer and gives unexpected dialogue otherwise. Since `org-agenda-prepare-buffer' only contains optional cache calculations and things only useful for agenda generation, not calling it should be reasonably safe. Reported-by: Rodrigo Morales <moralesrodrigo1100@gmail.com> Link: https://orgmode.org/list/871r54m6xm.fsf@gmail.com
1 parent dd22123 commit 88c85d6

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lisp/org.el

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12187,8 +12187,11 @@ a *different* entry, you cannot use these techniques."
1218712187

1218812188
(if (not scope)
1218912189
(progn
12190-
(org-agenda-prepare-buffers
12191-
(and buffer-file-name (list buffer-file-name)))
12190+
;; Agenda expects a file buffer. Skip over refreshing
12191+
;; agenda cache for non-file buffers.
12192+
(when buffer-file-name
12193+
(org-agenda-prepare-buffers
12194+
(and buffer-file-name (list buffer-file-name))))
1219212195
(setq res
1219312196
(org-scan-tags
1219412197
func matcher org--matcher-tags-todo-only start-level)))

0 commit comments

Comments
 (0)