Skip to content

Commit 456953a

Browse files
author
Jason Duncan
committed
Replaced nilp with not.
1 parent 042fe54 commit 456953a

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

format-table-test.el

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
(buffer-string)))
1919

2020
(defun compare-result-lines (expected-lines actual-lines)
21-
(if (nilp expected-lines) nil
21+
(if (not expected-lines) nil
2222
(progn
2323
(should (string-equal (car expected-lines) (car actual-lines)))
2424
(compare-result-lines (cdr expected-lines) (cdr actual-lines)))))

format-table.el

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -94,13 +94,13 @@
9494
(defun format-table-remove-noise (lines input-mode)
9595
"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."
9696
(let* ((row-count-format (plist-get input-mode :row-count-format))
97-
(regexp (if (nilp row-count-format) nil (format row-count-format "[[:digit:]]+")))
97+
(regexp (if (not row-count-format) nil (format row-count-format "[[:digit:]]+")))
9898
ret)
9999
(dolist (cur-line (reverse lines) ret)
100100
(if (not (or (string-equal "" cur-line)
101-
(if (nilp regexp) nil (string-match regexp cur-line))))
101+
(if (not regexp) nil (string-match regexp cur-line))))
102102
(push cur-line ret)))
103-
(if (nilp ret) nil
103+
(if (not ret) nil
104104
(setq ret (if (plist-get input-mode :top-border-fn) (-slice ret 1) ret))
105105
(if (plist-get input-mode :top-border-fn)
106106
(-slice ret 0 (1- (length ret))) ret))))
@@ -219,7 +219,7 @@ otherwise values will be padded to the right with spaces."
219219
(defun format-table-render-row-count (count output-mode)
220220
"Render the given row count COUNT for the given OUTPUT-MODE."
221221
(let ((output-format (plist-get output-mode :row-count-format)))
222-
(if (nilp output-format) ""
222+
(if (not output-format) ""
223223
(replace-regexp-in-string
224224
(regexp-quote "[[:digit:]]+.[[:digit:]]+") "0.00"
225225
(replace-regexp-in-string
@@ -254,7 +254,7 @@ otherwise values will be padded to the right with spaces."
254254
(let* ((lines (split-string str "[
255255
]+"))
256256
(lines (format-table-remove-noise lines input-mode)))
257-
(if (nilp lines) nil
257+
(if (not lines) nil
258258
(let* ((col-widths (format-table-get-col-widths (car (cdr lines)) input-mode)))
259259
(format-table-parse-table lines col-widths input-mode))))))
260260

@@ -263,7 +263,7 @@ otherwise values will be padded to the right with spaces."
263263
(let* ((input-mode (format-table-get-format input-mode))
264264
(output-mode (format-table-get-format output-mode))
265265
(table (format-table-cleanup-and-parse str input-mode)))
266-
(if (nilp table)
266+
(if (not table)
267267
str
268268
(concat
269269
(format-table-render-table table output-mode)

0 commit comments

Comments
 (0)