From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: [patch][ox-koma-letter] set opening via headline Date: Sat, 17 Aug 2013 21:42:26 +0200 Message-ID: <8761v4umsd.fsf@gmail.com> References: <877gfk6s5f.fsf@gmx.us> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:57831) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VAmOB-0007Ul-2X for emacs-orgmode@gnu.org; Sat, 17 Aug 2013 15:42:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VAmO5-0006Aq-7s for emacs-orgmode@gnu.org; Sat, 17 Aug 2013 15:42:19 -0400 Received: from mail-wg0-x236.google.com ([2a00:1450:400c:c00::236]:52088) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VAmO5-0006Aj-1k for emacs-orgmode@gnu.org; Sat, 17 Aug 2013 15:42:13 -0400 Received: by mail-wg0-f54.google.com with SMTP id e12so2406551wgh.33 for ; Sat, 17 Aug 2013 12:42:12 -0700 (PDT) In-Reply-To: <877gfk6s5f.fsf@gmx.us> (rasmus@gmx.us's message of "Sat, 17 Aug 2013 21:20:28 +0200") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Rasmus Cc: alan.schmitt@polytechnique.org, emacs-orgmode@gnu.org Hello, Rasmus writes: > With the following patch one can set the opening via a headline. > Currently, it's pretty conservative and will only set opening if it > isn't set already. I'm open to discussion on that point. Here are some comments about its internals. > (defcustom org-koma-letter-opening nil > - "Letter's opening, as a string." > + "Letter's opening, as a string. If (1) this value is nil; (2) Please start a new line after the first sentence. > +(defcustom org-koma-letter-headline-is-opening-maybe t > + "Whether a headline may be used as an opening. A headline is Ditto. > + (unless (or (plist-get info :opening) > + (not org-koma-letter-headline-is-opening-maybe)) > + (plist-put info :opening (org-element-property :raw-value headline))) I suggest to use (org-export-data (org-element-property :title headline) info) instead, so you can correctly export Org syntax included in the headline, if any. Regards, -- Nicolas Goaziou