From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Robert P. Goldman" Subject: [PATCH 4/4] Add handling of blockquote and output formats that must be flowed. Date: Wed, 28 Apr 2010 16:39:59 -0500 Message-ID: <1272490799-22448-2-git-send-email-rpgoldman@sift.info> References: <1272490799-22448-1-git-send-email-rpgoldman@sift.info> Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O7Ezo-0003MK-U5 for emacs-orgmode@gnu.org; Wed, 28 Apr 2010 17:40:40 -0400 Received: from [140.186.70.92] (port=42222 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O7Ezn-0003LS-LI for emacs-orgmode@gnu.org; Wed, 28 Apr 2010 17:40:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O7Ezl-00037k-NJ for emacs-orgmode@gnu.org; Wed, 28 Apr 2010 17:40:39 -0400 Received: from enchanter.real-time.com ([63.170.91.11]:3206) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O7Ezl-00037Z-FQ for emacs-orgmode@gnu.org; Wed, 28 Apr 2010 17:40:37 -0400 In-Reply-To: <1272490799-22448-1-git-send-email-rpgoldman@sift.info> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Cc: "Robert P. Goldman" , dominik@uva.nl From: Robert P. Goldman Added a handler for blockquotes. Also added :body-newline-paragraph to the org-set-generic-type. This is intended to help handling output formats (like tikiwiki) where newlines are treated as paragraph separators, instead of being used to fill (i.e., the destination is expected to do the word-wrapping). If this is set to T then org-export-generic will emit a newline character when it sees a blank line. This should be used in concert with a value like "%s " for :body-line-format and nil for :body-line-wrap. --- contrib/lisp/org-export-generic.el | 19 +++++++++++++++++-- 1 files changed, 17 insertions(+), 2 deletions(-) diff --git a/contrib/lisp/org-export-generic.el b/contrib/lisp/org-export-generic.el index 11c37da..1b099dd 100644 --- a/contrib/lisp/org-export-generic.el +++ b/contrib/lisp/org-export-generic.el @@ -88,8 +88,9 @@ ;; * properties ;; * drawers ;; * oh my -;; * optmization (many plist extracts should be in (let) vars +;; * optmization (many plist extracts should be in let vars) ;; * define defcustom spec for the specifier list +;; * fonts: at least monospace is not handled at all here. ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; @@ -638,10 +639,14 @@ underlined headlines. The default is 3." (or (plist-get export-plist :body-list-checkbox-done-end) "")) (listcheckhalfend (or (plist-get export-plist :body-list-checkbox-half-end) "")) + (bodynewline-paragraph (plist-get export-plist :body-newline-paragraph)) (bodytextpre (plist-get export-plist :body-text-prefix)) (bodytextsuf (plist-get export-plist :body-text-suffix)) (bodylinewrap (plist-get export-plist :body-line-wrap)) (bodylineform (or (plist-get export-plist :body-line-format) "%s")) + (blockquotestart (or (plist-get export-plist :blockquote-start) "\n\n\t")) + (blockquoteend (or (plist-get export-plist :blockquote-end) "\n\n")) + thetoc toctags have-headings first-heading-pos table-open table-buffer link-buffer link desc desc0 rpl wrap) @@ -868,7 +873,7 @@ underlined headlines. The default is 3." ((string-match "^\\([ \t]*\\)\\(:\\( \\|$\\)\\)" line) ;; - ;; pre-formated text + ;; pre-formatted text ;; (setq line (replace-match "\\1" nil nil line)) @@ -933,6 +938,15 @@ underlined headlines. The default is 3." ) (insert (format numlistformat line))) + + ((equal line "ORG-BLOCKQUOTE-START") + (setq line blockquotestart)) + ((equal line "ORG-BLOCKQUOTE-END") + (setq line blockquoteend)) + ((string-match "^\\s-*$" line) + ;; blank line + (if bodynewline-paragraph + (insert "\n"))) (t ;; ;; body @@ -1009,6 +1023,7 @@ underlined headlines. The default is 3." (goto-char beg))) (goto-char (point-min)))) + (defun org-export-generic-format (export-plist prop &optional len n reverse) "converts a property specification to a string given types of properties -- 1.6.5.3