Nicolas Goaziou writes: > However, I don't think :opening setting belongs to > `org-koma-letter-headline', as it means it is potentially set each time > a headline is being processed. The property is at most set once cf. the second clause. > The (when ...) could be moved within `org-koma-letter-template', where > "\opening{...}" is filled and the first headline without a special tag > in the parse tree could be used (assuming there's no special > keyword...). That headline can be found using `org-element-map'. Yes. Less ugly. > Another (smallish) advantage is that the following case would be > allowed: > > ***** Dear myself, > * Part 1 Is the advantage that it won't fold? > WDYT? The current stuff is ugly. I didn't know much lisp when I worked on ox-koma-letter. I updated the patch. Perhaps the loop determination shod be moved to a separate function to keep the template clean. I thinking this cause we (or at least I) sometimes point to ox-koma-letter as an example of a derived backend. WDTY on that? In the attached at least this work as expected. *** ps :ps: *** dear you, * part 1 —Rasmus -- Send from my Emacs