emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [patch][ox-koma-letter] set opening via headline
@ 2013-08-17 19:20 Rasmus
  2013-08-17 19:42 ` Nicolas Goaziou
  0 siblings, 1 reply; 4+ messages in thread
From: Rasmus @ 2013-08-17 19:20 UTC (permalink / raw)
  To: emacs-orgmode; +Cc: alan.schmitt

[-- Attachment #1: Type: text/plain, Size: 693 bytes --]

Hi,

With the following patch one can set the opening via a headline.
Currently, it's pretty conservative and will only set opening if it
isn't set already.  I'm open to discussion on that point.

With this patch, the following example:

--8<---------------cut here---------------start------------->8---
#+TITLE: Test
* my opening
  my letter
--8<---------------cut here---------------end--------------->8---

now exports something like

--8<---------------cut here---------------start------------->8---
[...]
\opening{my opening}
my letter
[...]
--8<---------------cut here---------------end--------------->8---

It applies against master and /not/ Alan's patch from a month ago.

–Rasmus


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Set-opening-via-headline.patch --]
[-- Type: text/x-diff, Size: 2563 bytes --]

From 7036479f45c2d34d8e9cd1efbc5e7e775ab7122d Mon Sep 17 00:00:00 2001
From: rasmus <rasmus@gmx.us>
Date: Sat, 17 Aug 2013 20:24:36 +0200
Subject: [PATCH] Set opening via headline

* ox-koma-letter.el (org-koma-letter-headline-is-opening-maybe): new
variable.  If `t' let headlines set subject.
(org-koma-letter-headline): let headline set opening.
(org-koma-letter-template): let opening and closing be empty if nil.
---
 contrib/lisp/ox-koma-letter.el | 19 ++++++++++++++++---
 1 file changed, 16 insertions(+), 3 deletions(-)

diff --git a/contrib/lisp/ox-koma-letter.el b/contrib/lisp/ox-koma-letter.el
index d149f9d..33062cc 100644
--- a/contrib/lisp/ox-koma-letter.el
+++ b/contrib/lisp/ox-koma-letter.el
@@ -175,7 +175,10 @@ function may be given.  Functions must return a string."
   :type 'string)
 
 (defcustom org-koma-letter-opening nil
-  "Letter's opening, as a string."
+  "Letter's opening, as a string.  If (1) this value is nil; (2)
+the letter is started with a headline; and (3)
+`org-koma-letter-headline-is-opening-maybe' is t the value
+opening will be implicit set as the headline title."
   :group 'org-export-koma-letter
   :type 'string)
 
@@ -264,6 +267,13 @@ Use `foldmarks:true' to activate default fold marks or
   :group 'org-export-koma-letter
   :type 'string)
 
+(defcustom org-koma-letter-headline-is-opening-maybe t
+  "Whether a headline may be used as an opening.  A headline is
+only used if #+OPENING is not set.  See also
+`org-koma-letter-opening'."
+  :group 'org-export-koma-letter
+  :type 'boolean)
+
 (defconst org-koma-letter-special-tags-in-letter '(to from)
   "header tags related to the letter itself")
 
@@ -482,6 +492,9 @@ appropriate place."
 	  (push (cons tag contents)
 		org-koma-letter-special-contents)
 	  nil)
+      (unless (or (plist-get info :opening)
+		  (not org-koma-letter-headline-is-opening-maybe))
+	(plist-put info :opening (org-element-property :raw-value headline)))
       contents)))
 
 
@@ -584,11 +597,11 @@ holding export options."
    (format "\\begin{letter}{%%\n%s}\n\n"
 	   (org-koma-letter--determine-special-value info 'to))
    ;; Opening.
-   (format "\\opening{%s}\n\n" (plist-get info :opening))
+   (format "\\opening{%s}\n\n" (or (plist-get info :opening) ""))
    ;; Letter body.
    contents
    ;; Closing.
-   (format "\n\\closing{%s}\n" (plist-get info :closing))
+   (format "\n\\closing{%s}\n" (or (plist-get info :closing) ""))
    (org-koma-letter--prepare-special-contents-as-macro
     (plist-get info :with-after-closing))
    ;; Letter end.
-- 
1.8.3.4


[-- Attachment #3: Type: text/plain, Size: 59 bytes --]

-- 
Hvor meget poesi tror De kommer ud af et glas isvand?


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [patch][ox-koma-letter] set opening via headline
  2013-08-17 19:20 [patch][ox-koma-letter] set opening via headline Rasmus
@ 2013-08-17 19:42 ` Nicolas Goaziou
  2013-08-17 20:07   ` Rasmus
  0 siblings, 1 reply; 4+ messages in thread
From: Nicolas Goaziou @ 2013-08-17 19:42 UTC (permalink / raw)
  To: Rasmus; +Cc: alan.schmitt, emacs-orgmode

Hello,

Rasmus <rasmus@gmx.us> writes:

> With the following patch one can set the opening via a headline.
> Currently, it's pretty conservative and will only set opening if it
> isn't set already.  I'm open to discussion on that point.

Here are some comments about its internals.

>  (defcustom org-koma-letter-opening nil
> -  "Letter's opening, as a string."
> +  "Letter's opening, as a string.  If (1) this value is nil; (2)

Please start a new line after the first sentence.

> +(defcustom org-koma-letter-headline-is-opening-maybe t
> +  "Whether a headline may be used as an opening.  A headline is

Ditto.

> +      (unless (or (plist-get info :opening)
> +		  (not org-koma-letter-headline-is-opening-maybe))
> +	(plist-put info :opening (org-element-property :raw-value headline)))

I suggest to use

  (org-export-data (org-element-property :title headline) info)

instead, so you can correctly export Org syntax included in the
headline, if any.


Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [patch][ox-koma-letter] set opening via headline
  2013-08-17 19:42 ` Nicolas Goaziou
@ 2013-08-17 20:07   ` Rasmus
  2013-08-17 20:55     ` [patch][ox-koma-letter] checkdoc compatible (was: [patch][ox-koma-letter] set opening via headline) Rasmus
  0 siblings, 1 reply; 4+ messages in thread
From: Rasmus @ 2013-08-17 20:07 UTC (permalink / raw)
  To: emacs-orgmode; +Cc: alan.schmitt

[-- Attachment #1: Type: text/plain, Size: 1182 bytes --]


Hi,

Nicolas Goaziou <n.goaziou@gmail.com> writes:

>> With the following patch one can set the opening via a headline.
>> Currently, it's pretty conservative and will only set opening if it
>> isn't set already.  I'm open to discussion on that point.
>
> Here are some comments about its internals.

Thanks!  I appreciate the feedback.  It should be fixed in the new
version.  I'll post another patch that adhere to this everywhere in
the file.

>>  (defcustom org-koma-letter-opening nil
>> -  "Letter's opening, as a string."
>> +  "Letter's opening, as a string.  If (1) this value is nil; (2)
>
> Please start a new line after the first sentence.
>
>> +(defcustom org-koma-letter-headline-is-opening-maybe t
>> +  "Whether a headline may be used as an opening.  A headline is
>
> Ditto.
>
>> +      (unless (or (plist-get info :opening)
>> +		  (not org-koma-letter-headline-is-opening-maybe))
>> +	(plist-put info :opening (org-element-property :raw-value headline)))
>
> I suggest to use
>
>   (org-export-data (org-element-property :title headline) info)
>
> instead, so you can correctly export Org syntax included in the
> headline, if any.

Good point.

See attached. 


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Set-opening-via-headline.patch --]
[-- Type: text/x-diff, Size: 2591 bytes --]

From 0b4b019e176898b09f95ac6bae2e5d61da2a6ae4 Mon Sep 17 00:00:00 2001
From: rasmus <rasmus@gmx.us>
Date: Sat, 17 Aug 2013 20:24:36 +0200
Subject: [PATCH] Set opening via headline

* ox-koma-letter.el (org-koma-letter-headline-is-opening-maybe): new
variable.  If `t' let headlines set subject.
(org-koma-letter-headline): let headline set opening.
(org-koma-letter-template): let opening and closing be empty if nil.
---
 contrib/lisp/ox-koma-letter.el | 21 ++++++++++++++++++---
 1 file changed, 18 insertions(+), 3 deletions(-)

diff --git a/contrib/lisp/ox-koma-letter.el b/contrib/lisp/ox-koma-letter.el
index d149f9d..bb68771 100644
--- a/contrib/lisp/ox-koma-letter.el
+++ b/contrib/lisp/ox-koma-letter.el
@@ -175,7 +175,11 @@ function may be given.  Functions must return a string."
   :type 'string)
 
 (defcustom org-koma-letter-opening nil
-  "Letter's opening, as a string."
+  "Letter's opening, as a string.
+
+If (1) this value is nil; (2) the letter is started with a
+headline; and (3) `org-koma-letter-headline-is-opening-maybe' is
+t the value opening will be implicit set as the headline title."
   :group 'org-export-koma-letter
   :type 'string)
 
@@ -264,6 +268,13 @@ Use `foldmarks:true' to activate default fold marks or
   :group 'org-export-koma-letter
   :type 'string)
 
+(defcustom org-koma-letter-headline-is-opening-maybe t
+  "Whether a headline may be used as an opening.
+A headline is only used if #+OPENING is not set.  See also
+`org-koma-letter-opening'."
+  :group 'org-export-koma-letter
+  :type 'boolean)
+
 (defconst org-koma-letter-special-tags-in-letter '(to from)
   "header tags related to the letter itself")
 
@@ -482,6 +493,10 @@ appropriate place."
 	  (push (cons tag contents)
 		org-koma-letter-special-contents)
 	  nil)
+      (unless (or (plist-get info :opening)
+		  (not org-koma-letter-headline-is-opening-maybe))
+	(plist-put info :opening
+		   (org-export-data (org-element-property :title headline) info)))
       contents)))
 
 
