Improved employer/location handling in letters

- Default employee to empty string (was otherwise showing up a "nil").
- In \recipient, insert the linebreak only if both employer and location
  are not empty.
This commit is contained in:
Diego Zamboni 2021-03-20 21:00:55 +01:00
parent 32beb20aea
commit 2e9d4bc857

View file

@ -240,7 +240,7 @@ as a communication channel."
(org-element-property :SCHOOL headline) (org-element-property :SCHOOL headline)
(org-element-property :EMPLOYER headline) (org-element-property :EMPLOYER headline)
(org-element-property :EVENT headline) (org-element-property :EVENT headline)
(org-element-property :POSITION headline))) (org-element-property :POSITION headline) ""))
(location (or (org-element-property :LOCATION headline) "")) (location (or (org-element-property :LOCATION headline) ""))
(right-img (org-element-property :RIGHT_IMG headline)) (right-img (org-element-property :RIGHT_IMG headline))
(label (or (org-element-property :LABEL headline) nil)) (label (or (org-element-property :LABEL headline) nil))
@ -295,9 +295,10 @@ as a communication channel."
(org-cv-utils--format-time-window from-date to-date))) (org-cv-utils--format-time-window from-date to-date)))
;; Coverletter sections ;; Coverletter sections
((string= entrytype "letterheader") ((string= entrytype "letterheader")
(format "\\recipient\n {%s}\n {%s\\\\%s}\n\n%s\n%s\n%s\n%s\n" (format "\\recipient\n {%s}\n {%s%s%s}\n\n%s\n%s\n%s\n%s\n"
recipient recipient
employer employer
(if (and employer location) "\\\\" "")
location location
letter-date letter-date
letter-opening letter-opening