From 0cfe44084bf639dcf51bb65b432d55e22424f84c Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Tue, 10 Nov 2020 04:24:38 -0600 Subject: [PATCH] Tidy: (org-dblock-write:org-ql) --- org-ql-search.el | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/org-ql-search.el b/org-ql-search.el index e319562..bb02545 100644 --- a/org-ql-search.el +++ b/org-ql-search.el @@ -273,11 +273,11 @@ For example, an org-ql dynamic block header could look like: (format-fns ;; NOTE: Backquoting this alist prevents the lambdas from seeing ;; the variable `ts-format', so we use `list' and `cons'. - (list (cons 'heading (lambda (element) + (list (cons 'todo (lambda (element) + (org-element-property :todo-keyword element))) + (cons 'heading (lambda (element) (org-make-link-string (org-element-property :raw-value element) (org-element-property :raw-value element)))) - (cons 'todo (lambda (element) - (org-element-property :todo-keyword element))) (cons 'priority (lambda (element) (--when-let (org-element-property :priority element) (char-to-string it)))) @@ -302,19 +302,16 @@ For example, an org-ql dynamic block header could look like: (list (alist-get (car column) format-fns))) collect (or (funcall fn element) "")) " | "))) - ;; Insert table header. + ;; Table header (insert "| " (string-join (--map (pcase it ((pred symbolp) (capitalize (symbol-name it))) (`(,_ ,name) name)) columns) " | ") " |" "\n") - ;; Separator line. - (insert "|- \n") - ;; Elements. + (insert "|- \n") ; Separator hline (dolist (element elements) (insert "| " (format-element element) " |" "\n")) - ;; Delete final newline and align table. (delete-char -1) (org-table-align))))