ソースを参照

org-export: Silence byte-compiler

Nicolas Goaziou 12 年 前
コミット
0b89d5bcc6

+ 1 - 32
contrib/lisp/org-e-ascii.el

@@ -33,38 +33,7 @@
 ;;; Code:
 
 (eval-when-compile (require 'cl))
-
-(declare-function org-element-contents "org-element" (element))
-(declare-function org-element-property "org-element" (property element))
-(declare-function org-element-normalize-string "org-element" (s))
-(declare-function org-element-map "org-element"
-		  (data types fun &optional info first-match))
-
-(declare-function org-export-collect-footnote-definitions
-		  "org-export" (data info))
-(declare-function org-export-collect-headlines "org-export" (info &optional n))
-(declare-function org-export-collect-listings "org-export" (info))
-(declare-function org-export-collect-tables "org-export" (info))
-(declare-function org-export-data "org-export" (data info))
-(declare-function org-export-expand-macro "org-export" (macro info))
-(declare-function org-export-format-code-default "org-export" (element info))
-(declare-function org-export-get-coderef-format "org-export" (path desc))
-(declare-function org-export-get-footnote-number "org-export" (footnote info))
-(declare-function org-export-get-headline-number "org-export" (headline info))
-(declare-function org-export-get-ordinal "org-export"
-		  (element info &optional types predicate))
-(declare-function org-export-get-parent-headline "org-export" (blob))
-(declare-function org-export-get-relative-level "org-export" (headline info))
-(declare-function org-export-low-level-p "org-export" (headline info))
-(declare-function org-export-output-file-name "org-export"
-		  (extension &optional subtreep pub-dir))
-(declare-function org-export-resolve-coderef "org-export" (ref info))
-(declare-function org-export-resolve-fuzzy-link "org-export" (link info))
-(declare-function org-export-resolve-id-link "org-export" (link info))
-(declare-function org-export-resolve-radio-link "org-export" (link info))
-(declare-function
- org-export-to-file "org-export"
- (backend file &optional subtreep visible-only body-only ext-plist))
+(require 'org-export)
 
 
 ;;; Define Back-End

+ 2 - 36
contrib/lisp/org-e-latex.el

@@ -36,45 +36,11 @@
 ;;; Code:
 
 (eval-when-compile (require 'cl))
+(require 'org-export)
 
 (defvar org-export-latex-default-packages-alist)
 (defvar org-export-latex-packages-alist)
-
-(declare-function org-element-property "org-element" (property element))
-(declare-function org-element-normalize-string "org-element" (s))
-
-(declare-function org-export-data "org-export" (data info))
-(declare-function org-export-directory "org-export" (type plist))
-(declare-function org-export-expand-macro "org-export" (macro info))
-(declare-function org-export-first-sibling-p "org-export" (headline))
-(declare-function org-export-footnote-first-reference-p "org-export"
-		  (footnote-reference info))
-(declare-function org-export-format-code "org-export"
-		  (code fun &optional num-lines ref-alist))
-(declare-function org-export-format-code-default "org-export" (element info))
-(declare-function org-export-get-coderef-format "org-export" (path desc))
-(declare-function org-export-get-footnote-definition "org-export"
-		  (footnote-reference info))
-(declare-function org-export-get-footnote-number "org-export" (footnote info))
-(declare-function org-export-get-previous-element "org-export" (blob))
-(declare-function org-export-get-relative-level "org-export" (headline info))
-(declare-function org-export-unravel-code "org-export" (element))
-(declare-function org-export-inline-image-p "org-export"
-		  (link &optional extensions))
-(declare-function org-export-last-sibling-p "org-export" (headline))
-(declare-function org-export-low-level-p "org-export" (headline info))
-(declare-function org-export-output-file-name
-		  "org-export" (extension &optional subtreep pub-dir))
-(declare-function org-export-resolve-coderef "org-export" (ref info))
-(declare-function org-export-resolve-fuzzy-link "org-export" (link info))
-(declare-function org-export-resolve-radio-link "org-export" (link info))
-(declare-function org-export-solidify-link-text "org-export" (s))
-(declare-function
- org-export-to-buffer "org-export"
- (backend buffer &optional subtreep visible-only body-only ext-plist))
-(declare-function
- org-export-to-file "org-export"
- (backend file &optional subtreep visible-only body-only ext-plist))
+(defvar orgtbl-exp-regexp)
 
 
 

+ 2 - 14
contrib/lisp/org-e-publish.el

@@ -40,21 +40,9 @@
 
 (eval-when-compile (require 'cl))
 (require 'format-spec)
+(require 'org-export)
 
-(declare-function org-element-property "org-element" (property element))
-(declare-function org-element-map "org-element"
-		  (data types fun &optional info first-match))
-
-(declare-function org-export-output-file-name "org-export"
-		  (extension &optional subtreep pub-dir))
-(declare-function
- org-export-to-file "org-export"
- (backend file &optional subtreep visible-only body-only ext-plist))
-(declare-function org-export-get-parent-headline "org-export" (blob))
-(declare-function org-export-get-environment "org-export"
-		  (&optional backend subtreep ext-plist))
-(declare-function org-export-get-inbuffer-options "org-export"
-		  (&optional backend files))
+(declare-function org-e-latex-compile "org-e-latex" (texfile))
 
 
 

+ 214 - 213
contrib/lisp/org-element.el

@@ -113,6 +113,220 @@
 (require 'org)
 (declare-function org-inlinetask-goto-end "org-inlinetask" ())
 
+
+
+;;; Definitions And Rules
+;;
+;; Define elements, greater elements and specify recursive objects,
+;; along with the affiliated keywords recognized.  Also set up
+;; restrictions on recursive objects combinations.
+;;
+;; These variables really act as a control center for the parsing
+;; process.
+(defconst org-element-paragraph-separate
+  (concat "\f" "\\|" "^[ \t]*$" "\\|"
+	  ;; Headlines and inlinetasks.
+	  org-outline-regexp-bol "\\|"
+	  ;; Comments, blocks (any type), keywords and babel calls.
+	  "^[ \t]*#\\+" "\\|" "^#\\(?: \\|$\\)" "\\|"
+	  ;; Lists.
+	  (org-item-beginning-re) "\\|"
+	  ;; Fixed-width, drawers (any type) and tables.
+	  "^[ \t]*[:|]" "\\|"
+	  ;; Footnote definitions.
+	  org-footnote-definition-re "\\|"
+	  ;; Horizontal rules.
+	  "^[ \t]*-\\{5,\\}[ \t]*$" "\\|"
+	  ;; LaTeX environments.
+	  "^[ \t]*\\\\\\(begin\\|end\\)" "\\|"
+	  ;; Planning and Clock lines.
+	  "^[ \t]*\\(?:"
+	  org-clock-string "\\|"
+	  org-closed-string "\\|"
+	  org-deadline-string "\\|"
+	  org-scheduled-string "\\)")
+  "Regexp to separate paragraphs in an Org buffer.")
+
+(defconst org-element-all-elements
+  '(center-block clock comment comment-block drawer dynamic-block example-block
+		 export-block fixed-width footnote-definition headline
+		 horizontal-rule inlinetask item keyword latex-environment
+		 babel-call paragraph plain-list planning property-drawer
+		 quote-block quote-section section special-block src-block table
+		 table-row verse-block)
+  "Complete list of element types.")
+
+(defconst org-element-greater-elements
+  '(center-block drawer dynamic-block footnote-definition headline inlinetask
+		 item plain-list quote-block section special-block table)
+  "List of recursive element types aka Greater Elements.")
+
+(defconst org-element-all-successors
+  '(export-snippet footnote-reference inline-babel-call inline-src-block
+		   latex-or-entity line-break link macro radio-target
+		   statistics-cookie sub/superscript table-cell target
+		   text-markup timestamp)
+  "Complete list of successors.")
+
+(defconst org-element-object-successor-alist
+  '((subscript . sub/superscript) (superscript . sub/superscript)
+    (bold . text-markup) (code . text-markup) (italic . text-markup)
+    (strike-through . text-markup) (underline . text-markup)
+    (verbatim . text-markup) (entity . latex-or-entity)
+    (latex-fragment . latex-or-entity))
+  "Alist of translations between object type and successor name.
+
+Sharing the same successor comes handy when, for example, the
+regexp matching one object can also match the other object.")
+
+(defconst org-element-all-objects
+  '(bold code entity export-snippet footnote-reference inline-babel-call
+	 inline-src-block italic line-break latex-fragment link macro
+	 radio-target statistics-cookie strike-through subscript superscript
+	 table-cell target timestamp underline verbatim)
+  "Complete list of object types.")
+
+(defconst org-element-recursive-objects
+  '(bold italic link macro subscript radio-target strike-through superscript
+	 table-cell underline)
+  "List of recursive object types.")
+
+(defconst org-element-block-name-alist
+  '(("ASCII" . org-element-export-block-parser)
+    ("CENTER" . org-element-center-block-parser)
+    ("COMMENT" . org-element-comment-block-parser)
+    ("DOCBOOK" . org-element-export-block-parser)
+    ("EXAMPLE" . org-element-example-block-parser)
+    ("HTML" . org-element-export-block-parser)
+    ("LATEX" . org-element-export-block-parser)
+    ("ODT" . org-element-export-block-parser)
+    ("QUOTE" . org-element-quote-block-parser)
+    ("SRC" . org-element-src-block-parser)
+    ("VERSE" . org-element-verse-block-parser))
+  "Alist between block names and the associated parsing function.
+Names must be uppercase.  Any block whose name has no association
+is parsed with `org-element-special-block-parser'.")
+
+(defconst org-element-affiliated-keywords
+  '("CAPTION" "DATA" "HEADER" "HEADERS" "LABEL" "NAME" "PLOT" "RESNAME" "RESULT"
+    "RESULTS" "SOURCE" "SRCNAME" "TBLNAME")
+  "List of affiliated keywords as strings.
+By default, all keywords setting attributes (i.e. \"ATTR_LATEX\")
+are affiliated keywords and need not to be in this list.")
+
+(defconst org-element--affiliated-re
+  (format "[ \t]*#\\+%s:"
+	  ;; Regular affiliated keywords.
+	  (format "\\(%s\\|ATTR_[-_A-Za-z0-9]+\\)\\(?:\\[\\(.*\\)\\]\\)?"
+		  (regexp-opt org-element-affiliated-keywords)))
+  "Regexp matching any affiliated keyword.
+
+Keyword name is put in match group 1.  Moreover, if keyword
+belongs to `org-element-dual-keywords', put the dual value in
+match group 2.
+
+Don't modify it, set `org-element-affiliated-keywords' instead.")
+
+(defconst org-element-keyword-translation-alist
+  '(("DATA" . "NAME")  ("LABEL" . "NAME") ("RESNAME" . "NAME")
+    ("SOURCE" . "NAME") ("SRCNAME" . "NAME") ("TBLNAME" . "NAME")
+    ("RESULT" . "RESULTS") ("HEADERS" . "HEADER"))
+  "Alist of usual translations for keywords.
+The key is the old name and the value the new one.  The property
+holding their value will be named after the translated name.")
+
+(defconst org-element-multiple-keywords '("HEADER")
+  "List of affiliated keywords that can occur more that once in an element.
+
+Their value will be consed into a list of strings, which will be
+returned as the value of the property.
+
+This list is checked after translations have been applied.  See
+`org-element-keyword-translation-alist'.
+
+By default, all keywords setting attributes (i.e. \"ATTR_LATEX\")
+allow multiple occurrences and need not to be in this list.")
+
+(defconst org-element-parsed-keywords '("AUTHOR" "CAPTION" "DATE" "TITLE")
+  "List of keywords whose value can be parsed.
+
+Their value will be stored as a secondary string: a list of
+strings and objects.
+
+This list is checked after translations have been applied.  See
+`org-element-keyword-translation-alist'.")
+
+(defconst org-element-dual-keywords '("CAPTION" "RESULTS")
+  "List of keywords which can have a secondary value.
+
+In Org syntax, they can be written with optional square brackets
+before the colons.  For example, results keyword can be
+associated to a hash value with the following:
+
+  #+RESULTS[hash-string]: some-source
+
+This list is checked after translations have been applied.  See
+`org-element-keyword-translation-alist'.")
+
+(defconst org-element-object-restrictions
+  `((bold entity export-snippet inline-babel-call inline-src-block link
+	  radio-target sub/superscript target text-markup timestamp)
+    (footnote-reference entity export-snippet footnote-reference
+			inline-babel-call inline-src-block latex-fragment
+			line-break link macro radio-target sub/superscript
+			target text-markup timestamp)
+    (headline entity inline-babel-call inline-src-block latex-fragment link
+	      macro radio-target statistics-cookie sub/superscript target
+	      text-markup timestamp)
+    (inlinetask entity inline-babel-call inline-src-block latex-fragment link
+		macro radio-target sub/superscript target text-markup timestamp)
+    (italic entity export-snippet inline-babel-call inline-src-block link
+	    radio-target sub/superscript target text-markup timestamp)
+    (item entity footnote-reference inline-babel-call latex-fragment macro
+	  radio-target sub/superscript target text-markup)
+    (keyword entity latex-fragment macro sub/superscript text-markup)
+    (link entity export-snippet inline-babel-call inline-src-block
+	  latex-fragment link sub/superscript text-markup)
+    (macro macro)
+    (paragraph ,@org-element-all-successors)
+    (radio-target entity export-snippet latex-fragment sub/superscript)
+    (strike-through entity export-snippet inline-babel-call inline-src-block
+		    link radio-target sub/superscript target text-markup
+		    timestamp)
+    (subscript entity export-snippet inline-babel-call inline-src-block
+	       latex-fragment sub/superscript target text-markup)
+    (superscript entity export-snippet inline-babel-call inline-src-block
+		 latex-fragment sub/superscript target text-markup)
+    (table-cell entity export-snippet latex-fragment link macro radio-target
+		sub/superscript target text-markup timestamp)
+    (table-row table-cell)
+    (underline entity export-snippet inline-babel-call inline-src-block link
+	       radio-target sub/superscript target text-markup timestamp)
+    (verse-block entity footnote-reference inline-babel-call inline-src-block
+		 latex-fragment line-break link macro radio-target
+		 sub/superscript target text-markup timestamp))
+  "Alist of objects restrictions.
+
+CAR is an element or object type containing objects and CDR is
+a list of successors that will be called within an element or
+object of such type.
+
+For example, in a `radio-target' object, one can only find
+entities, export snippets, latex-fragments, subscript and
+superscript.
+
+This alist also applies to secondary string.  For example, an
+`headline' type element doesn't directly contain objects, but
+still has an entry since one of its properties (`:title') does.")
+
+(defconst org-element-secondary-value-alist
+  '((headline . :title)
+    (inlinetask . :title)
+    (item . :tag)
+    (footnote-reference . :inline-definition))
+  "Alist between element types and location of secondary value.")
+
+
 
 ;;; Greater elements
 ;;
@@ -2768,206 +2982,6 @@ CONTENTS is nil."
   (format "=%s=" (org-element-property :value verbatim)))
 
 
-
-;;; Definitions And Rules
-;;
-;; Define elements, greater elements and specify recursive objects,
-;; along with the affiliated keywords recognized.  Also set up
-;; restrictions on recursive objects combinations.
-;;
-;; These variables really act as a control center for the parsing
-;; process.
-(defconst org-element-paragraph-separate
-  (concat "\f" "\\|" "^[ \t]*$" "\\|"
-	  ;; Headlines and inlinetasks.
-	  org-outline-regexp-bol "\\|"
-	  ;; Comments, blocks (any type), keywords and babel calls.
-	  "^[ \t]*#\\+" "\\|" "^#\\(?: \\|$\\)" "\\|"
-	  ;; Lists.
-	  (org-item-beginning-re) "\\|"
-	  ;; Fixed-width, drawers (any type) and tables.
-	  "^[ \t]*[:|]" "\\|"
-	  ;; Footnote definitions.
-	  org-footnote-definition-re "\\|"
-	  ;; Horizontal rules.
-	  "^[ \t]*-\\{5,\\}[ \t]*$" "\\|"
-	  ;; LaTeX environments.
-	  "^[ \t]*\\\\\\(begin\\|end\\)" "\\|"
-	  ;; Planning and Clock lines.
-	  "^[ \t]*\\(?:"
-	  org-clock-string "\\|"
-	  org-closed-string "\\|"
-	  org-deadline-string "\\|"
-	  org-scheduled-string "\\)")
-  "Regexp to separate paragraphs in an Org buffer.")
-
-(defconst org-element-all-elements
-  '(center-block clock comment comment-block drawer dynamic-block example-block
-		 export-block fixed-width footnote-definition headline
-		 horizontal-rule inlinetask item keyword latex-environment
-		 babel-call paragraph plain-list planning property-drawer
-		 quote-block quote-section section special-block src-block table
-		 table-row verse-block)
-  "Complete list of element types.")
-
-(defconst org-element-greater-elements
-  '(center-block drawer dynamic-block footnote-definition headline inlinetask
-		 item plain-list quote-block section special-block table)
-  "List of recursive element types aka Greater Elements.")
-
-(defconst org-element-all-successors
-  '(export-snippet footnote-reference inline-babel-call inline-src-block
-		   latex-or-entity line-break link macro radio-target
-		   statistics-cookie sub/superscript table-cell target
-		   text-markup timestamp)
-  "Complete list of successors.")
-
-(defconst org-element-object-successor-alist
-  '((subscript . sub/superscript) (superscript . sub/superscript)
-    (bold . text-markup) (code . text-markup) (italic . text-markup)
-    (strike-through . text-markup) (underline . text-markup)
-    (verbatim . text-markup) (entity . latex-or-entity)
-    (latex-fragment . latex-or-entity))
-  "Alist of translations between object type and successor name.
-
-Sharing the same successor comes handy when, for example, the
-regexp matching one object can also match the other object.")
-
-(defconst org-element-all-objects
-  '(bold code entity export-snippet footnote-reference inline-babel-call
-	 inline-src-block italic line-break latex-fragment link macro
-	 radio-target statistics-cookie strike-through subscript superscript
-	 table-cell target timestamp underline verbatim)
-  "Complete list of object types.")
-
-(defconst org-element-recursive-objects
-  '(bold italic link macro subscript radio-target strike-through superscript
-	 table-cell underline)
-  "List of recursive object types.")
-
-(defconst org-element-block-name-alist
-  '(("ASCII" . org-element-export-block-parser)
-    ("CENTER" . org-element-center-block-parser)
-    ("COMMENT" . org-element-comment-block-parser)
-    ("DOCBOOK" . org-element-export-block-parser)
-    ("EXAMPLE" . org-element-example-block-parser)
-    ("HTML" . org-element-export-block-parser)
-    ("LATEX" . org-element-export-block-parser)
-    ("ODT" . org-element-export-block-parser)
-    ("QUOTE" . org-element-quote-block-parser)
-    ("SRC" . org-element-src-block-parser)
-    ("VERSE" . org-element-verse-block-parser))
-  "Alist between block names and the associated parsing function.
-Names must be uppercase.  Any block whose name has no association
-is parsed with `org-element-special-block-parser'.")
-
-(defconst org-element-affiliated-keywords
-  '("CAPTION" "DATA" "HEADER" "HEADERS" "LABEL" "NAME" "PLOT" "RESNAME" "RESULT"
-    "RESULTS" "SOURCE" "SRCNAME" "TBLNAME")
-  "List of affiliated keywords as strings.
-By default, all keywords setting attributes (i.e. \"ATTR_LATEX\")
-are affiliated keywords and need not to be in this list.")
-
-(defconst org-element-keyword-translation-alist
-  '(("DATA" . "NAME")  ("LABEL" . "NAME") ("RESNAME" . "NAME")
-    ("SOURCE" . "NAME") ("SRCNAME" . "NAME") ("TBLNAME" . "NAME")
-    ("RESULT" . "RESULTS") ("HEADERS" . "HEADER"))
-  "Alist of usual translations for keywords.
-The key is the old name and the value the new one.  The property
-holding their value will be named after the translated name.")
-
-(defconst org-element-multiple-keywords '("HEADER")
-  "List of affiliated keywords that can occur more that once in an element.
-
-Their value will be consed into a list of strings, which will be
-returned as the value of the property.
-
-This list is checked after translations have been applied.  See
-`org-element-keyword-translation-alist'.
-
-By default, all keywords setting attributes (i.e. \"ATTR_LATEX\")
-allow multiple occurrences and need not to be in this list.")
-
-(defconst org-element-parsed-keywords '("AUTHOR" "CAPTION" "DATE" "TITLE")
-  "List of keywords whose value can be parsed.
-
-Their value will be stored as a secondary string: a list of
-strings and objects.
-
-This list is checked after translations have been applied.  See
-`org-element-keyword-translation-alist'.")
-
-(defconst org-element-dual-keywords '("CAPTION" "RESULTS")
-  "List of keywords which can have a secondary value.
-
-In Org syntax, they can be written with optional square brackets
-before the colons.  For example, results keyword can be
-associated to a hash value with the following:
-
-  #+RESULTS[hash-string]: some-source
-
-This list is checked after translations have been applied.  See
-`org-element-keyword-translation-alist'.")
-
-(defconst org-element-object-restrictions
-  `((bold entity export-snippet inline-babel-call inline-src-block link
-	  radio-target sub/superscript target text-markup timestamp)
-    (footnote-reference entity export-snippet footnote-reference
-			inline-babel-call inline-src-block latex-fragment
-			line-break link macro radio-target sub/superscript
-			target text-markup timestamp)
-    (headline entity inline-babel-call inline-src-block latex-fragment link
-	      macro radio-target statistics-cookie sub/superscript target
-	      text-markup timestamp)
-    (inlinetask entity inline-babel-call inline-src-block latex-fragment link
-		macro radio-target sub/superscript target text-markup timestamp)
-    (italic entity export-snippet inline-babel-call inline-src-block link
-	    radio-target sub/superscript target text-markup timestamp)
-    (item entity footnote-reference inline-babel-call latex-fragment macro
-	  radio-target sub/superscript target text-markup)
-    (keyword entity latex-fragment macro sub/superscript text-markup)
-    (link entity export-snippet inline-babel-call inline-src-block
-	  latex-fragment link sub/superscript text-markup)
-    (macro macro)
-    (paragraph ,@org-element-all-successors)
-    (radio-target entity export-snippet latex-fragment sub/superscript)
-    (strike-through entity export-snippet inline-babel-call inline-src-block
-		    link radio-target sub/superscript target text-markup
-		    timestamp)
-    (subscript entity export-snippet inline-babel-call inline-src-block
-	       latex-fragment sub/superscript target text-markup)
-    (superscript entity export-snippet inline-babel-call inline-src-block
-		 latex-fragment sub/superscript target text-markup)
-    (table-cell entity export-snippet latex-fragment link macro radio-target
-		sub/superscript target text-markup timestamp)
-    (table-row table-cell)
-    (underline entity export-snippet inline-babel-call inline-src-block link
-	       radio-target sub/superscript target text-markup timestamp)
-    (verse-block entity footnote-reference inline-babel-call inline-src-block
-		 latex-fragment line-break link macro radio-target
-		 sub/superscript target text-markup timestamp))
-  "Alist of objects restrictions.
-
-CAR is an element or object type containing objects and CDR is
-a list of successors that will be called within an element or
-object of such type.
-
-For example, in a `radio-target' object, one can only find
-entities, export snippets, latex-fragments, subscript and
-superscript.
-
-This alist also applies to secondary string.  For example, an
-`headline' type element doesn't directly contain objects, but
-still has an entry since one of its properties (`:title') does.")
-
-(defconst org-element-secondary-value-alist
-  '((headline . :title)
-    (inlinetask . :title)
-    (item . :tag)
-    (footnote-reference . :inline-definition))
-  "Alist between element types and location of secondary value.")
-
-
 
 ;;; Accessors
 ;;
@@ -3161,19 +3175,6 @@ element it has to parse."
 ;;
 ;; A keyword may belong to more than one category.
 
-(defconst org-element--affiliated-re
-  (format "[ \t]*#\\+%s:"
-	  ;; Regular affiliated keywords.
-	  (format "\\(%s\\|ATTR_[-_A-Za-z0-9]+\\)\\(?:\\[\\(.*\\)\\]\\)?"
-		  (regexp-opt org-element-affiliated-keywords)))
-  "Regexp matching any affiliated keyword.
-
-Keyword name is put in match group 1.  Moreover, if keyword
-belongs to `org-element-dual-keywords', put the dual value in
-match group 2.
-
-Don't modify it, set `org-element-affiliated-keywords' instead.")
-
 (defun org-element-collect-affiliated-keywords
   (&optional key-re trans-list consed parsed duals)
   "Collect affiliated keywords before point.

+ 29 - 22
contrib/lisp/org-export.el

@@ -104,6 +104,27 @@
 (eval-when-compile (require 'cl))
 (require 'org-element)
 
+(declare-function org-e-ascii-export-to-ascii "org-e-ascii"
+		  (&optional subtreep visible-only body-only ext-plist pub-dir))
+(declare-function org-e-html-export-to-html "org-e-html"
+		  (&optional subtreep visible-only body-only ext-plist pub-dir))
+(declare-function org-e-latex-export-to-latex "org-e-latex"
+		  (&optional subtreep visible-only body-only ext-plist pub-dir))
+(declare-function org-e-latex-export-to-pdf "org-e-latex"
+		  (&optional subtreep visible-only body-only ext-plist pub-dir))
+(declare-function org-e-odt-export-to-odt "org-e-odt"
+		  (&optional subtreep visible-only body-only ext-plist pub-dir))
+(declare-function org-e-publish "org-e-publish" (project &optional force))
+(declare-function org-e-publish-all "org-e-publish" (&optional force))
+(declare-function org-e-publish-current-file "org-e-publish" (&optional force))
+(declare-function org-e-publish-current-project "org-e-publish"
+		  (&optional force))
+(declare-function org-export-blocks-preprocess "org-exp-blocks")
+
+(defvar org-e-publish-project-alist)
+(defvar org-table-number-fraction)
+(defvar org-table-number-regexp)
+
 
 
 ;;; Internal Variables
@@ -1072,7 +1093,7 @@ inferior to file-local settings."
     backend
     (and buffer-file-name (org-remove-double-quotes buffer-file-name)))
    ;; ... and from subtree, when appropriate.
-   (and subtreep (org-export-get-subtree-options))
+   (and subtreep (org-export-get-subtree-options backend))
    ;; Eventually install back-end symbol and its translation table.
    `(:back-end
      ,backend
@@ -1109,9 +1130,10 @@ specific items to read, if any."
 	  alist)
     plist))
 
-(defun org-export-get-subtree-options ()
+(defun org-export-get-subtree-options (&optional backend)
   "Get export options in subtree at point.
-Return options as a plist."
+Optional argument BACKEND is a symbol specifying back-end used
+for export.  Return options as a plist."
   (org-with-wide-buffer
    (let (prop plist)
      ;; Make sure point is at an heading.
@@ -1132,7 +1154,8 @@ Return options as a plist."
      (when (setq prop (org-entry-get (point) "EXPORT_DATE"))
        (setq plist (plist-put plist :date prop)))
      (when (setq prop (org-entry-get (point) "EXPORT_OPTIONS"))
-       (setq plist (org-export-add-options-to-plist plist prop)))
+       (setq plist
+	     (nconc plist (org-export-parse-option-keyword prop backend))))
      plist)))
 
 (defun org-export-get-inbuffer-options (&optional backend files)
@@ -1774,7 +1797,7 @@ a plist."
     (table (plist-get info :with-tables))
     (otherwise t)))
 
-(defsubst org-export-expand (blob contents)
+(defun org-export-expand (blob contents)
   "Expand a parsed element or object to its original state.
 BLOB is either an element or an object.  CONTENTS is its
 contents, as a string or nil."
@@ -4016,7 +4039,6 @@ Return an error if key pressed has no associated command."
       (?q nil)
       ;; Export with `e-ascii' back-end.
       ((?A ?N ?U)
-       (require 'org-e-ascii)
        (let ((outbuf
 	      (org-export-to-buffer
 	       'e-ascii "*Org E-ASCII Export*"
@@ -4027,13 +4049,11 @@ Return an error if key pressed has no associated command."
 	 (when org-export-show-temporary-export-buffer
 	   (switch-to-buffer-other-window outbuf))))
       ((?a ?n ?u)
-       (require 'org-e-ascii)
        (org-e-ascii-export-to-ascii
 	(memq 'subtree optns) (memq 'visible optns) (memq 'body optns)
 	`(:ascii-charset ,(case raw-key (?a 'ascii) (?n 'latin1) (t 'utf-8)))))
       ;; Export with `e-latex' back-end.
       (?L
-       (require 'org-e-latex)
        (let ((outbuf
 	      (org-export-to-buffer
 	       'e-latex "*Org E-LaTeX Export*"
@@ -4042,65 +4062,52 @@ Return an error if key pressed has no associated command."
 	 (when org-export-show-temporary-export-buffer
 	   (switch-to-buffer-other-window outbuf))))
       (?l
-       (require 'org-e-latex)
        (org-e-latex-export-to-latex
 	(memq 'subtree optns) (memq 'visible optns) (memq 'body optns)))
       (?p
-       (require 'org-e-latex)
        (org-e-latex-export-to-pdf
 	(memq 'subtree optns) (memq 'visible optns) (memq 'body optns)))
       (?d
-       (require 'org-e-latex)
        (org-open-file
 	(org-e-latex-export-to-pdf
 	 (memq 'subtree optns) (memq 'visible optns) (memq 'body optns))))
       ;; Export with `e-html' back-end.
       (?H
-       (require 'org-e-html)
        (let ((outbuf
 	      (org-export-to-buffer
 	       'e-html "*Org E-HTML Export*"
 	       (memq 'subtree optns) (memq 'visible optns) (memq 'body optns))))
 	 ;; set major mode
-	 (with-current-buffer outbuf
-	   (if (featurep 'nxhtml-mode) (nxhtml-mode) (nxml-mode)))
+	 (with-current-buffer outbuf (nxml-mode))
 	 (when org-export-show-temporary-export-buffer
 	   (switch-to-buffer-other-window outbuf))))
       (?h
-       (require 'org-e-html)
        (org-e-html-export-to-html
 	(memq 'subtree optns) (memq 'visible optns) (memq 'body optns)))
       (?b
-       (require 'org-e-html)
        (org-open-file
 	(org-e-html-export-to-html
 	 (memq 'subtree optns) (memq 'visible optns) (memq 'body optns))))
       ;; Export with `e-odt' back-end.
       (?o
-       (require 'org-e-odt)
        (org-e-odt-export-to-odt
 	(memq 'subtree optns) (memq 'visible optns) (memq 'body optns)))
       (?O
-       (require 'org-e-odt)
        (org-open-file
 	(org-e-odt-export-to-odt
 	 (memq 'subtree optns) (memq 'visible optns) (memq 'body optns))))
       ;; Publishing facilities
       (?F
-       (require 'org-e-publish)
        (org-e-publish-current-file (memq 'force optns)))
       (?P
-       (require 'org-e-publish)
        (org-e-publish-current-project (memq 'force optns)))
       (?X
-       (require 'org-e-publish)
        (let ((project
 	      (assoc (org-icompleting-read
 		      "Publish project: " org-e-publish-project-alist nil t)
 		     org-e-publish-project-alist)))
 	 (org-e-publish project (memq 'force optns))))
       (?E
-       (require 'org-e-publish)
        (org-e-publish-all (memq 'force optns)))
       ;; Undefined command.
       (t (error "No command associated with key %s"