Fix #55: Add org-file-tags to inherited tags list
This commit is contained in:
parent
e9d5bca842
commit
c8af804190
1 changed files with 16 additions and 7 deletions
23
org-ql.el
23
org-ql.el
|
|
@ -401,13 +401,12 @@ Returns cons (INHERITED-TAGS . LOCAL-TAGS)."
|
||||||
-non-nil -uniq))
|
-non-nil -uniq))
|
||||||
((listp inherited) inherited)
|
((listp inherited) inherited)
|
||||||
((listp local) local)))))
|
((listp local) local)))))
|
||||||
(cl-typecase org-use-tag-inheritance
|
(org-ql--tags-apply-inheritance tags)))))
|
||||||
(list (setf tags (-intersection tags org-use-tag-inheritance)))
|
;; If org-use-tag-inheritance is non-nil we
|
||||||
(string (setf tags (--select (string-match org-use-tag-inheritance it)
|
;; here 'cause this is top-most item, so we
|
||||||
tags))))
|
;; can collect file tags.
|
||||||
(pcase org-tags-exclude-from-inheritance
|
(when org-use-tag-inheritance
|
||||||
('nil tags)
|
(org-ql--tags-apply-inheritance org-file-tags))
|
||||||
(_ (-difference tags org-tags-exclude-from-inheritance)))))))
|
|
||||||
'org-ql-nil))
|
'org-ql-nil))
|
||||||
(all-tags (list inherited-tags local-tags)))
|
(all-tags (list inherited-tags local-tags)))
|
||||||
;; Check caches again, because they may have been set now.
|
;; Check caches again, because they may have been set now.
|
||||||
|
|
@ -439,6 +438,16 @@ Returns cons (INHERITED-TAGS . LOCAL-TAGS)."
|
||||||
(list heading))
|
(list heading))
|
||||||
(list heading)))))
|
(list heading)))))
|
||||||
|
|
||||||
|
(defun org-ql--tags-apply-inheritance (tags)
|
||||||
|
"Apply inheritance settings on TAGS."
|
||||||
|
(cl-typecase org-use-tag-inheritance
|
||||||
|
(list (setf tags (-intersection tags org-use-tag-inheritance)))
|
||||||
|
(string (setf tags (--select (string-match org-use-tag-inheritance it)
|
||||||
|
tags))))
|
||||||
|
(pcase org-tags-exclude-from-inheritance
|
||||||
|
('nil tags)
|
||||||
|
(_ (-difference tags org-tags-exclude-from-inheritance))))
|
||||||
|
|
||||||
;; TODO: Use --value-at for tags cache.
|
;; TODO: Use --value-at for tags cache.
|
||||||
|
|
||||||
(defun org-ql--value-at (position fn)
|
(defun org-ql--value-at (position fn)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue