org-gfm-table: Cosmetics

- It is redundant to use `function' around `lambda'.
- It is semantically better to use `and' if the returned value
  matters.  `when' should be used if we only care about the
  side-effects.
This commit is contained in:
Jonas Bernoulli 2023-07-19 02:32:46 +02:00
parent 4aabaa51b1
commit a971997f8f

View File

@ -206,7 +206,6 @@ contextual information."
(no-header (or (<= (length rows) 1))) (no-header (or (<= (length rows) 1)))
(cols (cdr (org-export-table-dimensions table info))) (cols (cdr (org-export-table-dimensions table info)))
(build-dummy-header (build-dummy-header
(function
(lambda () (lambda ()
(let ((build-empty-cell (org-gfm-make-hline-builder table info ?\s)) (let ((build-empty-cell (org-gfm-make-hline-builder table info ?\s))
(build-rule (org-gfm-make-hline-builder table info ?-)) (build-rule (org-gfm-make-hline-builder table info ?-))
@ -219,8 +218,8 @@ contextual information."
(mapconcat (lambda (col) (funcall build-rule col)) (mapconcat (lambda (col) (funcall build-rule col))
columns columns
gfm-table-separator) gfm-table-separator)
gfm-table-right-border "\n")))))) gfm-table-right-border "\n")))))
(concat (when no-header (funcall build-dummy-header)) (concat (and no-header (funcall build-dummy-header))
(replace-regexp-in-string "\n\n" "\n" contents)))) (replace-regexp-in-string "\n\n" "\n" contents))))
;;;; Table of contents ;;;; Table of contents