Fix: Tag inheritance
Hardcoded on for now.
This commit is contained in:
parent
005ad636b2
commit
f19f2a4cb4
1 changed files with 12 additions and 15 deletions
19
org-ql.el
19
org-ql.el
|
|
@ -55,14 +55,14 @@ buffer (the default is to widen and search the entire buffer)."
|
||||||
(cl-defun org-ql--query (buffers-or-files pred action-fn &key narrow)
|
(cl-defun org-ql--query (buffers-or-files pred action-fn &key narrow)
|
||||||
"FIXME: Add docstring."
|
"FIXME: Add docstring."
|
||||||
;; MAYBE: Set :narrow t for buffers and nil for files.
|
;; MAYBE: Set :narrow t for buffers and nil for files.
|
||||||
(setq buffers-or-files (cl-typecase buffers-or-files
|
(let* ((buffers-or-files (cl-typecase buffers-or-files
|
||||||
(null (list (current-buffer)))
|
(null (list (current-buffer)))
|
||||||
(buffer (list buffers-or-files))
|
(buffer (list buffers-or-files))
|
||||||
(list buffers-or-files)
|
(list buffers-or-files)
|
||||||
(string (list buffers-or-files))))
|
(string (list buffers-or-files))))
|
||||||
(let* ((org-use-tag-inheritance t)
|
;; TODO: Figure out how to use or reimplement the org-scanner-tags feature.
|
||||||
(org-scanner-tags nil)
|
;; (org-use-tag-inheritance t)
|
||||||
(org-trust-scanner-tags t)
|
;; (org-trust-scanner-tags t)
|
||||||
(org-ql--today (org-today)))
|
(org-ql--today (org-today)))
|
||||||
(-flatten-n 1 (--map (with-current-buffer (cl-typecase it
|
(-flatten-n 1 (--map (with-current-buffer (cl-typecase it
|
||||||
(buffer it)
|
(buffer it)
|
||||||
|
|
@ -127,13 +127,10 @@ With KEYWORDS, return non-nil if its keyword is one of KEYWORDS."
|
||||||
(apply #'org-ql--todo-p org-done-keywords-for-agenda))
|
(apply #'org-ql--todo-p org-done-keywords-for-agenda))
|
||||||
|
|
||||||
(defun org-ql--tags-p (&rest tags)
|
(defun org-ql--tags-p (&rest tags)
|
||||||
"Return non-nil if current heading has TAGS."
|
"Return non-nil if current heading has one or more of TAGS."
|
||||||
;; TODO: Try to use `org-make-tags-matcher' to improve performance.
|
;; TODO: Try to use `org-make-tags-matcher' to improve performance. It would be nice to not have
|
||||||
(when-let ((tags-at (org-get-tags-at (point)
|
;; to run `org-get-tags-at' for every heading, especially with inheritance.
|
||||||
;; FIXME: Would be nice to not check this for every heading checked.
|
(when-let ((tags-at (org-get-tags-at (point) (not org-use-tag-inheritance))))
|
||||||
;; FIXME: Figure out whether I should use `org-agenda-use-tag-inheritance' or `org-use-tag-inheritance', etc.
|
|
||||||
;; (not (member 'agenda org-agenda-use-tag-inheritance))
|
|
||||||
org-use-tag-inheritance)))
|
|
||||||
(cl-typecase tags
|
(cl-typecase tags
|
||||||
(null t)
|
(null t)
|
||||||
(otherwise (seq-intersection tags tags-at)))))
|
(otherwise (seq-intersection tags tags-at)))))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue