diff options
author | Nicolas Goaziou <mail@nicolasgoaziou.fr> | 2014-09-20 21:32:52 +0200 |
---|---|---|
committer | Nicolas Goaziou <mail@nicolasgoaziou.fr> | 2014-09-20 21:32:52 +0200 |
commit | 8771dafd7c9c7355b5fe29fdef42796ce7115057 (patch) | |
tree | 501a1125efda0a9ada68b8279aa38c374e8318eb | |
parent | aaa7aa983dbd54fe3c111acf7fd561900cdf5987 (diff) | |
download | org-mode-8771dafd7c9c7355b5fe29fdef42796ce7115057.tar.gz |
ox-koma-letter: Fix "to" and "from"
* contrib/lisp/ox-koma-letter.el (koma-letter): Properly display
default "from" address from template.
(org-koma-letter--determine-to-and-from): Do not provide a default
"to" value as it might be set through a LCO file.
(org-koma-letter-template): Remove trailing whitespace.
-rw-r--r-- | contrib/lisp/ox-koma-letter.el | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/contrib/lisp/ox-koma-letter.el b/contrib/lisp/ox-koma-letter.el index 32dd199..597aeb8 100644 --- a/contrib/lisp/ox-koma-letter.el +++ b/contrib/lisp/ox-koma-letter.el @@ -391,7 +391,7 @@ was not present." (:lco "LCO" nil org-koma-letter-class-option-file) (:author "AUTHOR" nil (org-koma-letter--get-value org-koma-letter-author) t) (:author-changed-in-buffer-p "AUTHOR" nil nil t) - (:from-address "FROM_ADDRESS" nil nil newline) + (:from-address "FROM_ADDRESS" nil org-koma-letter-from-address newline) (:phone-number "PHONE_NUMBER" nil org-koma-letter-phone-number) (:email "EMAIL" nil (org-koma-letter--get-value org-koma-letter-email) t) (:to-address "TO_ADDRESS" nil nil newline) @@ -504,15 +504,14 @@ KEY should be `to' or `from'. `ox-koma-letter' allows two ways to specify TO and FROM. If both are present return the preferred one as determined by `org-koma-letter-prefer-special-headings'." - (let ((option (plist-get info (if (eq key 'to) :to-address :from-address))) + (let ((option (org-string-nw-p + (plist-get info (if (eq key 'to) :to-address :from-address)))) (headline (org-koma-letter--get-tagged-contents key))) (replace-regexp-in-string "\n" "\\\\\\\\\n" (org-trim - (or (if (plist-get info :special-headings) (or headline option) - (or option headline)) - ;; Fallback values. - (if (eq key 'to) "\\mbox{}" org-koma-letter-from-address)))))) + (if (plist-get info :special-headings) (or headline option "") + (or option headline "")))))) @@ -618,7 +617,7 @@ holding export options." (org-koma-letter--build-settings 'buffer info) ;; From address. (let ((from-address (org-koma-letter--determine-to-and-from info 'from))) - (when (org-string-nw-p from-address) + (when (org-string-nw-p from-address) (format "\\setkomavar{fromaddress}{%s}\n" from-address))) ;; Date. (format "\\date{%s}\n" (org-export-data (org-export-get-date info) info)) |