summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Goaziou <n.goaziou@gmail.com>2014-01-17 22:52:37 +0100
committerNicolas Goaziou <n.goaziou@gmail.com>2014-01-17 22:55:02 +0100
commit161eb78d0656712a8539f359907844bc81775dab (patch)
tree4c0d5aa1fc7f3c0a0010e1f4aafde9a9472e222b
parentbec2bc6744149a6fd4ac746e9e69e7beb8dc538d (diff)
downloadorg-mode-161eb78d0656712a8539f359907844bc81775dab.tar.gz
ox-koma-letter: Fix opening setting
* contrib/lisp/ox-koma-letter.el (org-koma-letter-opening): Correctly report conditions to fulfill in order set opening string with a headline. (org-koma-letter-headline): Opening can no longer be nil, so look out for the empty string instead.
-rw-r--r--contrib/lisp/ox-koma-letter.el14
1 files changed, 10 insertions, 4 deletions
diff --git a/contrib/lisp/ox-koma-letter.el b/contrib/lisp/ox-koma-letter.el
index 2fd205d..de29787 100644
--- a/contrib/lisp/ox-koma-letter.el
+++ b/contrib/lisp/ox-koma-letter.el
@@ -173,9 +173,15 @@ a function may be given. Functions must return a string."
(defcustom org-koma-letter-opening ""
"Letter's opening, as a string.
-If (1) this value is nil; (2) the letter is started with a
-headline; and (3) `org-koma-letter-headline-is-opening-maybe' is
-t the value opening will be implicit set as the headline title."
+
+This option can also be set with the OPENING keyword. Moreover,
+when:
+ (1) this value is the empty string;
+ (2) there's no OPENING keyword or it is empty;
+ (3) `org-koma-letter-headline-is-opening-maybe' is non-nil;
+ (4) the letter contains a headline without a special
+ tag (e.g. \"to\" or \"ps\");
+then the opening will be implicitly set as the headline title."
:group 'org-export-koma-letter
:type 'string)
@@ -509,7 +515,7 @@ appropriate place."
(push (cons tag contents) org-koma-letter-special-contents)))
;; Opening is not defined yet: use headline's title.
(when (and org-koma-letter-headline-is-opening-maybe
- (not (plist-get info :opening)))
+ (not (org-string-nw-p (plist-get info :opening))))
(plist-put info :opening
(org-export-data (org-element-property :title headline) info)))
;; In any case, insert contents in letter's body.