[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] koma letter exporter: changing the priority of options
From: |
Rasmus |
Subject: |
Re: [O] koma letter exporter: changing the priority of options |
Date: |
Wed, 28 Aug 2013 14:06:47 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) |
Alan Schmitt <address@hidden> writes:
>>> I could not find a way to do it another way, but I'll gladly take any
>>> suggestion. What we want is:
>>> - if email is set in the file, use it;
>>> - otherwise, use the one from the lco;
>>> - otherwise, use the default one.
>>
>> (PREAMBLE-STRING DEFAULT-VALUES LCO BUFFER-LOCAL)
>>
>> where a member of DEFAULT-VALUES is a cons, e.g.
>>
>> ("fromname" . "Rasmus").
>>
>> Then we can remove all pairs from DEFAULT-VALUES where the first first
>> element (the "key") also exists in BUFFER-LOCAL.
>
> This could be a way to do it. However, I don't know how to detect the
> variables in the LCO file, which is why they may be duplicated in the
> tex file.
As Viktor argues, mainly ugly and fragile solutions exist to check the
LCO file (e.g. find the file with kpsewhich in texlive). Yet, it
doesn't matter, as all you care about it the location of the variable
/depending/ on whether it's set in the buffer.
E.g.
#+LCO: test
* my letter
text
produces
[...]
address@hidden
\LoadLetterOption{test}
[...]
which may or may not produce result in address@hidden being printed
depending on what test.lco contains.
On the other hand
#+EMAIL: address@hidden
#+LCO: test
* my letter
text
triggers and updatedp variable (how to automate this I'd have to think
about) and
[...]
\LoadLetterOption{test}
address@hidden
[...]
Is this not what you want?
–Rasmus
--
ツ