From: Rasmus Pank Roulund <rasmus@gmx.us>
To: alan.schmitt@polytechnique.org
Cc: emacs-orgmode@gnu.org, n.goaziou@gmail.com
Subject: Re: [PATCH][ox-koma-letter] changed-in-buffer, subject, minor fixes
Date: Tue, 04 Feb 2014 18:21:02 +0100 [thread overview]
Message-ID: <87mwi6x08x.fsf@pank.eu> (raw)
In-Reply-To: <m2lhxrc8qi.fsf@polytechnique.org> (Alan Schmitt's message of "Tue, 04 Feb 2014 14:23:17 +0100")
>>> 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?
next prev parent reply other threads:[~2014-02-04 17:51 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-25 0:15 [PATCH][ox-koma-letter] changed-in-buffer, subject, minor fixes Rasmus
2013-11-25 9:20 ` Michael Strey
[not found] ` <m2zjop3cgt.fsf@polytechnique.org>
2014-01-18 16:11 ` Rasmus
2014-01-18 16:18 ` Nicolas Goaziou
2014-01-18 19:27 ` Rasmus
2014-01-18 20:05 ` Nicolas Goaziou
2014-01-25 13:44 ` Rasmus
2014-01-25 22:18 ` Nicolas Goaziou
2014-02-04 13:23 ` Alan Schmitt
2014-02-04 17:21 ` Rasmus Pank Roulund [this message]
2014-02-05 1:12 ` Rasmus
2014-02-05 12:40 ` Alan Schmitt
2014-02-05 12:42 ` Alan Schmitt
2014-02-05 12:48 ` Alan Schmitt
2014-02-05 2:02 ` Rasmus
2014-02-05 7:46 ` Nicolas Goaziou
2014-02-05 9:55 ` Rasmus
2014-02-05 7:48 ` Bastien
2014-02-05 7:59 ` Alan Schmitt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87mwi6x08x.fsf@pank.eu \
--to=rasmus@gmx.us \
--cc=alan.schmitt@polytechnique.org \
--cc=emacs-orgmode@gnu.org \
--cc=n.goaziou@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).