From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: [PATCH][ox-koma-letter] changed-in-buffer, subject, minor fixes Date: Sat, 25 Jan 2014 23:18:44 +0100 Message-ID: <877g9nvh6j.fsf@gmail.com> References: <87txf1xrnr.fsf@gmx.us> <8761ph8e38.fsf@gmx.us> <87ppnpuuuf.fsf@gmail.com> <871u058502.fsf@gmx.us> <878uudukcs.fsf@gmail.com> <87bnz0jhv3.fsf@gmx.us> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:35783) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W7BYb-0007Em-G4 for emacs-orgmode@gnu.org; Sat, 25 Jan 2014 17:18:35 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W7BYV-0002AL-Hs for emacs-orgmode@gnu.org; Sat, 25 Jan 2014 17:18:29 -0500 Received: from mail-wg0-x231.google.com ([2a00:1450:400c:c00::231]:52803) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W7BYV-0002AH-Ag for emacs-orgmode@gnu.org; Sat, 25 Jan 2014 17:18:23 -0500 Received: by mail-wg0-f49.google.com with SMTP id a1so4192080wgh.28 for ; Sat, 25 Jan 2014 14:18:22 -0800 (PST) In-Reply-To: <87bnz0jhv3.fsf@gmx.us> (rasmus@gmx.us's message of "Sat, 25 Jan 2014 14:44:48 +0100") 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: > Would you give the attached patches a spin? I think they work nicely; > only the second patch is non-trivial. Basically, one can ignore > subject and title differences as now by setting > org-koma-letter-prefer-subject to t and not use the SUBJECT keyword. > > I have set the default of -prefer-subject to nil per the discussion > with Alan and Michael Strey. > > It should apply against master. It looks good. Thank you. A few minor remarks below. > +(defcustom org-koma-letter-use-title t > + "Non-nil means use a title in the letter if present. > + > +See also `org-koma-letter-prefer-subject' for the handling of > +title versus subject." > + :group 'org-export-koma-letter > + :type 'boolean) You should also talk about the OPTIONS item, i.e., "title:nil", as in other defcustoms. > +(defcustom org-koma-letter-prefer-subject nil > + "Non-nil means title should be interpret as subject if subject is missing. > + > +This may be useful for older documents where the SUBJECT keyword > +was not present." > + :group 'org-export-koma-letter > + :type 'boolean) Ditto. > - ;; Subject > - (let ((with-subject (plist-get info :with-subject))) > + ;; Subject and title > + (let ((with-subject (plist-get info :with-subject)) > + (title-as-subject (plist-get info :with-title-as-subject)) > + (subject (org-string-nw-p (org-export-data (plist-get info :subject) info))) > + (title (org-string-nw-p (org-export-data (plist-get info :title) info)))) `title-as-subject', `subject' and `title' belong to the `let' below, not this one. > (when with-subject > (concat > (unless (eq with-subject t) > (format "\\KOMAoption{subject}{%s}\n" > (if (symbolp with-subject) with-subject > (mapconcat #'symbol-name with-subject ",")))) > - (let ((subject (org-export-data (plist-get info :title) info))) > - (and (org-string-nw-p subject) > - (format "\\setkomavar{subject}{%s}\n\n" subject)))))) > + (let ((subject (if title-as-subject (or subject title) subject)) > + (title (if title-as-subject (and subject title) title))) > + (concat > + (and (org-string-nw-p subject) > + (format "\\setkomavar{subject}{%s}\n" subject)) > + (and (org-string-nw-p title) > + (format "\\setkomavar{title}{%s}\n" title)) > + (when (or (org-string-nw-p title) (org-string-nw-p subject)) "\n")))))) Regards, -- Nicolas Goaziou