WIP: Add marker to items for Agenda commands

This commit is contained in:
Adam Porter 2022-03-18 11:32:21 -05:00
parent 998bd1edda
commit e28f80daf8

View file

@ -67,9 +67,10 @@ second levels."
keyword)) keyword))
(org-ql-view-define-column "Heading" (:max-width 60) (org-ql-view-define-column "Heading" (:max-width 60)
(org-link-display-format (propertize (org-link-display-format
(org-element-property (org-element-property
:raw-value (org-ql-view--add-faces item)))) :raw-value (org-ql-view--add-faces item)))
:org-hd-marker (org-element-property :org-hd-marker item)))
(org-ql-view-define-column "Pri" (:max-width nil) (org-ql-view-define-column "Pri" (:max-width nil)
(or (-some->> (org-element-property :priority item) (or (-some->> (org-element-property :priority item)
@ -296,7 +297,21 @@ Searches in ELEMENT's buffer."
"Show Org QL QUERY on BUFFERS-OR-FILES with `taxy-org-ql-view'." "Show Org QL QUERY on BUFFERS-OR-FILES with `taxy-org-ql-view'."
(declare (indent 1)) (declare (indent 1))
(let (format-table column-sizes) (let (format-table column-sizes)
(cl-labels ((format-item (item) (gethash item format-table)) (cl-labels ((format-item (item)
;; For compatibility with Org Agenda, we
;; add the marker property to the whole
;; string (though it only seems to check
;; at BOL).
(let* ((string (gethash item format-table))
(marker (or (get-text-property 0 :org-hd-marker string)
(when-let ((pos (next-single-property-change 0 :org-hd-marker string)))
(get-text-property pos :org-hd-marker string)))))
;; I don't understand why Org sometimes
;; uses one property and sometimes the
;; other.
(propertize string
'org-hd-marker marker
'org-marker marker)))
(make-fn (&rest args) (make-fn (&rest args)
(apply #'make-taxy-magit-section (apply #'make-taxy-magit-section
:make #'make-fn :make #'make-fn