Fix: (org-ql-find) Check major mode

See https://github.com/alphapapa/org-ql/issues/284#issuecomment-1185367899.
This commit is contained in:
Adam Porter 2022-07-15 13:49:52 -05:00
parent a986e360c3
commit 98b6049ecc

View file

@ -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