Compare commits
2 Commits
f253c63db3
...
df2a9a70b3
| Author | SHA1 | Date | |
|---|---|---|---|
| df2a9a70b3 | |||
| 7e2b9f3dde |
@@ -40,10 +40,10 @@ TODO: more documentation"
|
||||
(dolist (record src-body)
|
||||
(pt--process-record record source-cols buckets))))
|
||||
|
||||
(defun pt-get-columns (source)
|
||||
(defun pt-get-columns (table)
|
||||
"Extract the column names from a table"
|
||||
(let (result)
|
||||
(dolist (row source)
|
||||
(dolist (row table)
|
||||
(when (and (listp row) (equal (car row) "!"))
|
||||
(let ((n 2))
|
||||
(dolist (cell (cdr row))
|
||||
@@ -52,6 +52,17 @@ TODO: more documentation"
|
||||
(setq n (1+ n))))))
|
||||
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:
|
||||
;; read-symbol-shorthands: (("pt-" . "pivot-table-"))
|
||||
;; End:
|
||||
|
||||
Reference in New Issue
Block a user