From 0cd85674a59c7ae4e2f3bcf331b82eba51a14ec1 Mon Sep 17 00:00:00 2001 From: Carsten Dominik Date: Wed, 17 Jun 2009 18:16:26 +0200 Subject: [PATCH] Fix stuff for org-exp-blocks.el --- ChangeLog | 6 ++++++ Makefile | 2 ++ lisp/ChangeLog | 2 ++ lisp/org-exp-blocks.el | 46 ++++++++++++++++++++++++++---------------- 4 files changed, 39 insertions(+), 17 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9d6621a9a..a62733acb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-06-17 Carsten Dominik + + * Makefile (LISPF): Add org-exp-blocks.el. + (lisp/org-exp-blocks.elc): Add dependencies for + org-exp-blocks.el. + 2009-03-31 Carsten Dominik * Makefile (LISPF): Add org-inlinetask.el diff --git a/Makefile b/Makefile index 6facd9f05..6971f9e41 100644 --- a/Makefile +++ b/Makefile @@ -70,6 +70,7 @@ LISPF = org.el \ org-colview-xemacs.el \ org-compat.el \ org-exp.el \ + org-exp-blocks.el \ org-docbook.el \ org-faces.el \ org-feed.el \ @@ -338,6 +339,7 @@ lisp/org-colview.elc: lisp/org.el lisp/org-colview-xemacs.elc: lisp/org.el lisp/org-compat.elc: lisp/org-macs.el lisp/org-exp.elc: lisp/org.el lisp/org-agenda.el +lisp/org-exp-blocks.elc: lisp/org.el lisp/org-latex.elc: lisp/org.el lisp/org-exp.el lisp/org-docbook.elc: lisp/org.el lisp/org-exp.el lisp/org-faces.elc: lisp/org-macs.el lisp/org-compat.el diff --git a/lisp/ChangeLog b/lisp/ChangeLog index a7f264ce7..ca4e57e95 100755 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,7 @@ 2009-06-17 Carsten Dominik + * org-exp-blocks.el: Declare functions and variables. + * org-remember.el (org-remember-templates): Allow the headline element to be a function. (org-remember-apply-template): If the headline is a function, call diff --git a/lisp/org-exp-blocks.el b/lisp/org-exp-blocks.el index 3422d09e4..848fc1399 100644 --- a/lisp/org-exp-blocks.el +++ b/lisp/org-exp-blocks.el @@ -74,7 +74,18 @@ (require 'org) -(defun org-exp-blocks-set (var value) +(defvar comint-last-input-end) +(defvar comint-prompt-regexp) +(defvar comint-last-input-end) +(defvar htmlp) +(defvar latexp) +(defvar docbookp) +(defvar asciip) + +(declare-function comint-send-input "comint" (&optional no-newline artificial)) +(declare-function R "ess" nil) + +(defun org-export-blocks-set (var value) "Set the value of `org-export-blocks' and install fontification." (set var value) (mapc (lambda (spec) @@ -86,21 +97,6 @@ (symbol-name (car spec))))) value)) -(defun org-export-blocks-add-block (block-spec) - "Add a new block type to `org-export-blocks'. BLOCK-SPEC -should be a three element list the first element of which should -indicate the name of the block, the second element should be the -formatting function called by `org-export-blocks-preprocess' and -the third element a flag indicating whether these types of blocks -should be fontified in org-mode buffers (see -`org-protecting-blocks'). For example the BLOCK-SPEC for ditaa -blocks is as follows... - - (ditaa org-export-blocks-format-ditaa nil)" - (unless (member block-spec org-export-blocks) - (setq org-export-blocks (cons block-spec org-export-blocks)) - (org-export-blocks-set 'org-export-blocks))) - (defcustom org-export-blocks '((comment org-export-blocks-format-comment t) (ditaa org-export-blocks-format-ditaa nil) @@ -117,7 +113,22 @@ Each block export function should accept three argumets..." (symbol :tag "Block name") (function :tag "Block formatter") (boolean :tag "Fontify content as Org syntax"))) - :set 'org-exp-blocks-set) + :set 'org-export-blocks-set) + +(defun org-export-blocks-add-block (block-spec) + "Add a new block type to `org-export-blocks'. BLOCK-SPEC +should be a three element list the first element of which should +indicate the name of the block, the second element should be the +formatting function called by `org-export-blocks-preprocess' and +the third element a flag indicating whether these types of blocks +should be fontified in org-mode buffers (see +`org-protecting-blocks'). For example the BLOCK-SPEC for ditaa +blocks is as follows... + + (ditaa org-export-blocks-format-ditaa nil)" + (unless (member block-spec org-export-blocks) + (setq org-export-blocks (cons block-spec org-export-blocks)) + (org-export-blocks-set 'org-export-blocks org-export-blocks))) (defcustom org-export-interblocks '((r org-export-interblocks-format-R) @@ -308,6 +319,7 @@ other backends, it converts the comment into an EXAMPLE segment." (defvar interblock-R-buffer nil "Holds the buffer for the current R process") +(defvar count) ; dynamicaly scoped from `org-export-blocks-preprocess'? (defun org-export-blocks-format-R (body &rest headers) "Process R blocks and replace \R{} forms outside the blocks with their values as determined by R."