Fix #55: Add org-file-tags to inherited tags list

This commit is contained in:
Mikhail Skorzhinskii 2019-12-27 10:09:29 +01:00
parent e9d5bca842
commit c8af804190

View file

@ -401,13 +401,12 @@ Returns cons (INHERITED-TAGS . LOCAL-TAGS)."
-non-nil -uniq))
((listp inherited) inherited)
((listp local) local)))))
(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)))))))
(org-ql--tags-apply-inheritance tags)))))
;; If org-use-tag-inheritance is non-nil we
;; here 'cause this is top-most item, so we
;; can collect file tags.
(when org-use-tag-inheritance
(org-ql--tags-apply-inheritance org-file-tags))
'org-ql-nil))
(all-tags (list inherited-tags local-tags)))
;; Check caches again, because they may have been set now.
@ -439,6 +438,16 @@ Returns cons (INHERITED-TAGS . LOCAL-TAGS)."
(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.
(defun org-ql--value-at (position fn)