Function: org-koma-letter--keyword-or-headline
org-koma-letter--keyword-or-headline is a byte-compiled function
defined in ox-koma-letter.el.gz.
Signature
(org-koma-letter--keyword-or-headline PLIST-KEY PRED INFO)
Documentation
Return the correct version of opening or closing.
PLIST-KEY should be a key in info, typically :opening or :closing. PRED is a predicate run on headline to determine which title to use which takes two arguments, a headline element and an info plist. INFO is a plist holding contextual information. Return the preferred candidate for the exported of PLIST-KEY.
Source Code
;; Defined in /usr/src/emacs/lisp/org/ox-koma-letter.el.gz
(defun org-koma-letter--keyword-or-headline (plist-key pred info)
"Return the correct version of opening or closing.
PLIST-KEY should be a key in info, typically :opening
or :closing. PRED is a predicate run on headline to determine
which title to use which takes two arguments, a headline element
and an info plist. INFO is a plist holding contextual
information. Return the preferred candidate for the exported of
PLIST-KEY."
(let* ((keyword-candidate (plist-get info plist-key))
(headline-candidate (when (and (plist-get info :with-headline-opening)
(or (plist-get info :special-headings)
(not keyword-candidate)))
(org-element-map (plist-get info :parse-tree)
'headline
(lambda (h)
(and (funcall pred h info)
(org-element-property :title h)))
info t))))
(org-export-data (or headline-candidate keyword-candidate "") info)))