From 98b6049eccc4f3b19700d27a86f22d4428013501 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Fri, 15 Jul 2022 13:49:52 -0500 Subject: [PATCH] Fix: (org-ql-find) Check major mode See https://github.com/alphapapa/org-ql/issues/284#issuecomment-1185367899. --- org-ql-find.el | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/org-ql-find.el b/org-ql-find.el index 04b06ad..4f8e981 100644 --- a/org-ql-find.el +++ b/org-ql-find.el @@ -110,7 +110,10 @@ single predicate)." (cl-remove-if-not (lambda (buffer) (eq 'org-mode (buffer-local-value 'major-mode buffer))) (buffer-list))) nil t)) - (current-buffer)))) + (progn + (unless (eq major-mode 'org-mode) + (user-error "This is not an Org buffer: %S" (current-buffer))) + (current-buffer))))) ;; Emacs's completion API is not always easy to understand, ;; especially when using "programmed completion." This code was ;; made possible by the example Clemens Radermacher shared at