Compare commits

...

2 Commits

Author SHA1 Message Date
df2a9a70b3 defined pt-get-body 2025-05-12 18:01:59 -04:00
7e2b9f3dde variable rename 2025-05-12 16:14:19 -04:00

View File

@@ -40,10 +40,10 @@ TODO: more documentation"
(dolist (record src-body) (dolist (record src-body)
(pt--process-record record source-cols buckets)))) (pt--process-record record source-cols buckets))))
(defun pt-get-columns (source) (defun pt-get-columns (table)
"Extract the column names from a table" "Extract the column names from a table"
(let (result) (let (result)
(dolist (row source) (dolist (row table)
(when (and (listp row) (equal (car row) "!")) (when (and (listp row) (equal (car row) "!"))
(let ((n 2)) (let ((n 2))
(dolist (cell (cdr row)) (dolist (cell (cdr row))
@@ -52,6 +52,17 @@ TODO: more documentation"
(setq n (1+ n)))))) (setq n (1+ n))))))
result)) result))
(defun pt-get-body (source)
"Discards all rows from a table before the first hline (if present)
If there is no hline, the table is instead returned unaltered."
(catch :return
(let ((remain source))
(while remain
(when (eq (car remain) 'hline)
(throw :return (cdr remain)))
(pop remain))
source)))
;; Local Variables: ;; Local Variables:
;; read-symbol-shorthands: (("pt-" . "pivot-table-")) ;; read-symbol-shorthands: (("pt-" . "pivot-table-"))
;; End: ;; End: