Nicolas Goaziou writes: >> I updated the patch. Perhaps the loop determination shod be moved to a >> separate function to keep the template clean. > > Yes, it needs to be factored out (maybe > `org-koma-letter--special-headline-p') since it is also used in > `org-koma-letter-headline'. What about > > (defun org-koma-letter--special-headline-p (h info) > (let ((special-tags (plist-get info :special-tags))) > (org-some (lambda (tag) (assoc-string tag special-tags)) > (org-export-get-tags h info)))) That's nice. I had forgotten about org-export-get-tags. >> + (:with-headline-opening nil nil >> org-koma-letter-headline-is-opening-maybe) > > I don't think this line is required. It feels more consistent to provide the check through the definition, but I'm not willing to pick a fight over this so it's back to just checking the variable. I have only tested the patch briefly as I need to actually produce a letter. But for the letter I'm writing export works fine. —Rasmus -- To err is human. To screw up 10⁶ times per second, you need a computer