From a971997f8fdbeb291ae4a4ba7542c6b4e3668f76 Mon Sep 17 00:00:00 2001 From: Jonas Bernoulli Date: Wed, 19 Jul 2023 02:32:46 +0200 Subject: [PATCH] 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. --- ox-gfm.el | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/ox-gfm.el b/ox-gfm.el index 4cac85b..a8da135 100644 --- a/ox-gfm.el +++ b/ox-gfm.el @@ -206,21 +206,20 @@ contextual information." (no-header (or (<= (length rows) 1))) (cols (cdr (org-export-table-dimensions table info))) (build-dummy-header - (function - (lambda () - (let ((build-empty-cell (org-gfm-make-hline-builder table info ?\s)) - (build-rule (org-gfm-make-hline-builder table info ?-)) - (columns (number-sequence 0 (- cols 1)))) - (concat gfm-table-left-border - (mapconcat (lambda (col) (funcall build-empty-cell col)) - columns - gfm-table-separator) - gfm-table-right-border "\n" gfm-table-left-border - (mapconcat (lambda (col) (funcall build-rule col)) - columns - gfm-table-separator) - gfm-table-right-border "\n")))))) - (concat (when no-header (funcall build-dummy-header)) + (lambda () + (let ((build-empty-cell (org-gfm-make-hline-builder table info ?\s)) + (build-rule (org-gfm-make-hline-builder table info ?-)) + (columns (number-sequence 0 (- cols 1)))) + (concat gfm-table-left-border + (mapconcat (lambda (col) (funcall build-empty-cell col)) + columns + gfm-table-separator) + gfm-table-right-border "\n" gfm-table-left-border + (mapconcat (lambda (col) (funcall build-rule col)) + columns + gfm-table-separator) + gfm-table-right-border "\n"))))) + (concat (and no-header (funcall build-dummy-header)) (replace-regexp-in-string "\n\n" "\n" contents)))) ;;;; Table of contents