From 3d4d938009cf04d987ae4522ddd90558c48dc962 Mon Sep 17 00:00:00 2001 From: Robert P. Goldman Date: Thu, 6 May 2010 14:16:37 -0500 Subject: [PATCH 1/7] Revision to handling of blank lines. Start of declaration protocol. Followed Wes Hardaker's idea of permitting alternative rewrites for blank lines, instead of making the blank line handler be a boolean and hard-wiring a newline character. Also added a declaration form, with type and documentation options, for the keywords used in defining a generic export method. --- contrib/lisp/org-export-generic.el | 27 ++++++++++++++++++++++++++- 1 files changed, 26 insertions(+), 1 deletions(-) diff --git a/contrib/lisp/org-export-generic.el b/contrib/lisp/org-export-generic.el index 1b099dd..23ecf9a 100644 --- a/contrib/lisp/org-export-generic.el +++ b/contrib/lisp/org-export-generic.el @@ -444,6 +444,31 @@ in this way, it will be wrapped." export definitions." (aput 'org-generic-alist type definition)) +;;; helper functions for org-set-generic-type +(defvar org-export-generic-keywords nil) +(defmacro* def-org-export-generic-keyword (keyword + &key documentation + type) + "Define KEYWORD as a legitimate element for inclusion in +the body of an org-set-generic-type definition." + `(progn + (pushnew ,keyword org-export-generic-keywords) + ;; TODO: push the documentation and type information + ;; somewhere where it will do us some good. + )) + +(def-org-export-generic-keyword :body-newline-paragraph + :documentation "Bound either to NIL or to a pattern to be +inserted in the output for every blank line in the input. + The intention is to handle formats where text is flowed, and +newlines are interpreted as significant \(e.g., as indicating +preformatted text\). A common non-nil value for this keyword +is \"\\n\". Should typically be combined with a value for +:body-line-format that does NOT end with a newline." + :type string)) + + + (defun org-export-generic-remember-section (type suffix &optional prefix) (setq org-export-generic-section-type type) (setq org-export-generic-section-suffix suffix) @@ -946,7 +971,7 @@ underlined headlines. The default is 3." ((string-match "^\\s-*$" line) ;; blank line (if bodynewline-paragraph - (insert "\n"))) + (insert bodynewline-paragraph))) (t ;; ;; body -- 1.7.1