From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alan Schmitt Subject: Re: koma letter exporter: changing the priority of options Date: Fri, 19 Jul 2013 15:01:57 +0200 Message-ID: References: <20130609180059.GA2104@kenny.local> <874nd6we8q.fsf@pank.eu> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:42874) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V0AJt-0007dx-ST for emacs-orgmode@gnu.org; Fri, 19 Jul 2013 09:02:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V0AJr-0001YO-NH for emacs-orgmode@gnu.org; Fri, 19 Jul 2013 09:02:01 -0400 Received: from mail3-relais-sop.national.inria.fr ([192.134.164.104]:54823) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V0AJr-0001Xu-HY for emacs-orgmode@gnu.org; Fri, 19 Jul 2013 09:01:59 -0400 In-reply-to: <874nd6we8q.fsf@pank.eu> 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: Rasmus Cc: emacs-orgmode@gnu.org Hello, rasmus@gmx.us writes: > Viktor Rosenfeld writes: > >>> ,---- >>> | \KOMAoption{backaddress}{true} >>> | \KOMAoption{foldmarks}{true} >>> | \KOMAoption{fromphone}{true} >>> | \KOMAoption{fromemail}{true} >>> `---- >> >> Perhaps the best option would be to change the default value of these >> variables to nil? We have almost every option that personalizes >> a letter, e.g., opening and closing, set to nil already. The only >> benefit of having default values is to show off the features of >> org-koma-letter. But it seems to be interfering with people's workflow >> so best turn them off. > > Doesn't this also more or less correspond to the default value of > scrlttr2? If so there's no reason to add it to the tex file and nil > is indeed a better default. It took me a while to look at this (basically until I had to write another letter), but here is a patch I propose to commit to do this. --8<---------------cut here---------------start------------->8--- diff --git a/contrib/lisp/ox-koma-letter.el b/contrib/lisp/ox-koma-letter.el index 44626a9..8a98689 100644 --- a/contrib/lisp/ox-koma-letter.el +++ b/contrib/lisp/ox-koma-letter.el @@ -228,7 +228,7 @@ English manual of 2012-07-22)" -(defcustom org-koma-letter-use-backaddress t +(defcustom org-koma-letter-use-backaddress nil "Print return address in small line above to address." :group 'org-export-koma-letter :type 'boolean) @@ -243,12 +243,12 @@ Use `foldmarks:true' to activate default fold marks or :group 'org-export-koma-letter :type 'string) -(defcustom org-koma-letter-use-phone t +(defcustom org-koma-letter-use-phone nil "Print sender's phone number." :group 'org-export-koma-letter :type 'boolean) -(defcustom org-koma-letter-use-email t +(defcustom org-koma-letter-use-email nil "Print sender's email address." :group 'org-export-koma-letter :type 'boolean) @@ -554,10 +554,10 @@ holding export options." (with-phone (plist-get info :with-phone)) (with-email (plist-get info :with-email))) (concat - (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") ""))) ;; Document start "\\begin{document}\n\n" ;; Subject --8<---------------cut here---------------end--------------->8--- 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? Alan