emacs-orgmode
[Top][All Lists]
Advanced

[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: Rasmus Pank Roulund
Subject: Re: [O] [PATCH][ox-koma-letter] changed-in-buffer, subject, minor fixes
Date: Tue, 04 Feb 2014 18:21:02 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

>>> 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.)

Yes, but I didn't manged to do it in the weekend.  I'll try to find
time during the week.  My apology. 

–Rasmus

-- 
When the facts change, I change my mind. What do you do, sir?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]