From e34b72eec68b8c6633310af006f13023dcf85001 Mon Sep 17 00:00:00 2001 From: Ihor Radchenko Date: Mon, 3 Jul 2023 15:28:08 +0300 Subject: [PATCH] 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 Link: https://orgmode.org/list/87ilb1fakk.fsf@yandex.com --- lisp/org.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lisp/org.el b/lisp/org.el index fdf58c3f7..36235322d 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -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