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, 15 Feb 2016 13:51:19 +0000 Message-ID: <87mvr2xeso.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> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:51523) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aVJYm-0001nF-Hg for emacs-orgmode@gnu.org; Mon, 15 Feb 2016 08:51:29 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aVJYh-00055c-HE for emacs-orgmode@gnu.org; Mon, 15 Feb 2016 08:51:28 -0500 Received: from mail-wm0-x22a.google.com ([2a00:1450:400c:c09::22a]:36285) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aVJYh-00055N-5x for emacs-orgmode@gnu.org; Mon, 15 Feb 2016 08:51:23 -0500 Received: by mail-wm0-x22a.google.com with SMTP id g62so59850634wme.1 for ; Mon, 15 Feb 2016 05:51:22 -0800 (PST) In-reply-to: <87vb6c6mdh.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: emacs-orgmode@gnu.org Cc: Rasmus --=-=-= Content-Type: text/plain Rasmus writes: > I will try to merge your patch soon, this weekend. Again, unless someone > beats me to it. Please would someone apply this patch? Thanks, Myles --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-ox-koma-letter-Add-support-for-LOCATION-koma-variabl.patch >From 4495abd39d57abc0dd64361f852c3a638f86915b Mon Sep 17 00:00:00 2001 From: Myles English Date: Wed, 27 Jan 2016 18:18:38 +0000 Subject: [PATCH] ox-koma-letter: Add support for LOCATION koma variable * contrib/lisp/ox-koma-letter.el (koma-letter): Duplicated code used for 'place' variable, renamed as 'location' Whenever OPTION keyword contains a 'location' item or LOCATION keyword is used in the buffer, set KOMA option 'location' after LCO inclusion. --- contrib/lisp/ox-koma-letter.el | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/contrib/lisp/ox-koma-letter.el b/contrib/lisp/ox-koma-letter.el index 9a4686e..8afeed2 100644 --- a/contrib/lisp/ox-koma-letter.el +++ b/contrib/lisp/ox-koma-letter.el @@ -41,6 +41,7 @@ ;; - PHONE_NUMBER: see `org-koma-letter-phone-number', ;; - SIGNATURE: see `org-koma-letter-signature', ;; - PLACE: see `org-koma-letter-place', +;; - LOCATION: see `org-koma-letter-location', ;; - TO_ADDRESS: If unspecified this is set to "\mbox{}". ;; ;; TO_ADDRESS and FROM_ADDRESS can also be specified using heading @@ -58,6 +59,7 @@ ;; - phone (see `org-koma-letter-use-phone') ;; - email (see `org-koma-letter-use-email') ;; - place (see `org-koma-letter-use-place') +;; - location (see `org-koma-letter-use-location') ;; - subject, a list of format options ;; (see `org-koma-letter-subject-format') ;; - after-closing-order, a list of the ordering of headings with @@ -188,6 +190,12 @@ This option can also be set with the PLACE keyword." :group 'org-export-koma-letter :type 'string) +(defcustom org-koma-letter-location "" + "Sender's extension field, as a string. +This option can also be set with the LOCATION keyword." + :group 'org-export-koma-letter + :type 'string) + (defcustom org-koma-letter-opening "" "Letter's opening, as a string. @@ -356,6 +364,13 @@ This option can also be set with the OPTIONS keyword, e.g.: :group 'org-export-koma-letter :type 'boolean) +(defcustom org-koma-letter-use-location t + "Non-nil prints the contents of the letter's extension below the header. +This option can also be set with the OPTIONS keyword, e.g.: +\"location:nil\"." + :group 'org-export-koma-letter + :type 'boolean) + (defcustom org-koma-letter-default-class "default-koma-letter" "Default class for `org-koma-letter'. The value must be a member of `org-latex-classes'." @@ -406,6 +421,7 @@ e.g. \"title-subject:t\"." (:email "EMAIL" nil (org-koma-letter--get-value org-koma-letter-email) t) (:to-address "TO_ADDRESS" nil nil newline) (:place "PLACE" nil org-koma-letter-place) + (:location "LOCATION" nil org-koma-letter-location) (:subject "SUBJECT" nil nil parse) (:opening "OPENING" nil org-koma-letter-opening parse) (:closing "CLOSING" nil org-koma-letter-closing parse) @@ -425,6 +441,7 @@ e.g. \"title-subject:t\"." (:with-foldmarks nil "foldmarks" org-koma-letter-use-foldmarks) (:with-phone nil "phone" org-koma-letter-use-phone) (:with-place nil "place" org-koma-letter-use-place) + (:with-location nil "location" org-koma-letter-use-location) (:with-subject nil "subject" org-koma-letter-subject-format) (:with-title-as-subject nil "title-subject" org-koma-letter-prefer-subject) (:with-headline-opening nil nil org-koma-letter-headline-is-opening-maybe) @@ -435,12 +452,14 @@ e.g. \"title-subject:t\"." (:inbuffer-email "EMAIL" nil 'koma-letter:empty) (:inbuffer-phone-number "PHONE_NUMBER" nil 'koma-letter:empty) (:inbuffer-place "PLACE" nil 'koma-letter:empty) + (:inbuffer-location "LOCATION" nil 'koma-letter:empty) (:inbuffer-signature "SIGNATURE" nil 'koma-letter:empty) (:inbuffer-with-backaddress nil "backaddress" 'koma-letter:empty) (:inbuffer-with-email nil "email" 'koma-letter:empty) (:inbuffer-with-foldmarks nil "foldmarks" 'koma-letter:empty) (:inbuffer-with-phone nil "phone" 'koma-letter:empty) - (:inbuffer-with-place nil "place" 'koma-letter:empty)) + (:inbuffer-with-place nil "place" 'koma-letter:empty) + (:inbuffer-with-location nil "location" 'koma-letter:empty)) :translate-alist '((export-block . org-koma-letter-export-block) (export-snippet . org-koma-letter-export-snippet) (headline . org-koma-letter-headline) @@ -755,6 +774,14 @@ a communication channel." (format "\\setkomavar{place}{%s}\n" (if (plist-get info :with-place) (plist-get info :place) "")))) + ;; Location. + (let ((with-location-set (funcall check-scope 'with-location)) + (location-set (funcall check-scope 'location))) + (and (or (and with-location-set location-set) + (and (eq scope 'buffer) (or with-location-set location-set))) + (format "\\setkomavar{location}{%s}\n" + (if (plist-get info :with-location) (plist-get info :location) + "")))) ;; Folding marks. (and (funcall check-scope 'with-foldmarks) (let ((foldmarks (plist-get info :with-foldmarks))) -- 2.7.0 --=-=-=--