org-make-tags-matcher: Do not try collecting tags from non-Org buffers

* lisp/org.el (org-make-tags-matcher): When building tag completion
table, do not attempt to call `org-get-buffer-tags' when current
buffer is not an Org buffer.

Reported-by: Colin Baxter <m43cap@yandex.com>
Link: https://orgmode.org/list/87ilb1fakk.fsf@yandex.com
This commit is contained in:
Ihor Radchenko 2023-07-03 15:28:08 +03:00
parent 38f87aa30a
commit e34b72eec6
No known key found for this signature in database
GPG Key ID: 6470762A7DA11D8B
1 changed files with 2 additions and 1 deletions

View File

@ -11288,7 +11288,8 @@ See also `org-scan-tags'."
;; tags table and the local tags in current buffer.
(let ((org-last-tags-completion-table
(org--tag-add-to-alist
(org-get-buffer-tags)
(when (derived-mode-p 'org-mode)
(org-get-buffer-tags))
(unless only-local-tags
(org-global-tags-completion-table)))))
(setq match