From mboxrd@z Thu Jan 1 00:00:00 1970 From: Myles English Subject: Re: [PATCH] ox-koma-letter.el: Add support for 'location' koma variable Date: Thu, 28 Jan 2016 22:00:57 +0000 Message-ID: <87a8npgy92.fsf@gmail.com> References: <87egd2ho08.fsf@gmail.com> <87vb6eekzj.fsf@gmx.us> <87d1smgdcw.fsf@gmail.com> <87k2mtdhem.fsf@gmx.us> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:51520) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aOucl-0001Cc-3N for emacs-orgmode@gnu.org; Thu, 28 Jan 2016 17:01:13 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aOucf-0007Vm-Jx for emacs-orgmode@gnu.org; Thu, 28 Jan 2016 17:01:07 -0500 Received: from mail-wm0-x22e.google.com ([2a00:1450:400c:c09::22e]:35340) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aOucf-0007Ve-9T for emacs-orgmode@gnu.org; Thu, 28 Jan 2016 17:01:01 -0500 Received: by mail-wm0-x22e.google.com with SMTP id r129so44323537wmr.0 for ; Thu, 28 Jan 2016 14:01:00 -0800 (PST) In-reply-to: <87k2mtdhem.fsf@gmx.us> 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 Rasmus writes: > Myles English writes: > >> Thanks for making it! > > It's Nicolas’ creation, not mine. I merely contribute a few patches > to it. Thanks to Nicolas too. >>> Aside: it sounds like what you need is "yourref", maybe "yourmail", >>> "myref", "customer", and "invoice". These are typed in the same line as >>> the date and place. In my manual it’s described around pp. 180. >> >> Thanks, those are all useful fields I didn't know about. The >> description of "frombank" indicates that "location" is still a good >> place for bank account details. > > OK. > >>> On to "location". From the manual pp. 195 it looks like it is usually >>> something akin to an address field on the right side of the head. I think >>> "location" should be settable via a special :location: heading, probably >>> with special line breaking rules like the :to:/:from: special headings. >>> We can allow a #+LOCATION keyword in addition, but need not. All IMO. >>> WDYT? >> >> Given that "location" is intended as a "user's extension field" I >> suppose that a special tagged :location: heading would be convenient for >> some uses, if you want to add it. For most cases however, I think its >> use would break up the structure of the org-mode letter so I would still >> prefer this way for the simple case of inserting bank details: >> >> ______________________ >> >> ** Change of address >> :EXPORT_LOCATION: \usekomavar{frombank} > > You could have this is a LCO file as well. Do you mean like this: \setkomavar{location}{\usekomavar{frombank}} I don't understand why I would want to do that because I would have to use a different LCO file depending on whether I was writing to my bank or not. > If so, you might be able to populate location using > \ifkomavarempty{}{}. I use this in my standard footer to insert > fields depending on which variables are set. Following on from my not understanding, any chance of an example of how to do that showing what variable to set when writing to my bank, (to cause the location variable to be populated with bank details)? >> \setkomavar{frombank}{\raggedright Acc.~No.:\,1234567890\\at Big >> Bank\\Sort Code: 11-22-33} >> >> The bank details only appear in a letter when the property is set. >> >> Which is much neater than the special heading approach, something like >> this: >> >> ______________________ >> >> ** Change of address >> >> *** Location field :location: >> \usekomavar{frombank} > > But is it much neater than: > > ** bank details :location: > Acc. no.: 12345 > Big Bank Corp > Sort code: 1122 Err, yes it is? And anyway, that data is in my LCO file, I don't want to duplicate it. > For temporary data, I’d rather have it like in my example. For permanent > data I can keep it in a .lco file. Yes, that is what I have done (hmmm, I am beginning to sense a fundamental misunderstanding here). My bank account details are permanent data and are in a LCO file. > And maybe #+include: "bank-info.org". The way you have edited my original email in your reply makes it difficult to follow what is being discussed. I would like to clarify the main point by quoting from my original message: #+BEGIN_QUOTE ...I would still prefer this way for the simple case of inserting bank details: ______________________ ** Change of address :EXPORT_LOCATION: \usekomavar{frombank} I have moved. ______________________ Where the frombank variable has been set in the LCO file: \setkomavar{frombank}{\raggedright Acc.~No.:\,1234567890\\at Big Bank\\Sort Code: 11-22-33} The bank details only appear in a letter when the property is set. #+END_QUOTE That property mentioned is the :EXPORT_LOCATION: property. You can set it to whatever you like, referencing something in your LCO file or temporary data. Myles