소스 검색

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
Ihor Radchenko 2 년 전
부모
커밋
88c85d620b
1개의 변경된 파일5개의 추가작업 그리고 2개의 파일을 삭제
  1. 5 2
      lisp/org.el

+ 5 - 2
lisp/org.el

@@ -12187,8 +12187,11 @@ a *different* entry, you cannot use these techniques."
 
 	  (if (not scope)
 	      (progn
-		(org-agenda-prepare-buffers
-		 (and buffer-file-name (list buffer-file-name)))
+                ;; Agenda expects a file buffer.  Skip over refreshing
+                ;; agenda cache for non-file buffers.
+                (when buffer-file-name
+		  (org-agenda-prepare-buffers
+		   (and buffer-file-name (list buffer-file-name))))
 		(setq res
 		      (org-scan-tags
 		       func matcher org--matcher-tags-todo-only start-level)))