From mboxrd@z Thu Jan 1 00:00:00 1970 From: Viktor Rosenfeld Subject: Re: koma letter exporter: changing the priority of options Date: Sat, 20 Jul 2013 13:55:03 +0200 Message-ID: <20130720115503.GA67549@kenny.local> References: <20130609180059.GA2104@kenny.local> <874nd6we8q.fsf@pank.eu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:42170) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V0Vkl-0000Ro-A0 for emacs-orgmode@gnu.org; Sat, 20 Jul 2013 07:55:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V0Vkk-00056d-45 for emacs-orgmode@gnu.org; Sat, 20 Jul 2013 07:55:11 -0400 Received: from mail-ea0-x233.google.com ([2a00:1450:4013:c01::233]:63468) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V0Vkj-00054k-Tx for emacs-orgmode@gnu.org; Sat, 20 Jul 2013 07:55:10 -0400 Received: by mail-ea0-f179.google.com with SMTP id b15so2841468eae.38 for ; Sat, 20 Jul 2013 04:55:08 -0700 (PDT) Content-Disposition: inline In-Reply-To: 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 Cc: emacs-orgmode@gnu.org, Rasmus Hi, Alan Schmitt wrote: > - (format "\\KOMAoption{backaddress}{%s}\n" (if with-backaddress "true" "false")) > - (format "\\KOMAoption{foldmarks}{%s}\n" (if with-foldmarks with-foldmarks "false")) > - (format "\\KOMAoption{fromphone}{%s}\n" (if with-phone "true" "false")) > - (format "\\KOMAoption{fromemail}{%s}\n" (if with-email "true" "false")))) > + (if with-backaddress (format "\\KOMAoption{backaddress}{true}\n") "") > + (if (not (equal with-foldmarks "true")) (format "\\KOMAoption{foldmarks}{%s}\n" with-foldmarks) "") > + (if with-phone (format "\\KOMAoption{fromphone}{true}\n") "") > + (if with-email (format "\\KOMAoption{fromemail}{true}\n") ""))) If I read the patch correctly then the consequence is that you cannot configure your LCO file to set defaults for these values and inhibit them in specific letters by setting the corresponding option to nil. For example, in my LCO file I enable all of these options but sometimes I don't want to have foldmarks or a backaddress or whatever. So I can write #+OPTIONS: backaddress:nil and it is supressed. The patch changes that. > I did some experiments and it seems that by default "foldmarks" is > true. The idea behind the patch is that, if we don't change the default > values, then things are not output. Let me know if this is fine with you > and I'll commit this. (I'll also edit the work with the new default > values.) > > I still have an issue with the default value for email. I have set-up my > email address in emacs, and it's picked up by the koma exporter. I want > to use a different address in my work letters (which use a custom lco > file), but the email address is overridden by the one picked up by the > following function: > > (defun org-koma-letter-email () > "Return the current `user-mail-address'" > user-mail-address) > > What I propose is the following: > - we leave the default AUTHOR and EMAIL at nil > - if they are still nil, we output the default values _before_ inputting > the lco file > - if they are no longer nil, we output their values _after_ inputting > the lco file > > This way, if they are not defined in the file, then the lco can override > them, otherwise the local option will be the one used. > > What do you think? Seems fine by me. Cheers, Viktor > > Alan >