[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] [PATCH][ox-koma-letter] changed-in-buffer, subject, minor fixes
From: |
Alan Schmitt |
Subject: |
Re: [O] [PATCH][ox-koma-letter] changed-in-buffer, subject, minor fixes |
Date: |
Tue, 04 Feb 2014 14:23:17 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3 (darwin) |
Hello,
Sorry for not replying earlier, I've been swamped by traveling and work.
Nicolas Goaziou <address@hidden> writes:
> Hello,
>
> Rasmus <address@hidden> 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
- Re: [O] [PATCH][ox-koma-letter] changed-in-buffer, subject, minor fixes,
Alan Schmitt <=
- Re: [O] [PATCH][ox-koma-letter] changed-in-buffer, subject, minor fixes, Rasmus Pank Roulund, 2014/02/04
- Re: [O] [PATCH][ox-koma-letter] changed-in-buffer, subject, minor fixes, Rasmus, 2014/02/04
- Re: [O] [PATCH][ox-koma-letter] changed-in-buffer, subject, minor fixes, Rasmus, 2014/02/04
- Re: [O] [PATCH][ox-koma-letter] changed-in-buffer, subject, minor fixes, Nicolas Goaziou, 2014/02/05
- Re: [O] [PATCH][ox-koma-letter] changed-in-buffer, subject, minor fixes, Bastien, 2014/02/05
- Re: [O] [PATCH][ox-koma-letter] changed-in-buffer, subject, minor fixes, Alan Schmitt, 2014/02/05