ox-koma-letter: Fix a variable type
* contrib/lisp/ox-koma-letter.el (org-koma-letter-subject-format): Make it clear that lists of symbols are allowed. (org-koma-letter-template): Refactor subject-related part.
This commit is contained in:
parent
7d67c448c9
commit
c174bf2a5c
|
@ -198,7 +198,9 @@ t the value opening will be implicit set as the headline title."
|
||||||
(defcustom org-koma-letter-subject-format t
|
(defcustom org-koma-letter-subject-format t
|
||||||
"Use the title as the subject of the letter.
|
"Use the title as the subject of the letter.
|
||||||
|
|
||||||
At this time the following values are allowed:
|
When t, insert a subject using default options. When nil, do not
|
||||||
|
insert a subject at all. It can also be a list of symbols among
|
||||||
|
the following ones:
|
||||||
|
|
||||||
`afteropening' Subject after opening
|
`afteropening' Subject after opening
|
||||||
`beforeopening' Subject before opening
|
`beforeopening' Subject before opening
|
||||||
|
@ -208,15 +210,16 @@ At this time the following values are allowed:
|
||||||
`titled' Add title/description to subject
|
`titled' Add title/description to subject
|
||||||
`underlined' Set subject underlined
|
`underlined' Set subject underlined
|
||||||
`untitled' Do not add title/description to subject
|
`untitled' Do not add title/description to subject
|
||||||
nil Do no insert a subject even if present
|
|
||||||
t Use default options
|
|
||||||
|
|
||||||
Please refer to the KOMA-script manual (Table 4.16. in the
|
Please refer to the KOMA-script manual (Table 4.16. in the
|
||||||
English manual of 2012-07-22)."
|
English manual of 2012-07-22).
|
||||||
|
|
||||||
|
This option can also be set with the OPTIONS keyword, e.g.:
|
||||||
|
\"subject:(underlined centered)\"."
|
||||||
:type '(radio
|
:type '(radio
|
||||||
(const :tag "No export" nil)
|
(const :tag "No export" nil)
|
||||||
(const :tag "Default options" t)
|
(const :tag "Default options" t)
|
||||||
(set :tag "selection"
|
(set :tag "Selection"
|
||||||
(const afteropening)
|
(const afteropening)
|
||||||
(const beforeopening)
|
(const beforeopening)
|
||||||
(const centered)
|
(const centered)
|
||||||
|
@ -571,25 +574,16 @@ holding export options."
|
||||||
;; Document start
|
;; Document start
|
||||||
"\\begin{document}\n\n"
|
"\\begin{document}\n\n"
|
||||||
;; Subject
|
;; Subject
|
||||||
(let* ((with-subject (plist-get info :with-subject))
|
(let ((with-subject (plist-get info :with-subject)))
|
||||||
(subject-format (cond ((member with-subject '("true" "t" t)) nil)
|
(when with-subject
|
||||||
((stringp with-subject) (list with-subject))
|
|
||||||
((symbolp with-subject)
|
|
||||||
(list (symbol-name with-subject)))
|
|
||||||
(t with-subject)))
|
|
||||||
(subject (org-export-data (plist-get info :title) info))
|
|
||||||
(l (length subject-format))
|
|
||||||
(y ""))
|
|
||||||
(concat
|
(concat
|
||||||
(when (and with-subject subject-format)
|
(unless (eq with-subject t)
|
||||||
(concat
|
(format "\\KOMAoption{subject}{%s}\n"
|
||||||
"\\KOMAoption{subject}{"
|
(if (symbolp with-subject) with-subject
|
||||||
(apply 'format
|
(mapconcat #'symbol-name with-subject ","))))
|
||||||
(dotimes (x l y)
|
(let ((subject (org-export-data (plist-get info :title) info)))
|
||||||
(setq y (concat (if (> x 0) "%s," "%s") y)))
|
(and (org-string-nw-p subject)
|
||||||
subject-format) "}\n"))
|
(format "\\setkomavar{subject}{%s}\n\n" subject))))))
|
||||||
(when (and subject with-subject)
|
|
||||||
(format "\\setkomavar{subject}{%s}\n\n" subject))))
|
|
||||||
;; Letter start.
|
;; Letter start.
|
||||||
(format "\\begin{letter}{%%\n%s}\n\n"
|
(format "\\begin{letter}{%%\n%s}\n\n"
|
||||||
(org-koma-letter--determine-to-and-from info 'to))
|
(org-koma-letter--determine-to-and-from info 'to))
|
||||||
|
|
Loading…
Reference in New Issue