From 3856e61800a12553c2d75213f261b7435bdfad01 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Tue, 13 Aug 2019 15:05:47 -0500 Subject: [PATCH] Fix: (org-ql-select) Don't search hidden/special buffers --- README.org | 1 + org-ql.el | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/README.org b/README.org index 38a79e2..2726fdd 100644 --- a/README.org +++ b/README.org @@ -386,6 +386,7 @@ Expands into a call to ~org-ql-select~ with the same arguments. For convenience + Handle date ranges in date-based selectors. (Thanks to [[https://github.com/codygman][Cody Goodman]], [[https://github.com/swflint][Samuel W. Flint]], and [[https://github.com/vikasrawal][Vikas Rawal]].) + Don't overwrite bindings in =org-agenda-mode-map=. + Don't search buffers without headings, and show a message if the user attempts it. ++ Don't search hidden/special buffers. *Compatibility* + Fixes for compatibility with Org 9.2. (Thanks to [[https://github.com/ataias][Ataias Pereira Reis]] and [[https://github.com/dakra][Daniel Kraus]].) diff --git a/org-ql.el b/org-ql.el index ca38445..c3e370c 100644 --- a/org-ql.el +++ b/org-ql.el @@ -156,7 +156,9 @@ non-nil." ;; It feels unintuitive that `find-file-noselect' returns ;; a buffer if the filename doesn't exist. (find-file-noselect it)) - (user-error "Can't open file: %s" it))))))) + (user-error "Can't open file: %s" it))))) + ;; Ignore special/hidden buffers. + (--remove (string-prefix-p " " (buffer-name it))))) (query (org-ql--pre-process-query query)) ((query preamble-re) (org-ql--query-preamble query)) (predicate (org-ql--query-predicate query))