forked from mirrors/org-mode
ox-koma-letter: Changes to LOCATION handling
* ox-koma-letter.el (options): Parse LOCATION and remove :with-location and :inbuffer-with-location. (org-koma-letter--get-tagged-contents): Change string handling. (org-koma-letter--get-value): Simplify function. (org-koma-letter-use-location): remove
This commit is contained in:
parent
a0e942544c
commit
519f78d1a3
|
@ -376,13 +376,6 @@ This option can also be set with the OPTIONS keyword, e.g.:
|
||||||
:group 'org-export-koma-letter
|
:group 'org-export-koma-letter
|
||||||
:type 'boolean)
|
:type 'boolean)
|
||||||
|
|
||||||
(defcustom org-koma-letter-use-location t
|
|
||||||
"Non-nil prints the contents of the letter's extension below the header.
|
|
||||||
This option can also be set with the OPTIONS keyword, e.g.:
|
|
||||||
\"location:nil\"."
|
|
||||||
:group 'org-export-koma-letter
|
|
||||||
:type 'boolean)
|
|
||||||
|
|
||||||
(defcustom org-koma-letter-default-class "default-koma-letter"
|
(defcustom org-koma-letter-default-class "default-koma-letter"
|
||||||
"Default class for `org-koma-letter'.
|
"Default class for `org-koma-letter'.
|
||||||
The value must be a member of `org-latex-classes'."
|
The value must be a member of `org-latex-classes'."
|
||||||
|
@ -453,7 +446,6 @@ e.g. \"title-subject:t\"."
|
||||||
(:with-foldmarks nil "foldmarks" org-koma-letter-use-foldmarks)
|
(:with-foldmarks nil "foldmarks" org-koma-letter-use-foldmarks)
|
||||||
(:with-phone nil "phone" org-koma-letter-use-phone)
|
(:with-phone nil "phone" org-koma-letter-use-phone)
|
||||||
(:with-place nil "place" org-koma-letter-use-place)
|
(:with-place nil "place" org-koma-letter-use-place)
|
||||||
(:with-location nil "location" org-koma-letter-use-location)
|
|
||||||
(:with-subject nil "subject" org-koma-letter-subject-format)
|
(:with-subject nil "subject" org-koma-letter-subject-format)
|
||||||
(:with-title-as-subject nil "title-subject" org-koma-letter-prefer-subject)
|
(:with-title-as-subject nil "title-subject" org-koma-letter-prefer-subject)
|
||||||
(:with-headline-opening nil nil org-koma-letter-headline-is-opening-maybe)
|
(:with-headline-opening nil nil org-koma-letter-headline-is-opening-maybe)
|
||||||
|
@ -471,13 +463,12 @@ e.g. \"title-subject:t\"."
|
||||||
(:inbuffer-with-email nil "email" 'koma-letter:empty)
|
(:inbuffer-with-email nil "email" 'koma-letter:empty)
|
||||||
(:inbuffer-with-foldmarks nil "foldmarks" 'koma-letter:empty)
|
(:inbuffer-with-foldmarks nil "foldmarks" 'koma-letter:empty)
|
||||||
(:inbuffer-with-phone nil "phone" 'koma-letter:empty)
|
(:inbuffer-with-phone nil "phone" 'koma-letter:empty)
|
||||||
(:inbuffer-with-place nil "place" 'koma-letter:empty)
|
(:inbuffer-with-place nil "place" 'koma-letter:empty))
|
||||||
(:inbuffer-with-location nil "location" 'koma-letter:empty))
|
|
||||||
:translate-alist '((export-block . org-koma-letter-export-block)
|
:translate-alist '((export-block . org-koma-letter-export-block)
|
||||||
(export-snippet . org-koma-letter-export-snippet)
|
(export-snippet . org-koma-letter-export-snippet)
|
||||||
(headline . org-koma-letter-headline)
|
(headline . org-koma-letter-headline)
|
||||||
(keyword . org-koma-letter-keyword)
|
(keyword . org-koma-letter-keyword)
|
||||||
(template . org-koma-letter-template))
|
(template . org-koma-letter-template))
|
||||||
:menu-entry
|
:menu-entry
|
||||||
'(?k "Export with KOMA Scrlttr2"
|
'(?k "Export with KOMA Scrlttr2"
|
||||||
((?L "As LaTeX buffer" org-koma-letter-export-as-latex)
|
((?L "As LaTeX buffer" org-koma-letter-export-as-latex)
|
||||||
|
@ -767,42 +758,36 @@ a communication channel."
|
||||||
(format "\\KOMAoption{fromphone}{%s}\n"
|
(format "\\KOMAoption{fromphone}{%s}\n"
|
||||||
(if (plist-get info :with-phone) "true" "false")))
|
(if (plist-get info :with-phone) "true" "false")))
|
||||||
;; Signature.
|
;; Signature.
|
||||||
(let* ((head-opening (plist-get info :with-headline-opening))
|
(let* ((heading-val
|
||||||
(signature (funcall heading-or-key-value
|
(and (plist-get info :with-headline-opening)
|
||||||
(if head-opening 'closing nil)
|
(org-string-nw-p
|
||||||
:signature
|
(org-trim
|
||||||
(if head-opening 'signature nil))))
|
(org-export-data
|
||||||
(and signature
|
(org-koma-letter--get-tagged-contents 'closing)
|
||||||
(format "\\setkomavar{signature}{%s}\n" signature)))
|
info)))))
|
||||||
|
(signature (org-string-nw-p (plist-get info :signature)))
|
||||||
|
(signature-scope (funcall check-scope 'signature)))
|
||||||
|
(and (or (and signature signature-scope)
|
||||||
|
heading-val)
|
||||||
|
(not (and (eq scope 'global) heading-val))
|
||||||
|
(format "\\setkomavar{signature}{%s}\n"
|
||||||
|
(if signature-scope signature heading-val))))
|
||||||
;; Back address.
|
;; Back address.
|
||||||
(and (funcall check-scope 'with-backaddress)
|
(and (funcall check-scope 'with-backaddress)
|
||||||
(format "\\KOMAoption{backaddress}{%s}\n"
|
(format "\\KOMAoption{backaddress}{%s}\n"
|
||||||
(if (plist-get info :with-backaddress) "true" "false")))
|
(if (plist-get info :with-backaddress) "true" "false")))
|
||||||
;; Place.
|
;; Place.
|
||||||
(let ((place-scoped (funcall check-scope 'with-place))
|
(let ((with-place-set (funcall check-scope 'with-place))
|
||||||
(place-set (funcall check-scope 'place)))
|
(place-set (funcall check-scope 'place)))
|
||||||
(when (or (and place-scoped place-set)
|
(and (or (and with-place-set place-set)
|
||||||
(and (eq scope 'buffer)
|
(and (eq scope 'buffer) (or with-place-set place-set)))
|
||||||
(or place-scoped place-set)))
|
(format "\\setkomavar{place}{%s}\n"
|
||||||
(format "\\setkomavar{place}{%s}\n"
|
(if (plist-get info :with-place) (plist-get info :place)
|
||||||
(if (plist-get info :with-place) (plist-get info :place)
|
""))))
|
||||||
""))))
|
|
||||||
;; Location.
|
;; Location.
|
||||||
(let ((heading-val
|
(let ((location (funcall heading-or-key-value 'location :location)))
|
||||||
(org-koma-letter--add-latex-newlines
|
(and location
|
||||||
(org-export-data
|
(format "\\setkomavar{location}{%s}\n" location)))
|
||||||
(org-koma-letter--get-tagged-contents 'location)
|
|
||||||
info)))
|
|
||||||
(with-location-set (funcall check-scope 'with-location))
|
|
||||||
(location-set (funcall check-scope 'location))
|
|
||||||
(location (plist-get info :location)))
|
|
||||||
(when (or (and with-location-set (or location-set heading-val))
|
|
||||||
(and (eq scope 'buffer) (or with-location-set location-set heading-val)))
|
|
||||||
(format "\\setkomavar{location}{%s}\n"
|
|
||||||
(if (plist-get info :with-location)
|
|
||||||
(if (plist-get info :special-headings) (or heading-val location "")
|
|
||||||
(or heading-val location ""))
|
|
||||||
""))))
|
|
||||||
;; Folding marks.
|
;; Folding marks.
|
||||||
(and (funcall check-scope 'with-foldmarks)
|
(and (funcall check-scope 'with-foldmarks)
|
||||||
(let ((foldmarks (plist-get info :with-foldmarks)))
|
(let ((foldmarks (plist-get info :with-foldmarks)))
|
||||||
|
|
Loading…
Reference in New Issue