From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rasmus Pank Roulund Subject: Re: [PATCH][ox-koma-letter] changed-in-buffer, subject, minor fixes Date: Tue, 04 Feb 2014 18:21:02 +0100 Message-ID: <87mwi6x08x.fsf@pank.eu> 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; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:34141) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WAk9P-0005vl-VH for emacs-orgmode@gnu.org; Tue, 04 Feb 2014 12:51:55 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WAjey-00083T-L4 for emacs-orgmode@gnu.org; Tue, 04 Feb 2014 12:24:32 -0500 Received: from eumx.net ([91.82.101.43]:37737 helo=owm.eumx.net) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WAjey-00083F-EC for emacs-orgmode@gnu.org; Tue, 04 Feb 2014 12:19:44 -0500 In-Reply-To: (Alan Schmitt's message of "Tue, 04 Feb 2014 14:23:17 +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: alan.schmitt@polytechnique.org Cc: emacs-orgmode@gnu.org, n.goaziou@gmail.com >>> 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 mi= ssing. >>> + >>> +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) inf= o)))) >> >> `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.) Yes, but I didn't manged to do it in the weekend. I'll try to find time during the week. My apology.=20 =E2=80=93Rasmus --=20 When the facts change, I change my mind. What do you do, sir?