>From 8cc0953849b7b3e7d791c7ad4fd4a9a71581ada5 Mon Sep 17 00:00:00 2001 From: "rasmus.pank" Date: Mon, 27 May 2013 17:29:14 +0200 Subject: [PATCH 1/2] Bug fixes for ox-koma-letter.el * ox-koma-letter.el: If tag wasn't given a headline could cause trouble. * ox-koma-letter.el: bug in subject-format defcustom. * ox-koma-letter.el: some newline changes * ox-koma-letter.el: changed varioues quoted things to symbols. --- contrib/lisp/ox-koma-letter.el | 51 +++++++++++++++++++++++------------------- 1 file changed, 28 insertions(+), 23 deletions(-) diff --git a/contrib/lisp/ox-koma-letter.el b/contrib/lisp/ox-koma-letter.el index 4af0ba7..82bdf33 100644 --- a/contrib/lisp/ox-koma-letter.el +++ b/contrib/lisp/ox-koma-letter.el @@ -93,7 +93,7 @@ string." :type '(radio (function-item user-full-name) (string) (function) - (const nil))) + (const :tag "Do not export author" nil))) (defcustom org-koma-letter-email 'org-koma-letter-email "The sender's email address. @@ -105,7 +105,7 @@ function may be given. Functions must return a string." :type '(radio (function-item org-koma-letter-email) (string) (function) - (const nil))) + (const :tag "Do not export email" nil))) (defcustom org-koma-letter-from-address nil "Sender's address, as a string." @@ -153,17 +153,19 @@ writing the following values are allowed: Please refer to the KOMA-script manual (Table 4.16. in the English manual of 2012-07-22)" - :type '(set (const "afteropening") - (const "beforeopening") - (const "centered") - (const "left") - (const "right") - (const "underlined") - (const "titled") - (const "untitled") - (const :tag "No export" nil) - (const :tag "Default options" t) - (string)) + :type '(radio + (const :tag "No export" nil) + (const :tag "Default options" t) + (set :tag "selection" + (const 'afteropening) + (const 'beforeopening) + (const 'centered) + (const 'left) + (const 'right) + (const 'underlined) + (const 'titled) + (const 'untitled)) + (string)) :group 'org-export-koma-letter) @@ -198,15 +200,16 @@ Use `foldmarks:true' to activate default fold marks or :group 'org-export-koma-letter :type 'boolean) -(defconst org-koma-letter-special-tags-after-closing - '("ps" "encl" "cc") + + +(defconst org-koma-letter-special-tags-after-closing '(ps encl cc) "Header tags to be inserted after closing") -(defconst org-koma-letter-special-tags-after-letter '("after_letter") +(defconst org-koma-letter-special-tags-after-letter '(after_letter) "Header tags to be inserted after closing") -(defvar org-koma-letter-special-contents nil "holds special -content temporarily.") +(defvar org-koma-letter-special-contents nil + "holds special content temporarily.") @@ -286,9 +289,10 @@ 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. " (let (output) - (dolist (ac a-list output) - (let - ((x (org-koma-letter--get-tagged-contents ac)) + (dolist (ac* a-list output) + (let* + ((ac (cond ((symbolp ac*) (symbol-name ac*)) (t ac*))) + (x (org-koma-letter--get-tagged-contents ac)) (regexp (if keep-newlines "" "\\`\n+\\|\n*\\'"))) (when x (setq output @@ -354,8 +358,9 @@ appropriate place." (let* ((tags (and (plist-get info :with-tags) (org-export-get-tags headline info))) - (tag (downcase (car tags)))) - (if (member tag (plist-get info :special-tags)) + (tag (if tags (downcase (car tags))))) + (if (member tag + (mapcar 'symbol-name (plist-get info :special-tags))) (progn (push (cons tag contents) org-koma-letter-special-contents) -- 1.8.3