From a0a8834f30f1d5b6793ed5080bd7b65b0710ff87 Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Thu, 18 Jun 2015 15:31:09 +0200 Subject: [PATCH] ox-koma-letter: Fix a docstring * contrib/lisp/ox-koma-letter.el (org-koma-letter--special-contents-as-macro): Fix docstring. Tiny refactoring. --- contrib/lisp/ox-koma-letter.el | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/contrib/lisp/ox-koma-letter.el b/contrib/lisp/ox-koma-letter.el index 119ffe9a6..1e8c2355f 100644 --- a/contrib/lisp/ox-koma-letter.el +++ b/contrib/lisp/ox-koma-letter.el @@ -465,27 +465,27 @@ return a string or nil." (t value)))) (defun org-koma-letter--special-contents-as-macro - (keywords &optional keep-newlines no-tag) - "Process KEYWORDS members of `org-koma-letter-special-contents'. + (keywords &optional keep-newlines no-tag) + "Process KEYWORDS members of `org-koma-letter-special-contents'. KEYWORDS is a list of symbols. Return them as a string to be formatted. The function is used for inserting content of special headings such as PS. -If KEEP-NEWLINES is t newlines will not be removed. If NO-TAG is -t the content in `org-koma-letter-special-contents' will not be -wrapped in a macro named whatever the members of KEYWORDS are -called." +If KEEP-NEWLINES is non-nil leading and trailing newlines are not +removed. If NO-TAG is non-nil the content in +`org-koma-letter-special-contents' are not wrapped in a macro +named whatever the members of KEYWORDS are called." (mapconcat - #'(lambda (keyword) - (let* ((name (org-koma-letter--get-value keyword)) - (value (org-koma-letter--get-tagged-contents name))) - (when value - (if no-tag (if keep-newlines value (org-trim value)) - (format "\\%s{%s}\n" - name - (if keep-newlines value (org-trim value))))))) + (lambda (keyword) + (let* ((name (org-koma-letter--get-value keyword)) + (value (org-koma-letter--get-tagged-contents name))) + (cond ((not value) nil) + (no-tag (if keep-newlines value (org-trim value))) + (t (format "\\%s{%s}\n" + name + (if keep-newlines value (org-trim value))))))) keywords "")) -- 2.11.4.GIT