diff options
author | Nicolas Goaziou <mail@nicolasgoaziou.fr> | 2019-05-21 10:24:11 +0200 |
---|---|---|
committer | Nicolas Goaziou <mail@nicolasgoaziou.fr> | 2019-05-21 10:24:11 +0200 |
commit | ff2bf22655eda21d900f23d5e1486735812e8fe4 (patch) | |
tree | a8fbc99b01565014463454cd8a85647f8fa01eff | |
parent | f45caca6081bc5b61a581eaace3314761a4736d0 (diff) | |
download | org-mode-ff2bf22655eda21d900f23d5e1486735812e8fe4.tar.gz |
ox-html: Small refactoring
* lisp/ox-html.el (org-html--build-pre/postamble): Prefer `and' over
`when' for short Sexps where return value matters.
-rw-r--r-- | lisp/ox-html.el | 53 |
1 files changed, 27 insertions, 26 deletions
diff --git a/lisp/ox-html.el b/lisp/ox-html.el index e5b56a4..9d9de62 100644 --- a/lisp/ox-html.el +++ b/lisp/ox-html.el @@ -1983,32 +1983,33 @@ communication channel." (creator (cdr (assq ?c spec))) (validation-link (cdr (assq ?v spec)))) (concat - (when (and (plist-get info :with-date) - (org-string-nw-p date)) - (format "<p class=\"date\">%s: %s</p>\n" - (org-html--translate "Date" info) - date)) - (when (and (plist-get info :with-author) - (org-string-nw-p author)) - (format "<p class=\"author\">%s: %s</p>\n" - (org-html--translate "Author" info) - author)) - (when (and (plist-get info :with-email) - (org-string-nw-p email)) - (format "<p class=\"email\">%s: %s</p>\n" - (org-html--translate "Email" info) - email)) - (when (plist-get info :time-stamp-file) - (format - "<p class=\"date\">%s: %s</p>\n" - (org-html--translate "Created" info) - (format-time-string - (plist-get info :html-metadata-timestamp-format)))) - (when (plist-get info :with-creator) - (format "<p class=\"creator\">%s</p>\n" creator)) - (when (org-string-nw-p validation-link) - (format "<p class=\"validation\">%s</p>\n" - validation-link))))) + (and (plist-get info :with-date) + (org-string-nw-p date) + (format "<p class=\"date\">%s: %s</p>\n" + (org-html--translate "Date" info) + date)) + (and (plist-get info :with-author) + (org-string-nw-p author) + (format "<p class=\"author\">%s: %s</p>\n" + (org-html--translate "Author" info) + author)) + (and (plist-get info :with-email) + (org-string-nw-p email) + (format "<p class=\"email\">%s: %s</p>\n" + (org-html--translate "Email" info) + email)) + (and (plist-get info :time-stamp-file) + (format + "<p class=\"date\">%s: %s</p>\n" + (org-html--translate "Created" info) + (format-time-string + (plist-get info :html-metadata-timestamp-format)))) + (and (plist-get info :with-creator) + (org-string-nw-p creator) + (format "<p class=\"creator\">%s</p>\n" creator)) + (and (org-string-nw-p validation-link) + (format "<p class=\"validation\">%s</p>\n" + validation-link))))) (t (let ((formats (plist-get info (if (eq type 'preamble) :html-preamble-format |