Skip to content

Implement simple custom columns for dynamic blocks - #515

Open
libanp wants to merge 1 commit into
alphapapa:masterfrom
libanp:lhp/custom-columns
Open

Implement simple custom columns for dynamic blocks#515
libanp wants to merge 1 commit into
alphapapa:masterfrom
libanp:lhp/custom-columns

Conversation

@libanp

@libanp libanp commented Jul 3, 2026

Copy link
Copy Markdown

I've implemented a simple custom columns mechanism. There is a custom column type that takes a function and applies it to element. Though I notice there's a line saying "MAYBE: custom column functions", so I understand if this is something you'd rather not support or if you'd prefer a different approach.

It currently works like:

(defun my/org-ql:db-stats (element)
  (--when-let (org-element-property :raw-value element)
    (when (string-match "\\[\\([0-9]*\\(?:%\\|/[0-9]*\\)\\)\\]" it)
      (match-string 1 it))))

#+BEGIN: org-ql :query "todo: level:2" :columns (heading todo ((custom my/org-ql:db-stats) "Progress") ) 
#+END

Lambdas work too e.g by adding ((lambda (x) "hi") "example") to the :columns list

Allows passing a function in an org-ql dynamic block's columns list to
act on a matched heading's Org element.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant