You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
** DONE Some docstrings are quite long which lets you pass package-lint and makes for good enough M-x apropos output, but they wrap poorly in M-x help.
2
+
** DONE "delimiater" -> "delimiter"
3
+
** DONE Since you're using Emacs 25 you can use the string-trim functions (could format-table-trim-row be rewritten as just (string-trim row begin-row end-row)?
4
+
** DONE Could the first conditional in format-table-remove-noise be written either as:
5
+
6
+
#+BEGIN_SRC emacs-lisp
7
+
(unless (or (string-equal "" cur-line)
8
+
(and regexp (string-match regexp cur-line)))
9
+
(push cur-line ret))
10
+
#+END_SRC
11
+
12
+
*** or, even more aggressively (perhaps even using string-blank-p instead of string-empty-p?):
13
+
14
+
#+BEGIN_SRC emacs-lisp
15
+
(and (not (string-empty-p cur-line))
16
+
(not (and regexp (string-match regexp cur-line)))
17
+
(push cur-line ret))
18
+
#+END_SRC
19
+
20
+
*** NOTE The version using `and' is slightly more concise, but I believe the compromise I made between the two suggestions to be more readable.
21
+
*** 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.
22
+
23
+
** DONE Could the last conditional in format-table-remove-noise be written with (when ret ...) instead of (if (not ret) nil ...)?
24
+
** DONE Rather than
25
+
26
+
#+BEGIN_SRC emacs-lisp
27
+
(let* ((lines (split-string str "[
28
+
29
+
]+"))...)
30
+
#+END_SRC
31
+
32
+
which incidentally contains two newlines, why not:
"Pad the string VALUE to the length specified by LENGTH by surrounding with spaces."
80
+
"Pad the string VALUE to the LENGTH specified by surrounding with spaces."
81
81
(let* ((value-length (length value))
82
82
(left-length (/ (-length value-length) 2))
83
83
(right-length (+ left-length
@@ -93,44 +93,42 @@
93
93
(make-string right-length ? ))))
94
94
95
95
(defunformat-table-remove-noise (linesinput-mode)
96
+
"Remove lines which constitute noise, such as empty lines or results count.
97
+
LINES is the list of source lines, split on newlines. INPUT-MODE is used to
98
+
determine what the results count should look like."
96
99
"Given the set of table LINES and some extra information in INPUT-MODE, filter out any empty lines or lines which otherwise do not belong to the table of values."
"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."
263
+
"Reformat tabular data.
264
+
Process the given string STR containing a table in a format specified by
265
+
INPUT-MODE, gather and reformat the table contained within to the format
0 commit comments