From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alan Schmitt Subject: Re: [PATCH][ox-koma-letter] changed-in-buffer, subject, minor fixes Date: Tue, 04 Feb 2014 14:23:17 +0100 Message-ID: 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> <877g9nvh6j.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:44839) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WAfyW-0007z6-3v for emacs-orgmode@gnu.org; Tue, 04 Feb 2014 08:23:46 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WAfyJ-0004UF-Hl for emacs-orgmode@gnu.org; Tue, 04 Feb 2014 08:23:40 -0500 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:53056) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WAfyJ-0004Tx-Ay for emacs-orgmode@gnu.org; Tue, 04 Feb 2014 08:23:27 -0500 In-Reply-To: <877g9nvh6j.fsf@gmail.com> (Nicolas Goaziou's message of "Sat, 25 Jan 2014 23:18:44 +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: Nicolas Goaziou Cc: emacs-orgmode@gnu.org, Rasmus Hello, Sorry for not replying earlier, I've been swamped by traveling and work. Nicolas Goaziou writes: > 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")))))) Rasmus: do you want to change these, or should I do it and apply the patch? (The former would be simpler, I have to say.) Thanks, Alan