@@ -584,11 +599,11 @@ holding export options."
    (format "\\begin{letter}{%%\n%s}\n\n"
 	   (org-koma-letter--determine-special-value info 'to))
    ;; Opening.
-   (format "\\opening{%s}\n\n" (plist-get info :opening))
+   (format "\\opening{%s}\n\n" (or (plist-get info :opening) ""))
    ;; Letter body.
    contents
    ;; Closing.
-   (format "\n\\closing{%s}\n" (plist-get info :closing))
+   (format "\n\\closing{%s}\n" (or (plist-get info :closing) ""))
    (org-koma-letter--prepare-special-contents-as-macro
     (plist-get info :with-after-closing))
    ;; Letter end.
-- 
1.8.3.4


[-- Attachment #3: Type: text/plain, Size: 28 bytes --]


-- 
Summon the Mothership!

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [patch][ox-koma-letter] checkdoc compatible (was: [patch][ox-koma-letter] set opening via headline)
  2013-08-17 20:07   ` Rasmus
@ 2013-08-17 20:55     ` Rasmus
  0 siblings, 0 replies; 4+ messages in thread
From: Rasmus @ 2013-08-17 20:55 UTC (permalink / raw)
  To: emacs-orgmode; +Cc: alan.schmitt

[-- Attachment #1: Type: text/plain, Size: 491 bytes --]


> Nicolas Goaziou <n.goaziou@gmail.com> writes:
>>  (defcustom org-koma-letter-opening nil
>> -  "Letter's opening, as a string."
>> +  "Letter's opening, as a string.  If (1) this value is nil; (2)
>
> Please start a new line after the first sentence.

This patch changes some docstrings to make ox-koma-letter pass
checkdoc.  I've also renamed some functions with weird names (let me
know if you disagree).  It applies on top of the patch
0001-Set-opening-via-headline.patch.

–Rasmus


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0002-Make-ox-koma-letter-pass-checkdoc.patch --]
[-- Type: text/x-diff, Size: 12829 bytes --]

From 57e743d6ea8479b87370f7a48bef362975bfde3c Mon Sep 17 00:00:00 2001
From: rasmus <rasmus@gmx.us>
Date: Sat, 17 Aug 2013 22:50:47 +0200
Subject: [PATCH 2/2] Make ox-koma-letter pass checkdoc.

* ox-koma-letter.el: Reworded parts of the head of the file.
(org-koma-letter-prefer-special-headings,
org-koma-letter-subject-format, org-koma-letter-default-class,
org-koma-letter-special-tags-in-letter,
org-koma-letter-special-tags-after-closing,
org-koma-letter-special-tags-after-letter,
org-koma-letter-plug-into-ox, org-koma-letter-email,
org-koma-letter--get-tagged-contents,
org-koma-letter-special-contents): Changed docstring to pass checkdoc.
(org-koma-letter--get-value): Renamed `org-koma-letter--get-custom'.
Docstring changed to pass checkdoc.
(org-koma-letter--special-contents-as-macro): Renamed
`org-koma-letter--prepare-special-contents-as-macro'.  Docstring
changed to pass checkdoc.
(org-koma-letter--normalize-string): Renamed
org-koma-letter--remove-offending-new-lines.  Docstring changed to
pass checkdoc.
(org-koma-letter--determine-to-and-from): Renamed
org-koma-letter--determine-special-value.  Docstring changed to pass
checkdoc.

Some functions have been renamed to make the names slightly more
informative.
---
 contrib/lisp/ox-koma-letter.el | 117 +++++++++++++++++++++--------------------
 1 file changed, 60 insertions(+), 57 deletions(-)

diff --git a/contrib/lisp/ox-koma-letter.el b/contrib/lisp/ox-koma-letter.el
index bb68771..6f5529f 100644
--- a/contrib/lisp/ox-koma-letter.el
+++ b/contrib/lisp/ox-koma-letter.el
@@ -62,8 +62,8 @@
 ;;     (see `org-koma-letter-subject-format')
 ;;   - after-closing-order, a list of the ordering of headings with
 ;;     special tags after closing (see
-;;     `org-koma-letter-special-tags-after-closing') -
-;;     after-letter-order, as above, but after the end of the letter
+;;     `org-koma-letter-special-tags-after-closing')
+;;   - after-letter-order, as above, but after the end of the letter
 ;;     (see `org-koma-letter-special-tags-after-letter').
 ;;
 ;; The following variables works differently from the main LaTeX class
@@ -91,7 +91,7 @@
 ;;   (eval-after-load "ox-koma-letter"
 ;;   '(org-koma-letter-plug-into-ox))
 ;;
-;; to your init file. This will add a very sparse scrlttr2 class and
+;; to your init file.  This will add a sparse scrlttr2 class and
 ;; set it as the default `org-koma-latex-default-class'.  You can also
 ;; add you own letter class.  For instace:
 ;;
@@ -138,8 +138,8 @@
   "The sender's name.
 
 This variable defaults to calling the function `user-full-name'
-which just returns the current `user-full-name'.  Alternatively a
-string, nil or a function may be given. Functions must return a
+which just returns the current function `user-full-name'.  Alternatively a
+string, nil or a function may be given.  Functions must return a
 string."
   :group 'org-export-koma-letter
   :type '(radio (function-item user-full-name)
@@ -189,8 +189,7 @@ t the value opening will be implicit set as the headline title."
   :type 'string)
 
 (defcustom org-koma-letter-prefer-special-headings nil
-  "If both a TO or FROM is specified two places should the
-  heading version be preferred?"
+  "If TO and/or FROM is specified using both a heading and a keyword the heading value will be preferred if the variable is t."
   :group 'org-export-koma-letter
   :type 'boolean)
 
@@ -200,21 +199,22 @@ t the value opening will be implicit set as the headline title."
   :type 'string)
 
 (defcustom org-koma-letter-subject-format t
-  "Use the title as the subject of the letter.  At the time of
-writing the following values are allowed:
-
- - afteropening: subject after opening
- - beforeopening: subject before opening
- - centered: subject centered
- - left:subject left-justified
- - right: subject right-justified
- - titled: add title/description to subject
- - underlined: set subject underlined (see note in text please)
+  "Use the title as the subject of the letter.
+
+At this time the following values are allowed:
+
+ - afteropening: subject after opening.
+ - beforeopening: subject before opening.
+ - centered: subject centered.
+ - left:subject left-justified.
+ - right: subject right-justified.
+ - titled: add title/description to subject.
+ - underlined: set subject underlined.
  - untitled: do not add title/description to subject.
  - No-export: do no insert a subject even if present.
 
 Please refer to the KOMA-script manual (Table 4.16. in the
-English manual of 2012-07-22)"
+English manual of 2012-07-22)."
   :type '(radio
 	  (const :tag "No export" nil)
 	  (const :tag "Default options" t)
@@ -263,8 +263,9 @@ Use `foldmarks:true' to activate default fold marks or
   :type 'boolean)
 
 (defcustom org-koma-letter-default-class nil
-  "Default class for `org-koma-letter'.  Must be a member of
-  `org-latex-classes'"
+  "Default class for `org-koma-letter'.
+
+The value must be a member of `org-latex-classes'."
   :group 'org-export-koma-letter
   :type 'string)
 
@@ -276,16 +277,16 @@ A headline is only used if #+OPENING is not set.  See also
   :type 'boolean)
 
 (defconst org-koma-letter-special-tags-in-letter '(to from)
-  "header tags related to the letter itself")
+  "Header tags related to the letter itself.")
 
 (defconst org-koma-letter-special-tags-after-closing '(ps encl cc)
-  "Header tags to be inserted after closing")
+  "Header tags to be inserted after closing.")
 
 (defconst org-koma-letter-special-tags-after-letter '(after_letter)
-  "Header tags to be inserted after closing")
+  "Header tags to be inserted after closing.")
 
 (defvar org-koma-letter-special-contents nil
-  "holds special content temporarily.")
+  "Holds special content temporarily.")
 
 
 \f
@@ -297,10 +298,10 @@ A headline is only used if #+OPENING is not set.  See also
     (:latex-class "LATEX_CLASS" nil (if org-koma-letter-default-class
 					org-koma-letter-default-class
 					org-latex-default-class) t)
-    (:author "AUTHOR" nil (org-koma-letter--get-custom org-koma-letter-author) t)
+    (:author "AUTHOR" nil (org-koma-letter--get-value org-koma-letter-author) t)
     (:from-address "FROM_ADDRESS" nil nil newline)
     (:phone-number "PHONE_NUMBER" nil org-koma-letter-phone-number)
-    (:email "EMAIL" nil (org-koma-letter--get-custom org-koma-letter-email) 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)
     (:opening "OPENING" nil org-koma-letter-opening)
@@ -341,8 +342,7 @@ A headline is only used if #+OPENING is not set.  See also
 ;;; Initialize class function
 
 (defun org-koma-letter-plug-into-ox ()
-  "Add a sparse `default-koma-letter' to `org-latex-classes' and set
-`org-koma-letter-default-class' to `default-koma-letter'"
+  "Add a sparse `default-koma-letter' to `org-latex-classes' and set `org-koma-letter-default-class' to `default-koma-letter'."
   (let ((class "default-koma-letter"))
     (eval-after-load "ox-latex"
       `(unless (member ,class 'org-latex-classes)
@@ -354,20 +354,20 @@ A headline is only used if #+OPENING is not set.  See also
 ;;; Helper functions
 
 (defun org-koma-letter-email ()
-  "Return the current `user-mail-address'"
+  "Return the current `user-mail-address'."
   user-mail-address)
 
 ;; The following is taken from/inspired by ox-grof.el
 ;; Thanks, Luis!
 
 (defun org-koma-letter--get-tagged-contents (key)
-  "Get tagged content from `org-koma-letter-special-contents'"
-  (cdr (assoc (org-koma-letter--get-custom key)
+  "Get contents from a headline tagged with KEY.
+Technically, the contents is stored in `org-koma-letter-special-contents'."
+  (cdr (assoc (org-koma-letter--get-value key)
 	      org-koma-letter-special-contents)))
 
-(defun org-koma-letter--get-custom (value)
-  "Determines whether a value is nil, a string or a
-function (a symobl).  If it is a function it it evaluates it."
+(defun org-koma-letter--get-value (value)
+  "Determines if VALUE is nil, a string, a function or a symbol and return a string or nil."
   (when value
     (cond ((stringp value) value)
 	  ((functionp value) (funcall value))
@@ -375,20 +375,21 @@ function (a symobl).  If it is a function it it evaluates it."
 	  (t value))))
 
 
-(defun org-koma-letter--prepare-special-contents-as-macro (a-list &optional keep-newlines no-tag)
-  "Finds all the components of `org-koma-letter-special-contents'
-corresponding to members of the `a-list' and return them as a
-string to be formatted.  The function is used for inserting
-content of speciall headings such as PS.
+(defun org-koma-letter--special-contents-as-macro (a-list &optional keep-newlines no-tag)
+  "Find members of `org-koma-letter-special-contents' corresponding to A-LIST.
+Return them as a string to be formatted.
 
-If keep-newlines is t newlines will not be removed.  If no-tag is
+The function is used for inserting content of speciall headings
+such as PS.
+
+If KEEP-NEWLINES is t newlines will not be removed.  If NO-TAG is
 is t the content in `org-koma-letter-special-contents' will not
-be wrapped in a macro named whatever the members of a-list are called.
-"
+be wrapped in a macro named whatever the members of A-LIST are
+called."
   (let (output)
     (dolist (ac* a-list output)
       (let*
-	  ((ac (org-koma-letter--get-custom ac*))
+	  ((ac (org-koma-letter--get-value ac*))
 	   (x (org-koma-letter--get-tagged-contents ac)))
 	(when x
 	  (setq output
@@ -397,24 +398,26 @@ be wrapped in a macro named whatever the members of a-list are called.
 		 ;; sometimes LaTeX complains about newlines
 		 ;; at the end or beginning of macros.  Remove them.
 		 (org-koma-letter--format-string-as-macro
-		  (if keep-newlines x (org-koma-letter--remove-offending-new-lines x))
+		  (if keep-newlines x (org-koma-letter--normalize-string x))
 		  (unless no-tag  ac)))))))))
 
 (defun org-koma-letter--format-string-as-macro (string &optional macro)
-  "If a macro is given format as string as  \"\\macro{string}\" else as \"string\""
+  "Format STRING as  \"\\macro{string}\" if MACRO is given else as \"string\"."
   (if macro
       (format "\\%s{%s}" macro string)
     (format "%s" string)))
 
-(defun org-koma-letter--remove-offending-new-lines (string)
-  "Remove new lines in the begging and end of `string'"
+(defun org-koma-letter--normalize-string (string)
+  "Remove new lines in the beginning and end of `STRING'."
   (replace-regexp-in-string "\\`[ \n\t]+\\|[\n\t ]*\\'" "" string))
 
-(defun org-koma-letter--determine-special-value (info key)
-  "Determine who the letter is to and whom it is from.
-  oxkoma-letter allows two ways to specify these things.  If both
-  are present return the preferred one as determined by
- `org-koma-letter-prefer-special-headings'."
+(defun org-koma-letter--determine-to-and-from (info key)
+  "Given INFO determine KEY for the letter.
+KEY should be `to' or `from'.
+
+`ox-koma-letter' allows two ways to specify to and from.  If both
+are present return the preferred one as determined by
+`org-koma-letter-prefer-special-headings'."
   (let* ((plist-alist '((from . :from-address)
 		       (to . :to-address)))
 	 (default-alist  `((from  ,org-koma-letter-from-address)
@@ -434,7 +437,7 @@ be wrapped in a macro named whatever the members of a-list are called.
   (when adr
     (replace-regexp-in-string
      "\n" "\\\\\\\\\n"
-     (org-koma-letter--remove-offending-new-lines adr)))))
+     (org-koma-letter--normalize-string adr)))))
 
 ;;; Transcode Functions
 
@@ -537,7 +540,7 @@ holding export options."
 	info)))
    (let ((lco (plist-get info :lco))
 	 (author (plist-get info :author))
-	 (from-address (org-koma-letter--determine-special-value info 'from))
+	 (from-address (org-koma-letter--determine-to-and-from info 'from))
 	 (phone-number (plist-get info :phone-number))
 	 (email (plist-get info :email))
 	 (signature (plist-get info :signature)))
@@ -597,18 +600,18 @@ holding export options."
 	(format "\\setkomavar{subject}{%s}\n\n" subject))))
    ;; Letter start
    (format "\\begin{letter}{%%\n%s}\n\n"
-	   (org-koma-letter--determine-special-value info 'to))
+	   (org-koma-letter--determine-to-and-from info 'to))
    ;; Opening.
    (format "\\opening{%s}\n\n" (or (plist-get info :opening) ""))
    ;; Letter body.
    contents
    ;; Closing.
    (format "\n\\closing{%s}\n" (or (plist-get info :closing) ""))
-   (org-koma-letter--prepare-special-contents-as-macro
+   (org-koma-letter--special-contents-as-macro
     (plist-get info :with-after-closing))
    ;; Letter end.
    "\n\\end{letter}\n"
-   (org-koma-letter--prepare-special-contents-as-macro
+   (org-koma-letter--special-contents-as-macro
     (plist-get info :with-after-letter) t t)
    ;; Document end.
    "\n\\end{document}"
-- 
1.8.3.4


[-- Attachment #3: Type: text/plain, Size: 82 bytes --]


-- 
. . . The proofs are technical in nature and provides no real understanding.

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-08-17 20:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-17 19:20 [patch][ox-koma-letter] set opening via headline Rasmus
2013-08-17 19:42 ` Nicolas Goaziou
2013-08-17 20:07   ` Rasmus
2013-08-17 20:55     ` [patch][ox-koma-letter] checkdoc compatible (was: [patch][ox-koma-letter] set opening via headline) Rasmus

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).