ox-koma-letter: Use `org-koma-letter-use-title'

* contrib/lisp/ox-koma-letter.el (org-koma-letter-template): Use
  `org-koma-letter-use-title'.  Small refactoring.
This commit is contained in:
Nicolas Goaziou 2014-02-05 17:05:08 +01:00
parent 7eb570b860
commit 63d788653e
1 changed files with 7 additions and 6 deletions

View File

@ -631,15 +631,16 @@ holding export options."
(if (symbolp with-subject) with-subject (if (symbolp with-subject) with-subject
(mapconcat #'symbol-name with-subject ",")))) (mapconcat #'symbol-name with-subject ","))))
(let* ((title-as-subject (plist-get info :with-title-as-subject)) (let* ((title-as-subject (plist-get info :with-title-as-subject))
(subject* (org-string-nw-p (org-export-data (plist-get info :subject) info))) (subject* (org-string-nw-p
(title* (org-string-nw-p (org-export-data (plist-get info :title) info))) (org-export-data (plist-get info :subject) info)))
(title* (and (plist-get info :with-title)
(org-string-nw-p
(org-export-data (plist-get info :title) info))))
(subject (if title-as-subject (or subject* title*) subject*)) (subject (if title-as-subject (or subject* title*) subject*))
(title (if title-as-subject (and subject* title*) title*))) (title (if title-as-subject (and subject* title*) title*)))
(concat (concat
(and (org-string-nw-p subject) (and subject (format "\\setkomavar{subject}{%s}\n" subject))
(format "\\setkomavar{subject}{%s}\n" subject)) (and title (format "\\setkomavar{title}{%s}\n" title))
(and (org-string-nw-p title)
(format "\\setkomavar{title}{%s}\n" title))
(when (or (org-string-nw-p title) (org-string-nw-p subject)) "\n")))))) (when (or (org-string-nw-p title) (org-string-nw-p subject)) "\n"))))))
;; Letter start. ;; Letter start.
(format "\\begin{letter}{%%\n%s}\n\n" (format "\\begin{letter}{%%\n%s}\n\n"