FUEL: Tiny refactoring.
parent
e4d4a32c5a
commit
85536398d0
|
@ -113,20 +113,23 @@
|
||||||
fuel-table-corner-rb
|
fuel-table-corner-rb
|
||||||
fuel-table-tee-b))
|
fuel-table-tee-b))
|
||||||
|
|
||||||
|
(defun fuel-table--insert-row (r)
|
||||||
|
(let ((ln (length (car r)))
|
||||||
|
(l 0))
|
||||||
|
(while (< l ln)
|
||||||
|
(insert (concat fuel-table-sep " "
|
||||||
|
(mapconcat 'identity
|
||||||
|
(mapcar `(lambda (x) (nth ,l x)) r)
|
||||||
|
(concat " " fuel-table-sep " "))
|
||||||
|
" " fuel-table-sep "\n"))
|
||||||
|
(setq l (1+ l)))))
|
||||||
|
|
||||||
(defun fuel-table--insert (rows)
|
(defun fuel-table--insert (rows)
|
||||||
(let* ((widths (fuel-table--col-widths rows))
|
(let* ((widths (fuel-table--col-widths rows))
|
||||||
(rows (fuel-table--format-rows rows widths)))
|
(rows (fuel-table--format-rows rows widths)))
|
||||||
(fuel-table--insert-first-line widths)
|
(fuel-table--insert-first-line widths)
|
||||||
(dolist (r rows)
|
(dolist (r rows)
|
||||||
(let ((ln (length (car r)))
|
(fuel-table--insert-row r)
|
||||||
(l 0))
|
|
||||||
(while (< l ln)
|
|
||||||
(insert (concat fuel-table-sep " "
|
|
||||||
(mapconcat 'identity
|
|
||||||
(mapcar `(lambda (x) (nth ,l x)) r)
|
|
||||||
(concat " " fuel-table-sep " "))
|
|
||||||
" " fuel-table-sep "\n"))
|
|
||||||
(setq l (1+ l))))
|
|
||||||
(fuel-table--insert-middle-line widths))
|
(fuel-table--insert-middle-line widths))
|
||||||
(kill-line -1)
|
(kill-line -1)
|
||||||
(fuel-table--insert-last-line widths)))
|
(fuel-table--insert-last-line widths)))
|
||||||
|
|
Loading…
Reference in New Issue