From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rasmus Subject: Re: koma letter exporter: changing the priority of options Date: Wed, 28 Aug 2013 14:06:47 +0200 Message-ID: <87mwo2qaso.fsf@gmx.us> References: <20130609180059.GA2104@kenny.local> <874nd6we8q.fsf@pank.eu> <20130720115503.GA67549@kenny.local> <87eh9s46kx.fsf@pank.eu> <87vc34dvyo.fsf@gmx.us> <87zjs2qcn7.fsf@gmx.us> 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]:47201) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VEeWW-0001x6-Dx for emacs-orgmode@gnu.org; Wed, 28 Aug 2013 08:07:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VEeWR-0000MA-3z for emacs-orgmode@gnu.org; Wed, 28 Aug 2013 08:06:56 -0400 Received: from mout.gmx.net ([212.227.17.22]:49814) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VEeWQ-0000M4-PX for emacs-orgmode@gnu.org; Wed, 28 Aug 2013 08:06:51 -0400 Received: from pank ([87.57.37.13]) by mail.gmx.com (mrgmx103) with ESMTPSA (Nemesis) id 0LyEUz-1W8FDg1RR7-015aV4 for ; Wed, 28 Aug 2013 14:06:49 +0200 In-Reply-To: (Alan Schmitt's message of "Wed, 28 Aug 2013 13:43:32 +0200") 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 Alan Schmitt 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.=20=20 > > 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.=20 #+LCO: test * my letter text produces=20 [...] \setkomavar{fromemail}{rasmus@gmx.us} \LoadLetterOption{test} [...] which may or may not produce result in rasmus@gmx.us being printed depending on what test.lco contains. On the other hand=20 #+EMAIL: rasmus@gmx.us #+LCO: test * my letter text triggers and updatedp variable (how to automate this I'd have to think about) and [...] \LoadLetterOption{test} \setkomavar{fromemail}{rasmus@gmx.us} [...] Is this not what you want? =E2=80=93Rasmus --=20 =E3=83=84