From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rasmus Subject: Re: [PATCH] ox-koma-letter.el: Reintroduce variables removed in commit 832c6fd with proper defaults (was Re: [patch] ox-koma-letter.el: clean-up/semantic bug [4/4]) Date: Sat, 25 May 2013 15:57:13 +0200 Message-ID: <87hahrmabq.fsf@pank.eu> References: <87wqqsd7p8.fsf@pank.eu> <874ndwcyjx.fsf@pank.eu> <20130521170259.GB56408@client199-78.wlan.hu-berlin.de> <87ehd09p6r.fsf@pank.eu> <20130521195413.GA58739@kenny.local> <87vc6b9atm.fsf@pank.eu> <20130522143923.GA61443@kenny.local> <20130522220650.GB68001@kenny.local> <51A0487D.4020809@mpip-mainz.mpg.de> <20130525080554.GA590@kenny.local> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([208.118.235.92]:34784) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UgEya-0006eJ-TQ for emacs-orgmode@gnu.org; Sat, 25 May 2013 09:57:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UgEyU-00034s-AJ for emacs-orgmode@gnu.org; Sat, 25 May 2013 09:57:40 -0400 Received: from plane.gmane.org ([80.91.229.3]:37792) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UgEyU-00034m-3c for emacs-orgmode@gnu.org; Sat, 25 May 2013 09:57:34 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1UgEyN-0008Nt-FD for emacs-orgmode@gnu.org; Sat, 25 May 2013 15:57:27 +0200 Received: from dynamic-adsl-94-39-217-165.clienti.tiscali.it ([94.39.217.165]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 25 May 2013 15:57:27 +0200 Received: from rasmus by dynamic-adsl-94-39-217-165.clienti.tiscali.it with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 25 May 2013 15:57:27 +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: emacs-orgmode@gnu.org Alan Schmitt writes: > Hello, > > Viktor Rosenfeld writes: > >> Hi Robert, >> >> Robert Klein wrote: >> >>> Hi, >>> >>> FWIW, from a users view it would be nice if: >>> >>> - Use Author/Email information from org file >>> - If not present use information from LCO file >>> - if neither org file nor LCO file has any information use >>> user-full-name and user-email-address >>> >>> Could this be solved by having several e.g. `setkomavar{fromname}' >>> and so on in the tex file, so is created as follows: I'd go with 'no'. It's not aesthetically pleasing and I don't want my output to look like LyX. When feasible we should go for beautiful output. This isn't always the case at the moment, but still. >>> if no #+AUTHOR in org-file and user-full-name is set: >>> add user-full-name >>> if #+LCO(s) in org-file: >>> add LCO file(s) >>> if #+AUTHOR in org-file: >>> add \setkomavar{fromname}{#+AUTHOR} >>> .... same for email Currently the ordering is: #+AUTHOR > #+LCO and AUTHOR default to (user-full-name). On a side-note, Viktor: this seems to be the default in scrletter anyway: >>> add \setkomavar{signature}{\usekomavar{fromname}} Could we remove it? I'd like us to get to a more clean template (C-e # koma-letter RET). >> This is what is implemented by the latest patch >> (http://thread.gmane.org/gmane.emacs.orgmode/72430/focus=72525). > > I'm waiting for Rasmus's confirmation that it works for him before > committing it. Thanks and sorry for the wait. No it didn't work for me. My user name was always overwritten by "". . . I couldn't figure out why. I've attached a patch that work for me (it goes on top of Viktor's patch 148c737ae79f3a98d8e93147c2d0ec0db3a2389a). It allows for nil and it gets up-to-date default values by default. In my book it's a bit more clean 'cause it doesn't rely on hooks. It does, introduce a new helper function to distinguish between a function value (which are default for the two variables) and a string value (and nil for that matter). I don't know if this is undesirable. It would crash if you set the variables to a symbol that isn't nil and isn't a function. It seems to work in mine and Viktor's use-case (to the best of my testing ability). –Rasmus -- ⠠⠵