diff --git a/org-ql-agenda.el b/org-ql-agenda.el index dda1e7a..4e043cd 100644 --- a/org-ql-agenda.el +++ b/org-ql-agenda.el @@ -187,9 +187,12 @@ Its property list should be the second item in the list, as returned by `org-ele (org-ql-agenda--add-todo-face it))) ;; FIXME: Figure out whether I should use `org-agenda-use-tag-inheritance' or `org-use-tag-inheritance', etc. (tag-list (if org-use-tag-inheritance + ;; FIXME: Note that tag inheritance cannot be used here unless markers are + ;; added, otherwise we can't go to the item's buffer to look for inherited + ;; tags. (Or does `org-element-headline-parser' parse inherited tags too? I + ;; forget...) (if-let ((marker (or (org-element-property :org-hd-marker element) - (org-element-property :org-marker element) - (org-element-property :begin element)))) + (org-element-property :org-marker element)))) (with-current-buffer (marker-buffer marker) ;; I wish `org-get-tags-at' used the correct buffer automatically. (org-get-tags-at marker (not org-use-tag-inheritance))) diff --git a/org-ql.el b/org-ql.el index 46b137d..3a26a86 100644 --- a/org-ql.el +++ b/org-ql.el @@ -37,15 +37,15 @@ If MARKERS is non-nil, `org-agenda-ng--add-markers' is used to add markers to each item, pointing to the item in its source buffer. In this case, ACTION should return an Org element." (declare (indent defun)) - (setq action (cl-ecase markers - ('t `(lambda () - ;; FIXME: Document that, when markers is t, `action' should return an Org - ;; headline element, which --add-markers works with. On the other hand, - ;; maybe this should be on the agenda-ng side. - (->> ,action - org-ql--add-agenda-markers))) + (setq action (pcase markers ('nil `(lambda () - ,action)))) + ,action)) + (_ `(lambda () + ;; FIXME: Document that, when markers is t, `action' should return an Org + ;; headline element, which --add-markers works with. On the other hand, + ;; maybe this should be on the agenda-ng side. + (->> ,action + org-ql--add-agenda-markers))))) `(org-ql--query ,buffers-or-files ',pred-body :action ,action