Skip to content

Commit 9e06474

Browse files
author
Jason Duncan
committed
Started shortening doc strings.
1 parent a2319e1 commit 9e06474

File tree

3 files changed

+13
-7
lines changed

3 files changed

+13
-7
lines changed

.#TODO.org

Lines changed: 0 additions & 1 deletion
This file was deleted.

TODO.org

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
*** NOTE2 I'm wary of going all the way to string-blank-p as I wouldn't want to break potential compatibility with a table format which uses whitespace in a way I hadn't thought of.
2222

2323
** DONE Could the last conditional in format-table-remove-noise be written with (when ret ...) instead of (if (not ret) nil ...)?
24-
** TODO Rather than
24+
** DONE Rather than
2525

2626
#+BEGIN_SRC emacs-lisp
2727
(let* ((lines (split-string str "[

format-table.el

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@
149149
(format-table-assemble-table header body)))
150150

151151
(defun format-table-get-max-col-widths (table)
152-
"Given the nested list TABLE of values, determine the length of the longest value in each column and return each in a list."
152+
"Determine the length of the longest value in each column from TABLE and return as a list."
153153
(let ((last (make-list (length (car table)) 0)))
154154
(dolist (cur-row table last)
155155
(setq last
@@ -176,7 +176,10 @@ otherwise values will be padded to the right with spaces."
176176
(make-string length ?-))
177177

178178
(defun format-table-render-separator-row (max-col-widths output-mode)
179-
"Given the list of MAX-COL-WIDTHS and delimiter information in OUTPUT-MODE, render a row which separates the header row from the rest of the rows."
179+
"Render a row which separates the header row from the rest of the rows.
180+
181+
Columns will be spaced accrding to MAX-COL-WIDTHS and delimited using strings
182+
from OUTPUT-MODE."
180183
(append
181184
(list
182185
(plist-get output-mode :separator-begin-row))
@@ -195,7 +198,7 @@ otherwise values will be padded to the right with spaces."
195198
(json-encode vec)))
196199

197200
(defun format-table-render-table (table output-mode)
198-
"Given the TABLE of values and delimiter information in OUTPUT-MODE, re-render the table as a string."
201+
"Re-render the TABLE of values as a string using delimiter information in OUTPUT-MODE."
199202
(if (equal output-mode 'json)
200203
(list (format-table-render-json table))
201204
(let ((top-border-fn (plist-get output-mode :top-border-fn))
@@ -241,7 +244,7 @@ otherwise values will be padded to the right with spaces."
241244
(format-table-assemble-table header body)))
242245

243246
(defun format-table-cleanup-and-parse (str input-mode)
244-
"Parse the given string STR using delimiter information in INPUT-MODE to a table of values as a plist."
247+
"Parse the given string STR using delimiter information in INPUT-MODE to a plist."
245248
(if (equal input-mode 'json)
246249
(format-table-parse-json str)
247250
(let* ((lines (split-string str "[\n]+"))
@@ -251,7 +254,11 @@ otherwise values will be padded to the right with spaces."
251254
(format-table-parse-table lines col-widths input-mode))))))
252255

253256
(defun format-table (str input-mode output-mode)
254-
"Process the given string STR containing a table in a format specified by INPUT-MODE, gather and reformat the table contained within to the format specified by OUTPUT-MODE."
257+
"Reformat tabular data.
258+
259+
Process the given string STR containing a table in a format specified by
260+
INPUT-MODE, gather and reformat the table contained within to the format
261+
specified by OUTPUT-MODE."
255262
(let* ((input-mode (format-table-get-format input-mode))
256263
(output-mode (format-table-get-format output-mode))
257264
(table (format-table-cleanup-and-parse str input-mode)))

0 commit comments

Comments
 (0)