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: Mon, 04 Apr 2016 01:54:19 +0100 Message-ID: <87oa9qfb2c.fsf@gmail.com> References: <87egd2ho08.fsf@gmail.com> <87vb6eekzj.fsf@gmx.us> <87d1smgdcw.fsf@gmail.com> <87k2mtdhem.fsf@gmx.us> <87a8npgy92.fsf@gmail.com> <87bn84a8e4.fsf@gmx.us> <878u38ghth.fsf@gmail.com> <87vb6c6mdh.fsf@gmx.us> <87mvr2xeso.fsf@gmail.com> <87wpoizajs.fsf@pank.eu> <8760w2p6kq.fsf@gmail.com> <871t6nork4.fsf@gmx.us> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:49913) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1amsmm-0003y4-PA for emacs-orgmode@gnu.org; Sun, 03 Apr 2016 20:54:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1amsmi-0002aA-P0 for emacs-orgmode@gnu.org; Sun, 03 Apr 2016 20:54:32 -0400 Received: from mail-lb0-x234.google.com ([2a00:1450:4010:c04::234]:35528) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1amsmi-0002a3-Bz for emacs-orgmode@gnu.org; Sun, 03 Apr 2016 20:54:28 -0400 Received: by mail-lb0-x234.google.com with SMTP id bc4so137308423lbc.2 for ; Sun, 03 Apr 2016 17:54:27 -0700 (PDT) In-reply-to: <871t6nork4.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 --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-ox-koma-letter-Fixed-bug-in-filling-location-field.patch Content-Description: patch >From 2d9b513e14f6d34fe81a5970fd4cee24fc253a31 Mon Sep 17 00:00:00 2001 From: Myles English Date: Mon, 4 Apr 2016 01:11:19 +0100 Subject: [PATCH] ox-koma-letter: Fixed bug in filling 'location' field * contrib/lisp/ox-koma-letter.el: Fix code apparently introduced in 3ee3663 --- contrib/lisp/ox-koma-letter.el | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/contrib/lisp/ox-koma-letter.el b/contrib/lisp/ox-koma-letter.el index d36e817..2ef9025 100644 --- a/contrib/lisp/ox-koma-letter.el +++ b/contrib/lisp/ox-koma-letter.el @@ -797,12 +797,12 @@ a communication channel." (location-set (funcall check-scope 'location)) (location (plist-get info :location))) (when (or (and with-location-set (or location-set heading-val)) - (and (eq scope 'buffer) (or with-location-set location-set heading-val)) - (format "\\setkomavar{location}{%s}\n" - (if (plist-get info :with-location) - (if (plist-get info :special-headings) (or heading-val location "") - (or option location "")) - ""))))) + (and (eq scope 'buffer) (or with-location-set location-set heading-val))) + (format "\\setkomavar{location}{%s}\n" + (if (plist-get info :with-location) + (if (plist-get info :special-headings) (or heading-val location "") + (or heading-val location "")) + "")))) ;; Folding marks. (and (funcall check-scope 'with-foldmarks) (let ((foldmarks (plist-get info :with-foldmarks))) -- 2.7.4 --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Rasmus, A patch is attached that fixes some naughty brackets in the recent commit. Myles Rasmus writes: > Myles English writes: > >> Thanks for looking at this again. > > I'm just sorry about the delay, but I hope you can appreciate that > sometimes time is at a premium. > >>> Is :with-location something you feel strongly about? I'm not sure I find >>> that it makes sense... >>> >>> I would like to apply the following patch on top of yours. >> >> I think that's alright. >> >> Just to recap: I use the "location" field, intended as a general purpose >> extension field, for bank details. Those details shouldn't be in every >> letter I write and I don't want to have to enter those details every >> time they are used. For those reasons I put the bank details in >> variable in a LCO file and toggle the inclusion by setting the >> :LOCATION: (or :EXPORT_LOCATION) property like this: >> >> :EXPORT_LOCATION: \usekomavar{frombank} > > So if something should be in ALL letters the advised method would be to > use LCO file or set the location variable. I’m just concerned with having > too many variables. ox-koma-letter is already fairly complex. > > It might make sense to NOT parse (i.e. interpret org syntax) the keyword > version or location then. Then you’d be able to add latex commands there. > The headline version would still be parsed. > > Rasmus --=-=-=--