浏览代码

org-export: Remove unnecessary back-end arguments

* contrib/lisp/org-e-ascii.el (org-e-ascii--build-title,
  org-e-ascii--build-caption, org-e-ascii--list-listings,
  org-e-ascii--list-tables, org-e-ascii--describe-links,
  org-e-ascii-template--document-title, org-e-ascii-dynamic-block,
  org-e-ascii-inlinetask, org-e-ascii-item, org-e-ascii-link,
  org-e-ascii-quote-section, org-e-ascii--table-cell-width): Do not
  provide back-end symbol.
* contrib/lisp/org-e-html.el (org-e-html--caption/label-string,
  org-e-html-footnote-section, org-e-html-template,
  org-e-html-dynamic-block, org-e-html-format-headline--wrap,
  org-e-html-headline, org-e-html-item, org-e-html-link,
  org-e-html-time-stamp): Do not provide back-end symbol.
* contrib/lisp/org-e-latex.el (org-e-latex--caption/label-string,
  org-e-latex-template, org-e-latex-dynamic-block,
  org-e-latex-footnote-reference, org-e-latex-headline,
  org-e-latex-inlinetask, org-e-latex-item, org-e-latex-link,
  org-e-latex-src-block): Do not provide back-end symbol.
* contrib/lisp/org-e-odt.el (org-e-odt-format-preamble,
  org-e-odt-format-label, org-e-odt-write-manifest-file,
  org-e-odt--caption/label-string, org-e-odt-dynamic-block,
  org-e-odt-format-headline--wrap, org-e-odt-headline, org-e-odt-item,
  org-e-odt-latex-environment, org-e-odt-link, org-e-odt-src-block,
  org-e-odt-time-stamp): Do not provide back-end symbol.
* contrib/lisp/org-export.el (org-export-get-environment): Provide
  back-end symbol under `:back-end' property.
(org-export-collect-tree-properties, org-export-data,
org-export-filter-verbatim-functions, org-export-install-filters,
org-export-as, org-export-expand-macro,
org-export-filter-apply-functions, org-export-secondary-string):
Remove back-end references.
* testing/lisp/test-org-export.el: Update tests.

Back-end can be found in communication channel with (plist-get
info :back-end).  Hence back-ends do not have to hard-code their name
in any transcoder.  It will allow to derive a back-end from another
one.
Nicolas Goaziou 13 年之前
父节点
当前提交
312e225685
共有 6 个文件被更改,包括 205 次插入270 次删除
  1. 27 35
      contrib/lisp/org-e-ascii.el
  2. 26 38
      contrib/lisp/org-e-html.el
  3. 21 32
      contrib/lisp/org-e-latex.el
  4. 36 46
      contrib/lisp/org-e-odt.el
  5. 40 52
      contrib/lisp/org-export.el
  6. 55 67
      testing/lisp/test-org-export.el

+ 27 - 35
contrib/lisp/org-e-ascii.el

@@ -42,13 +42,12 @@
 (declare-function org-element-time-stamp-interpreter
 (declare-function org-element-time-stamp-interpreter
 		  "org-element" (time-stamp contents))
 		  "org-element" (time-stamp contents))
 
 
-(declare-function org-export-clean-table "org-export" (table specialp))
 (declare-function org-export-collect-footnote-definitions
 (declare-function org-export-collect-footnote-definitions
 		  "org-export" (data info))
 		  "org-export" (data info))
 (declare-function org-export-collect-headlines "org-export" (info &optional n))
 (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-listings "org-export" (info))
 (declare-function org-export-collect-tables "org-export" (info))
 (declare-function org-export-collect-tables "org-export" (info))
-(declare-function org-export-data "org-export" (data backend info))
+(declare-function org-export-data "org-export" (data info))
 (declare-function org-export-expand-macro "org-export" (macro 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-format-code-default "org-export" (element info))
 (declare-function org-export-get-coderef-format "org-export" (path desc))
 (declare-function org-export-get-coderef-format "org-export" (path desc))
@@ -58,7 +57,6 @@
 		  (element info &optional types predicate))
 		  (element info &optional types predicate))
 (declare-function org-export-get-parent-headline "org-export" (blob info))
 (declare-function org-export-get-parent-headline "org-export" (blob info))
 (declare-function org-export-get-relative-level "org-export" (headline info))
 (declare-function org-export-get-relative-level "org-export" (headline info))
-(declare-function org-export-included-file "org-export" (keyword backend info))
 (declare-function org-export-low-level-p "org-export" (headline info))
 (declare-function org-export-low-level-p "org-export" (headline info))
 (declare-function org-export-output-file-name "org-export"
 (declare-function org-export-output-file-name "org-export"
 		  (extension &optional subtreep pub-dir))
 		  (extension &optional subtreep pub-dir))
@@ -66,9 +64,7 @@
 (declare-function org-export-resolve-fuzzy-link "org-export" (link 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-id-link "org-export" (link info))
 (declare-function org-export-resolve-ref-link "org-export" (link info))
 (declare-function org-export-resolve-ref-link "org-export" (link info))
-(declare-function org-export-secondary-string
-		  "org-export" (secondary backend info))
-(declare-function org-export-table-format-info "org-export" (table))
+(declare-function org-export-secondary-string "org-export" (secondary info))
 (declare-function
 (declare-function
  org-export-to-file "org-export"
  org-export-to-file "org-export"
  (backend file &optional subtreep visible-only body-only ext-plist))
  (backend file &optional subtreep visible-only body-only ext-plist))
@@ -592,13 +588,12 @@ title."
 		 (org-export-get-headline-number element info) ".")
 		 (org-export-get-headline-number element info) ".")
 		" ")))
 		" ")))
 	 (text (org-export-secondary-string
 	 (text (org-export-secondary-string
-		(org-element-property :title element) 'e-ascii info))
+		(org-element-property :title element) info))
 	 (todo
 	 (todo
 	  (and (plist-get info :with-todo-keywords)
 	  (and (plist-get info :with-todo-keywords)
 	       (let ((todo (org-element-property :todo-keyword element)))
 	       (let ((todo (org-element-property :todo-keyword element)))
 		 (and todo
 		 (and todo
-		      (concat (org-export-secondary-string todo 'e-ascii info)
-			      " ")))))
+		      (concat (org-export-secondary-string todo info) " ")))))
 	 (tags (and (not notags)
 	 (tags (and (not notags)
 		    (plist-get info :with-tags)
 		    (plist-get info :with-tags)
 		    (org-element-property :tags element)))
 		    (org-element-property :tags element)))
@@ -652,7 +647,7 @@ keyword."
 	 (format
 	 (format
 	  title-fmt reference
 	  title-fmt reference
 	  (if (not caption) name
 	  (if (not caption) name
-	    (org-export-secondary-string (car caption) 'e-ascii info)))
+	    (org-export-secondary-string (car caption) info)))
 	 (org-e-ascii--current-text-width element info) info)))))
 	 (org-e-ascii--current-text-width element info) info)))))
 
 
 (defun org-e-ascii--build-toc (info &optional n keyword)
 (defun org-e-ascii--build-toc (info &optional n keyword)
@@ -719,7 +714,7 @@ generation.  INFO is a plist used as a communication channel."
 		  (if (not caption) (org-element-property :name src-block)
 		  (if (not caption) (org-element-property :name src-block)
 		    (org-export-secondary-string
 		    (org-export-secondary-string
 		     ;; Use short name in priority, if available.
 		     ;; Use short name in priority, if available.
-		     (or (cdr caption) (car caption)) 'e-ascii info)))
+		     (or (cdr caption) (car caption)) info)))
 		(- text-width (length initial-text)) info)
 		(- text-width (length initial-text)) info)
 	       (length initial-text))))))
 	       (length initial-text))))))
 	(org-export-collect-listings info) "\n")))))
 	(org-export-collect-listings info) "\n")))))
@@ -758,7 +753,7 @@ generation.  INFO is a plist used as a communication channel."
 		  (if (not caption) (org-element-property :name table)
 		  (if (not caption) (org-element-property :name table)
 		    ;; Use short name in priority, if available.
 		    ;; Use short name in priority, if available.
 		    (org-export-secondary-string
 		    (org-export-secondary-string
-		     (or (cdr caption) (car caption)) 'e-ascii info)))
+		     (or (cdr caption) (car caption)) info)))
 		(- text-width (length initial-text)) info)
 		(- text-width (length initial-text)) info)
 	       (length initial-text))))))
 	       (length initial-text))))))
 	(org-export-collect-tables info) "\n")))))
 	(org-export-collect-tables info) "\n")))))
@@ -817,7 +812,7 @@ channel."
      (let ((type (org-element-property :type link))
      (let ((type (org-element-property :type link))
 	   (anchor (let ((desc (org-element-contents link)))
 	   (anchor (let ((desc (org-element-contents link)))
 		     (if (not desc) (org-element-property :raw-link link)
 		     (if (not desc) (org-element-property :raw-link link)
-		       (org-export-secondary-string desc 'e-ascii info)))))
+		       (org-export-secondary-string desc info)))))
        (cond
        (cond
 	;; Coderefs, radio links and fuzzy links are ignored.
 	;; Coderefs, radio links and fuzzy links are ignored.
 	((member type '("coderef" "radio" "fuzzy")) nil)
 	((member type '("coderef" "radio" "fuzzy")) nil)
@@ -855,16 +850,12 @@ channel."
   "Return document title, as a string.
   "Return document title, as a string.
 INFO is a plist used as a communication channel."
 INFO is a plist used as a communication channel."
   (let ((text-width org-e-ascii-text-width)
   (let ((text-width org-e-ascii-text-width)
-	(title (org-export-secondary-string
-		(plist-get info :title) 'e-ascii info))
-	(author
-	 (and (plist-get info :with-author)
-	      (let ((auth (plist-get info :author)))
-		(and auth (org-export-secondary-string auth 'e-ascii info)))))
-	(email
-	 (and (plist-get info :with-email)
-	      (org-export-secondary-string
-	       (plist-get info :email) 'e-ascii info)))
+	(title (org-export-secondary-string (plist-get info :title) info))
+	(author (and (plist-get info :with-author)
+		     (let ((auth (plist-get info :author)))
+		       (and auth (org-export-secondary-string auth info)))))
+	(email (and (plist-get info :with-email)
+		    (org-export-secondary-string (plist-get info :email) info)))
 	(date (plist-get info :date)))
 	(date (plist-get info :date)))
     ;; There are two types of title blocks depending on the presence
     ;; There are two types of title blocks depending on the presence
     ;; of a title to display.
     ;; of a title to display.
@@ -968,13 +959,13 @@ holding export options."
 			;; take it into consideration.
 			;; take it into consideration.
 			(let ((first (car (org-element-contents def))))
 			(let ((first (car (org-element-contents def))))
 			  (if (not (eq (org-element-type first) 'paragraph))
 			  (if (not (eq (org-element-type first) 'paragraph))
-			      (concat id "\n" (org-export-data def 'e-ascii info))
+			      (concat id "\n" (org-export-data def info))
 			    (push id (nthcdr 2 first))
 			    (push id (nthcdr 2 first))
-			    (org-export-data def 'e-ascii info)))
+			    (org-export-data def info)))
 		      ;; Fill paragraph once footnote ID is inserted in
 		      ;; Fill paragraph once footnote ID is inserted in
 		      ;; order to have a correct length for first line.
 		      ;; order to have a correct length for first line.
 		      (org-e-ascii--fill-string
 		      (org-e-ascii--fill-string
-		       (concat id (org-export-secondary-string def 'e-ascii info))
+		       (concat id (org-export-secondary-string def info))
 		       text-width info))))))
 		       text-width info))))))
 	     definitions "\n\n"))))
 	     definitions "\n\n"))))
        ;; 5. Creator.  Ignore `comment' value as there are no comments in
        ;; 5. Creator.  Ignore `comment' value as there are no comments in
@@ -1049,8 +1040,7 @@ holding contextual information."
 (defun org-e-ascii-dynamic-block (dynamic-block contents info)
 (defun org-e-ascii-dynamic-block (dynamic-block contents info)
   "Transcode a DYNAMIC-BLOCK element from Org to ASCII.
   "Transcode a DYNAMIC-BLOCK element from Org to ASCII.
 CONTENTS holds the contents of the block.  INFO is a plist
 CONTENTS holds the contents of the block.  INFO is a plist
-holding contextual information.  See
-`org-export-data'."
+holding contextual information.  See `org-export-data'."
   contents)
   contents)
 
 
 
 
@@ -1218,12 +1208,12 @@ CONTENTS holds the contents of the block.  INFO is a plist
 holding contextual information."
 holding contextual information."
   (let ((width (org-e-ascii--current-text-width inlinetask info))
   (let ((width (org-e-ascii--current-text-width inlinetask info))
 	(title (org-export-secondary-string
 	(title (org-export-secondary-string
-		(org-element-property :title inlinetask) 'e-ascii info))
+		(org-element-property :title inlinetask) info))
 	(todo (and (plist-get info :with-todo-keywords)
 	(todo (and (plist-get info :with-todo-keywords)
 		   (let ((todo (org-element-property
 		   (let ((todo (org-element-property
 				:todo-keyword inlinetask)))
 				:todo-keyword inlinetask)))
 		     (and todo
 		     (and todo
-			  (org-export-secondary-string todo 'e-ascii info)))))
+			  (org-export-secondary-string todo info)))))
 	(todo-type (org-element-property :todo-type inlinetask))
 	(todo-type (org-element-property :todo-type inlinetask))
 	(tags (and (plist-get info :with-tags)
 	(tags (and (plist-get info :with-tags)
 		   (org-element-property :tags inlinetask)))
 		   (org-element-property :tags inlinetask)))
@@ -1244,7 +1234,7 @@ holding contextual information."
 	  ;; Add title.  Fill it if wider than inlinetask.
 	  ;; Add title.  Fill it if wider than inlinetask.
 	  (let ((title (org-e-ascii--build-title inlinetask info width)))
 	  (let ((title (org-e-ascii--build-title inlinetask info width)))
 	    (if (<= (length title) width) title
 	    (if (<= (length title) width) title
-		(org-e-ascii--fill-string title width info)))
+	      (org-e-ascii--fill-string title width info)))
 	  "\n"
 	  "\n"
 	  ;; If CONTENTS is not empty, insert it along with
 	  ;; If CONTENTS is not empty, insert it along with
 	  ;; a separator.
 	  ;; a separator.
@@ -1273,7 +1263,8 @@ contextual information."
 	    (descriptive
 	    (descriptive
 	     (concat
 	     (concat
 	      (org-export-secondary-string
 	      (org-export-secondary-string
-	       (org-element-property :tag item) 'e-ascii info) ": "))
+	       (org-element-property :tag item) info)
+	      ": "))
 	    (ordered
 	    (ordered
 	     ;; Return correct number for ITEM, paying attention to
 	     ;; Return correct number for ITEM, paying attention to
 	     ;; counters.
 	     ;; counters.
@@ -1378,7 +1369,7 @@ INFO is a plist holding contextual information."
        (org-element-parse-secondary-string
        (org-element-parse-secondary-string
 	(org-element-property :path link)
 	(org-element-property :path link)
 	(cdr (assq 'radio-target org-element-object-restrictions)))
 	(cdr (assq 'radio-target org-element-object-restrictions)))
-       'e-ascii info))
+       info))
      ;; Do not apply a special syntax on fuzzy links pointing to
      ;; Do not apply a special syntax on fuzzy links pointing to
      ;; targets.
      ;; targets.
      ((string= type "fuzzy")
      ((string= type "fuzzy")
@@ -1488,7 +1479,8 @@ CONTENTS is nil.  INFO is a plist holding contextual information."
 	(value
 	(value
 	 (org-export-secondary-string
 	 (org-export-secondary-string
 	  (org-remove-indentation
 	  (org-remove-indentation
-	   (org-element-property :value quote-section)) 'e-ascii info)))
+	   (org-element-property :value quote-section))
+	  info)))
     (org-e-ascii--indent-string
     (org-e-ascii--indent-string
      value
      value
      (+ org-e-ascii-quote-margin
      (+ org-e-ascii-quote-margin
@@ -1624,7 +1616,7 @@ are ignored. "
 			(elt (if specialp (car (org-element-contents row))
 			(elt (if specialp (car (org-element-contents row))
 			       (org-element-contents row))
 			       (org-element-contents row))
 			     col)
 			     col)
-			(plist-get info :back-end) info))
+			info))
 		      max-width))))
 		      max-width))))
 	max-width)))
 	max-width)))
 
 

+ 26 - 38
contrib/lisp/org-e-html.el

@@ -49,8 +49,7 @@
 (defvar org-element-string-restrictions)
 (defvar org-element-string-restrictions)
 (defvar org-element-object-restrictions)
 (defvar org-element-object-restrictions)
 
 
-(declare-function org-export-clean-table "org-export" (table specialp))
-(declare-function org-export-data "org-export" (data backend info))
+(declare-function org-export-data "org-export" (data info))
 (declare-function org-export-directory "org-export" (type plist))
 (declare-function org-export-directory "org-export" (type plist))
 (declare-function org-export-expand-macro "org-export" (macro info))
 (declare-function org-export-expand-macro "org-export" (macro info))
 (declare-function org-export-first-sibling-p "org-export" (headline info))
 (declare-function org-export-first-sibling-p "org-export" (headline info))
@@ -64,7 +63,6 @@
 (declare-function org-export-get-relative-level "org-export" (headline info))
 (declare-function org-export-get-relative-level "org-export" (headline info))
 (declare-function org-export-handle-code
 (declare-function org-export-handle-code
 		  "org-export" (element info &optional num-fmt ref-fmt delayed))
 		  "org-export" (element info &optional num-fmt ref-fmt delayed))
-(declare-function org-export-included-file "org-export" (keyword backend info))
 (declare-function org-export-inline-image-p "org-export"
 (declare-function org-export-inline-image-p "org-export"
 		  (link &optional extensions))
 		  (link &optional extensions))
 (declare-function org-export-last-sibling-p "org-export" (headline info))
 (declare-function org-export-last-sibling-p "org-export" (headline info))
@@ -73,10 +71,8 @@
 		  "org-export" (extension &optional subtreep pub-dir))
 		  "org-export" (extension &optional subtreep pub-dir))
 (declare-function org-export-resolve-coderef "org-export" (ref info))
 (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-fuzzy-link "org-export" (link info))
-(declare-function org-export-secondary-string "org-export"
-		  (secondary backend info))
+(declare-function org-export-secondary-string "org-export" (secondary info))
 (declare-function org-export-solidify-link-text "org-export" (s))
 (declare-function org-export-solidify-link-text "org-export" (s))
-(declare-function org-export-table-format-info "org-export" (table))
 (declare-function
 (declare-function
  org-export-to-buffer "org-export"
  org-export-to-buffer "org-export"
  (backend buffer &optional subtreep visible-only body-only ext-plist))
  (backend buffer &optional subtreep visible-only body-only ext-plist))
@@ -1365,10 +1361,10 @@ Replaces invalid characters with \"_\"."
 	 (fn-alist
 	 (fn-alist
 	  (loop for (n type raw) in fn-alist collect
 	  (loop for (n type raw) in fn-alist collect
 		(cons n (if (equal (org-element-type raw) 'org-data)
 		(cons n (if (equal (org-element-type raw) 'org-data)
-			    (org-trim (org-export-data raw 'e-html info))
+			    (org-trim (org-export-data raw info))
 			  (format "<p>%s</p>"
 			  (format "<p>%s</p>"
-				  (org-trim (org-export-secondary-string
-					     raw 'e-html info))))))))
+				  (org-trim
+				   (org-export-secondary-string raw info))))))))
     (when fn-alist
     (when fn-alist
       (org-e-html-format-footnotes-section
       (org-e-html-format-footnotes-section
        (nth 4 (or (assoc (plist-get info :language)
        (nth 4 (or (assoc (plist-get info :language)
@@ -1410,15 +1406,15 @@ For non-floats, see `org-e-html--wrap-label'."
      ;; Option caption format with short name.
      ;; Option caption format with short name.
      ((cdr caption)
      ((cdr caption)
       (format "\\caption[%s]{%s%s}\n"
       (format "\\caption[%s]{%s%s}\n"
-	      (org-export-secondary-string (cdr caption) 'e-html info)
+	      (org-export-secondary-string (cdr caption) info)
 	      label-str
 	      label-str
-	      (org-export-secondary-string (car caption) 'e-html info)))
+	      (org-export-secondary-string (car caption) info)))
      ;; Standard caption format.
      ;; Standard caption format.
      ;; (t (format "\\caption{%s%s}\n"
      ;; (t (format "\\caption{%s%s}\n"
      ;; 		label-str
      ;; 		label-str
-     ;; 		(org-export-secondary-string (car caption) 'e-html info)))
+     ;; 		(org-export-secondary-string (car caption) info)))
 
 
-     (t (org-export-secondary-string (car caption) 'e-html info)))))
+     (t (org-export-secondary-string (car caption) info)))))
 
 
 (defun org-e-html--find-verb-separator (s)
 (defun org-e-html--find-verb-separator (s)
   "Return a character not used in string S.
   "Return a character not used in string S.
@@ -1457,12 +1453,10 @@ This function shouldn't be used for floats.  See
 ;;; Template
 ;;; Template
 
 
 (defun org-e-html-meta-info (info)
 (defun org-e-html-meta-info (info)
-  (let* ((title (org-export-secondary-string
-		 (plist-get info :title) 'e-html info))
+  (let* ((title (org-export-secondary-string (plist-get info :title) info))
 	 (author (and (plist-get info :with-author)
 	 (author (and (plist-get info :with-author)
 		      (let ((auth (plist-get info :author)))
 		      (let ((auth (plist-get info :author)))
-			(and auth (org-export-secondary-string
-				   auth 'e-html info)))))
+			(and auth (org-export-secondary-string auth info)))))
 	 (description (plist-get info :description))
 	 (description (plist-get info :description))
 	 (keywords (plist-get info :keywords)))
 	 (keywords (plist-get info :keywords)))
     (concat
     (concat
@@ -1524,11 +1518,9 @@ This function shouldn't be used for floats.  See
 
 
 (defun org-e-html-preamble (info)
 (defun org-e-html-preamble (info)
   (when (plist-get info :html-preamble)
   (when (plist-get info :html-preamble)
-    (let* ((title (org-export-secondary-string
-		   (plist-get info :title) 'e-html info))
+    (let* ((title (org-export-secondary-string (plist-get info :title) info))
 	   (date (org-e-html-format-date info))
 	   (date (org-e-html-format-date info))
-	   (author (org-export-secondary-string
-		    (plist-get info :author) 'e-html info))
+	   (author (org-export-secondary-string (plist-get info :author) info))
 	   (lang-words (or (assoc (plist-get info :language)
 	   (lang-words (or (assoc (plist-get info :language)
 				  org-export-language-setup)
 				  org-export-language-setup)
 			   (assoc "en" org-export-language-setup)))
 			   (assoc "en" org-export-language-setup)))
@@ -1678,7 +1670,7 @@ original parsed data.  INFO is a plist holding export options."
    ;; document title
    ;; document title
    (format "
    (format "
 <h1 class=\"title\">%s</h1>\n" (org-export-secondary-string
 <h1 class=\"title\">%s</h1>\n" (org-export-secondary-string
-				  (plist-get info :title) 'e-html info))
+				(plist-get info :title) info))
    ;; table of contents
    ;; table of contents
    (let ((depth (plist-get info :with-toc)))
    (let ((depth (plist-get info :with-toc)))
      (when (wholenump depth) (org-e-html-toc depth info)))
      (when (wholenump depth) (org-e-html-toc depth info)))
@@ -1880,8 +1872,7 @@ holding contextual information."
 (defun org-e-html-dynamic-block (dynamic-block contents info)
 (defun org-e-html-dynamic-block (dynamic-block contents info)
   "Transcode a DYNAMIC-BLOCK element from Org to HTML.
   "Transcode a DYNAMIC-BLOCK element from Org to HTML.
 CONTENTS holds the contents of the block.  INFO is a plist
 CONTENTS holds the contents of the block.  INFO is a plist
-holding contextual information.  See
-`org-export-data'."
+holding contextual information.  See `org-export-data'."
   (org-e-html--wrap-label dynamic-block contents))
   (org-e-html--wrap-label dynamic-block contents))
 
 
 
 
@@ -2015,12 +2006,12 @@ holding contextual information."
 		    (let ((todo (org-element-property
 		    (let ((todo (org-element-property
 				 :todo-keyword headline)))
 				 :todo-keyword headline)))
 		      (and todo
 		      (and todo
-			   (org-export-secondary-string todo 'e-html info)))))
+			   (org-export-secondary-string todo info)))))
 	 (todo-type (and todo (org-element-property :todo-type headline)))
 	 (todo-type (and todo (org-element-property :todo-type headline)))
 	 (priority (and (plist-get info :with-priority)
 	 (priority (and (plist-get info :with-priority)
 			(org-element-property :priority headline)))
 			(org-element-property :priority headline)))
 	 (text (org-export-secondary-string
 	 (text (org-export-secondary-string
-		(org-element-property :title headline) 'e-html info))
+		(org-element-property :title headline) info))
 	 (tags (and (plist-get info :with-tags)
 	 (tags (and (plist-get info :with-tags)
 		    (org-element-property :tags headline)))
 		    (org-element-property :tags headline)))
 	 (headline-label (concat "sec-" (mapconcat 'number-to-string
 	 (headline-label (concat "sec-" (mapconcat 'number-to-string
@@ -2046,12 +2037,11 @@ holding contextual information."
   (let* ((numberedp (org-export-numbered-headline-p headline info))
   (let* ((numberedp (org-export-numbered-headline-p headline info))
 	 (level (org-export-get-relative-level headline info))
 	 (level (org-export-get-relative-level headline info))
 	 (text (org-export-secondary-string
 	 (text (org-export-secondary-string
-		(org-element-property :title headline) 'e-html info))
+		(org-element-property :title headline) info))
 	 (todo (and (plist-get info :with-todo-keywords)
 	 (todo (and (plist-get info :with-todo-keywords)
 		    (let ((todo (org-element-property
 		    (let ((todo (org-element-property
 				 :todo-keyword headline)))
 				 :todo-keyword headline)))
-		      (and todo
-			   (org-export-secondary-string todo 'e-html info)))))
+		      (and todo (org-export-secondary-string todo info)))))
 	 (todo-type (and todo (org-element-property :todo-type headline)))
 	 (todo-type (and todo (org-element-property :todo-type headline)))
 	 (tags (and (plist-get info :with-tags)
 	 (tags (and (plist-get info :with-tags)
 		    (org-element-property :tags headline)))
 		    (org-element-property :tags headline)))
@@ -2210,7 +2200,7 @@ contextual information."
 	 (counter (org-element-property :counter item))
 	 (counter (org-element-property :counter item))
 	 (checkbox (org-element-property :checkbox item))
 	 (checkbox (org-element-property :checkbox item))
 	 (tag (let ((tag (org-element-property :tag item)))
 	 (tag (let ((tag (org-element-property :tag item)))
-		(and tag (org-export-secondary-string tag 'e-html info)))))
+		(and tag (org-export-secondary-string tag info)))))
     (org-e-html-format-list-item
     (org-e-html-format-list-item
      contents type checkbox (or tag counter))))
      contents type checkbox (or tag counter))))
 
 
@@ -2429,7 +2419,7 @@ INFO is a plist holding contextual information.  See
 	      (org-export-secondary-string
 	      (org-export-secondary-string
 	       (org-element-parse-secondary-string
 	       (org-element-parse-secondary-string
 		path (org-element-restriction 'radio-target))
 		path (org-element-restriction 'radio-target))
-	       'e-html info)))
+	       info)))
      ;; Links pointing to an headline: Find destination and build
      ;; Links pointing to an headline: Find destination and build
      ;; appropriate referencing command.
      ;; appropriate referencing command.
      ((member type '("custom-id" "fuzzy" "id"))
      ((member type '("custom-id" "fuzzy" "id"))
@@ -2440,9 +2430,9 @@ INFO is a plist holding contextual information.  See
 	  ;; Fuzzy link points nowhere.
 	  ;; Fuzzy link points nowhere.
 	  ('nil
 	  ('nil
 	   (format "<i>%s</i>"
 	   (format "<i>%s</i>"
-		   (or desc (org-export-secondary-string
-			     (org-element-property :raw-link link)
-			     'e-html info))))
+		   (or desc
+		       (org-export-secondary-string
+			(org-element-property :raw-link link) info))))
 	  ;; Fuzzy link points to an invisible target.
 	  ;; Fuzzy link points to an invisible target.
 	  (keyword nil)
 	  (keyword nil)
 	  ;; LINK points to an headline.  If headlines are numbered
 	  ;; LINK points to an headline.  If headlines are numbered
@@ -2459,8 +2449,7 @@ INFO is a plist holding contextual information.  See
 		    (desc desc)
 		    (desc desc)
 		    ((plist-get info :section-numbers) section-no)
 		    ((plist-get info :section-numbers) section-no)
 		    (t (org-export-secondary-string
 		    (t (org-export-secondary-string
-			(org-element-property :title destination)
-			'e-html info))))
+			(org-element-property :title destination) info))))
 	     (format "<a href=\"#%s\">%s</a>" label desc)))
 	     (format "<a href=\"#%s\">%s</a>" label desc)))
           ;; Fuzzy link points to a target.  Do as above.
           ;; Fuzzy link points to a target.  Do as above.
 	  (otherwise
 	  (otherwise
@@ -2923,8 +2912,7 @@ information."
   (let ((value (org-element-property :value time-stamp))
   (let ((value (org-element-property :value time-stamp))
         (type (org-element-property :type time-stamp))
         (type (org-element-property :type time-stamp))
         (appt-type (org-element-property :appt-type time-stamp)))
         (appt-type (org-element-property :appt-type time-stamp)))
-    (setq value (org-translate-time
-		 (org-export-secondary-string value 'e-html info)))
+    (setq value (org-translate-time (org-export-secondary-string value info)))
     (setq appt-type (case appt-type
     (setq appt-type (case appt-type
 		      (scheduled org-scheduled-string)
 		      (scheduled org-scheduled-string)
 		      (deadline org-deadline-string)
 		      (deadline org-deadline-string)

+ 21 - 32
contrib/lisp/org-e-latex.el

@@ -47,8 +47,7 @@
 (defvar org-element-string-restrictions)
 (defvar org-element-string-restrictions)
 (defvar org-element-object-restrictions)
 (defvar org-element-object-restrictions)
 
 
-(declare-function org-export-clean-table "org-export" (table specialp))
-(declare-function org-export-data "org-export" (data backend info))
+(declare-function org-export-data "org-export" (data info))
 (declare-function org-export-directory "org-export" (type plist))
 (declare-function org-export-directory "org-export" (type plist))
 (declare-function org-export-expand-macro "org-export" (macro info))
 (declare-function org-export-expand-macro "org-export" (macro info))
 (declare-function org-export-first-sibling-p "org-export" (headline info))
 (declare-function org-export-first-sibling-p "org-export" (headline info))
@@ -64,7 +63,6 @@
 (declare-function org-export-get-previous-element "org-export" (blob info))
 (declare-function org-export-get-previous-element "org-export" (blob info))
 (declare-function org-export-get-relative-level "org-export" (headline info))
 (declare-function org-export-get-relative-level "org-export" (headline info))
 (declare-function org-export-unravel-code "org-export" (element))
 (declare-function org-export-unravel-code "org-export" (element))
-(declare-function org-export-included-file "org-export" (keyword backend info))
 (declare-function org-export-inline-image-p "org-export"
 (declare-function org-export-inline-image-p "org-export"
 		  (link &optional extensions))
 		  (link &optional extensions))
 (declare-function org-export-last-sibling-p "org-export" (headline info))
 (declare-function org-export-last-sibling-p "org-export" (headline info))
@@ -73,10 +71,8 @@
 		  "org-export" (extension &optional subtreep pub-dir))
 		  "org-export" (extension &optional subtreep pub-dir))
 (declare-function org-export-resolve-coderef "org-export" (ref info))
 (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-fuzzy-link "org-export" (link info))
-(declare-function org-export-secondary-string "org-export"
-		  (secondary backend info))
+(declare-function org-export-secondary-string "org-export" (secondary info))
 (declare-function org-export-solidify-link-text "org-export" (s))
 (declare-function org-export-solidify-link-text "org-export" (s))
-(declare-function org-export-table-format-info "org-export" (table))
 (declare-function
 (declare-function
  org-export-to-buffer "org-export"
  org-export-to-buffer "org-export"
  (backend buffer &optional subtreep visible-only body-only ext-plist))
  (backend buffer &optional subtreep visible-only body-only ext-plist))
@@ -746,13 +742,13 @@ For non-floats, see `org-e-latex--wrap-label'."
      ;; Option caption format with short name.
      ;; Option caption format with short name.
      ((cdr caption)
      ((cdr caption)
       (format "\\caption[%s]{%s%s}\n"
       (format "\\caption[%s]{%s%s}\n"
-	      (org-export-secondary-string (cdr caption) 'e-latex info)
+	      (org-export-secondary-string (cdr caption) info)
 	      label-str
 	      label-str
-	      (org-export-secondary-string (car caption) 'e-latex info)))
+	      (org-export-secondary-string (car caption) info)))
      ;; Standard caption format.
      ;; Standard caption format.
      (t (format "\\caption{%s%s}\n"
      (t (format "\\caption{%s%s}\n"
 		label-str
 		label-str
-		(org-export-secondary-string (car caption) 'e-latex info))))))
+		(org-export-secondary-string (car caption) info))))))
 
 
 (defun org-e-latex--guess-inputenc (header)
 (defun org-e-latex--guess-inputenc (header)
   "Set the coding system in inputenc to what the buffer is.
   "Set the coding system in inputenc to what the buffer is.
@@ -822,8 +818,7 @@ This function shouldn't be used for floats.  See
   "Return complete document string after LaTeX conversion.
   "Return complete document string after LaTeX conversion.
 CONTENTS is the transcoded contents string.  INFO is a plist
 CONTENTS is the transcoded contents string.  INFO is a plist
 holding export options."
 holding export options."
-  (let ((title (org-export-secondary-string
-		(plist-get info :title) 'e-latex info)))
+  (let ((title (org-export-secondary-string (plist-get info :title) info)))
     (concat
     (concat
      ;; 1. Time-stamp.
      ;; 1. Time-stamp.
      (and (plist-get info :time-stamp-file)
      (and (plist-get info :time-stamp-file)
@@ -855,11 +850,10 @@ holding export options."
      ;; 5. Author.
      ;; 5. Author.
      (let ((author (and (plist-get info :with-author)
      (let ((author (and (plist-get info :with-author)
 			(let ((auth (plist-get info :author)))
 			(let ((auth (plist-get info :author)))
-			  (and auth (org-export-secondary-string
-				     auth 'e-latex info)))))
+			  (and auth (org-export-secondary-string auth info)))))
 	   (email (and (plist-get info :with-email)
 	   (email (and (plist-get info :with-email)
 		       (org-export-secondary-string
 		       (org-export-secondary-string
-			(plist-get info :email) 'e-latex info))))
+			(plist-get info :email) info))))
        (cond ((and author email (not (string= "" email)))
        (cond ((and author email (not (string= "" email)))
 	      (format "\\author{%s\\thanks{%s}}\n" author email))
 	      (format "\\author{%s\\thanks{%s}}\n" author email))
 	     (author (format "\\author{%s}\n" author))
 	     (author (format "\\author{%s}\n" author))
@@ -949,8 +943,7 @@ holding contextual information."
 (defun org-e-latex-dynamic-block (dynamic-block contents info)
 (defun org-e-latex-dynamic-block (dynamic-block contents info)
   "Transcode a DYNAMIC-BLOCK element from Org to LaTeX.
   "Transcode a DYNAMIC-BLOCK element from Org to LaTeX.
 CONTENTS holds the contents of the block.  INFO is a plist
 CONTENTS holds the contents of the block.  INFO is a plist
-holding contextual information.  See
-`org-export-data'."
+holding contextual information.  See `org-export-data'."
   (org-e-latex--wrap-label dynamic-block contents))
   (org-e-latex--wrap-label dynamic-block contents))
 
 
 
 
@@ -1051,7 +1044,7 @@ CONTENTS is nil.  INFO is a plist holding contextual information."
        (unless (eq (org-element-type def) 'org-data)
        (unless (eq (org-element-type def) 'org-data)
 	 (setq def (cons 'org-data (cons nil def))))
 	 (setq def (cons 'org-data (cons nil def))))
        (concat
        (concat
-	(format "\\footnote{%s}" (org-trim (org-export-data def 'e-latex info)))
+	(format "\\footnote{%s}" (org-trim (org-export-data def info)))
 	;; Retrieve all footnote references within the footnote and
 	;; Retrieve all footnote references within the footnote and
 	;; add their definition after it, since LaTeX doesn't support
 	;; add their definition after it, since LaTeX doesn't support
 	;; them inside.
 	;; them inside.
@@ -1081,7 +1074,7 @@ CONTENTS is nil.  INFO is a plist holding contextual information."
 		(if (eq (org-element-property :type ref) 'inline)
 		(if (eq (org-element-property :type ref) 'inline)
 		    'org-export-secondary-string
 		    'org-export-secondary-string
 		  'org-export-data)
 		  'org-export-data)
-		(org-export-get-footnote-definition ref info) 'e-latex info))))
+		(org-export-get-footnote-definition ref info) info))))
 	   (funcall search-refs def) ""))))))))
 	   (funcall search-refs def) ""))))))))
 
 
 
 
@@ -1118,11 +1111,11 @@ holding contextual information."
 	      (if numberedp (concat (car sec) "\n%s" (nth 1 sec))
 	      (if numberedp (concat (car sec) "\n%s" (nth 1 sec))
 		(concat (nth 2 sec) "\n%s" (nth 3 sec)))))))
 		(concat (nth 2 sec) "\n%s" (nth 3 sec)))))))
 	 (text (org-export-secondary-string
 	 (text (org-export-secondary-string
-		(org-element-property :title headline) 'e-latex info))
+		(org-element-property :title headline) info))
 	 (todo
 	 (todo
 	  (and (plist-get info :with-todo-keywords)
 	  (and (plist-get info :with-todo-keywords)
 	       (let ((todo (org-element-property :todo-keyword headline)))
 	       (let ((todo (org-element-property :todo-keyword headline)))
-		 (and todo (org-export-secondary-string todo 'e-latex info)))))
+		 (and todo (org-export-secondary-string todo info)))))
 	 (todo-type (and todo (org-element-property :todo-type headline)))
 	 (todo-type (and todo (org-element-property :todo-type headline)))
 	 (tags (and (plist-get info :with-tags)
 	 (tags (and (plist-get info :with-tags)
 		    (org-element-property :tags headline)))
 		    (org-element-property :tags headline)))
@@ -1237,12 +1230,12 @@ contextual information."
 CONTENTS holds the contents of the block.  INFO is a plist
 CONTENTS holds the contents of the block.  INFO is a plist
 holding contextual information."
 holding contextual information."
   (let ((title (org-export-secondary-string
   (let ((title (org-export-secondary-string
-	       (org-element-property :title inlinetask) 'e-latex info))
+		(org-element-property :title inlinetask) info))
 	(todo (and (plist-get info :with-todo-keywords)
 	(todo (and (plist-get info :with-todo-keywords)
 		   (let ((todo (org-element-property
 		   (let ((todo (org-element-property
 				:todo-keyword inlinetask)))
 				:todo-keyword inlinetask)))
 		     (and todo
 		     (and todo
-			  (org-export-secondary-string todo 'e-latex info)))))
+			  (org-export-secondary-string todo info)))))
 	(todo-type (org-element-property :todo-type inlinetask))
 	(todo-type (org-element-property :todo-type inlinetask))
 	(tags (and (plist-get info :with-tags)
 	(tags (and (plist-get info :with-tags)
 		   (org-element-property :tags inlinetask)))
 		   (org-element-property :tags inlinetask)))
@@ -1295,8 +1288,7 @@ contextual information."
 			   ((eq checkbox 'trans) "$\\boxminus$ "))))
 			   ((eq checkbox 'trans) "$\\boxminus$ "))))
 	 (tag (let ((tag (org-element-property :tag item)))
 	 (tag (let ((tag (org-element-property :tag item)))
 		(and tag
 		(and tag
-		     (format "[%s]" (org-export-secondary-string
-				     tag 'e-latex info))))))
+		     (format "[%s]" (org-export-secondary-string tag info))))))
     (concat counter "\\item" tag " " checkbox contents)))
     (concat counter "\\item" tag " " checkbox contents)))
 
 
 
 
@@ -1469,7 +1461,7 @@ INFO is a plist holding contextual information.  See
 	      (org-export-secondary-string
 	      (org-export-secondary-string
 	       (org-element-parse-secondary-string
 	       (org-element-parse-secondary-string
 		path (cdr (assq 'radio-target org-element-object-restrictions)))
 		path (cdr (assq 'radio-target org-element-object-restrictions)))
-	       'e-latex info)))
+	       info)))
      ;; Links pointing to an headline: Find destination and build
      ;; Links pointing to an headline: Find destination and build
      ;; appropriate referencing command.
      ;; appropriate referencing command.
      ((member type '("custom-id" "fuzzy" "id"))
      ((member type '("custom-id" "fuzzy" "id"))
@@ -1482,8 +1474,7 @@ INFO is a plist holding contextual information.  See
 	   (format "\\texttt{%s}"
 	   (format "\\texttt{%s}"
 		   (or desc
 		   (or desc
 		       (org-export-secondary-string
 		       (org-export-secondary-string
-			(org-element-property :raw-link link)
-			'e-latex info))))
+			(org-element-property :raw-link link) info))))
 	  ;; Fuzzy link points to an invisible target.
 	  ;; Fuzzy link points to an invisible target.
 	  (keyword nil)
 	  (keyword nil)
 	  ;; LINK points to an headline.  If headlines are numbered
 	  ;; LINK points to an headline.  If headlines are numbered
@@ -1502,8 +1493,7 @@ INFO is a plist holding contextual information.  See
 	       (format "\\hyperref[%s]{%s}" label
 	       (format "\\hyperref[%s]{%s}" label
 		       (or desc
 		       (or desc
 			   (org-export-secondary-string
 			   (org-export-secondary-string
-			    (org-element-property :title destination)
-			    'e-latex info))))))
+			    (org-element-property :title destination) info))))))
           ;; Fuzzy link points to a target.  Do as above.
           ;; Fuzzy link points to a target.  Do as above.
 	  (otherwise
 	  (otherwise
 	   (let ((path (org-export-solidify-link-text path)))
 	   (let ((path (org-export-solidify-link-text path)))
@@ -1762,12 +1752,11 @@ contextual information."
 	     (or (cadr (assq (intern lang) org-e-latex-listings-langs)) lang))
 	     (or (cadr (assq (intern lang) org-e-latex-listings-langs)) lang))
 	    (caption-str
 	    (caption-str
 	     (when caption
 	     (when caption
-	       (let ((main (org-export-secondary-string
-			    (car caption) 'e-latex info)))
+	       (let ((main (org-export-secondary-string (car caption) info)))
 		 (if (not (cdr caption)) (format "{%s}" main)
 		 (if (not (cdr caption)) (format "{%s}" main)
 		   (format
 		   (format
 		    "{[%s]%s}"
 		    "{[%s]%s}"
-		    (org-export-secondary-string (cdr caption) 'e-latex info)
+		    (org-export-secondary-string (cdr caption) info)
 		    main))))))
 		    main))))))
 	(concat
 	(concat
 	 ;; Options.
 	 ;; Options.

+ 36 - 46
contrib/lisp/org-e-odt.el

@@ -47,12 +47,10 @@
 ;; progress. See org-html.el.
 ;; progress. See org-html.el.
 
 
 (defun org-e-odt-format-preamble (info)
 (defun org-e-odt-format-preamble (info)
-  (let* ((title (org-export-secondary-string
-		 (plist-get info :title) 'e-odt info))
+  (let* ((title (org-export-secondary-string (plist-get info :title) info))
 	 (author (and (plist-get info :with-author)
 	 (author (and (plist-get info :with-author)
 		      (let ((auth (plist-get info :author)))
 		      (let ((auth (plist-get info :author)))
-			(and auth (org-export-secondary-string
-				   auth 'e-odt info)))))
+			(and auth (org-export-secondary-string auth info)))))
 	 (date (plist-get info :date))
 	 (date (plist-get info :date))
 	 (iso-date (org-e-odt-format-date date))
 	 (iso-date (org-e-odt-format-date date))
 	 (date (org-e-odt-format-date date "%d %b %Y"))
 	 (date (org-e-odt-format-date date "%d %b %Y"))
@@ -861,10 +859,10 @@ ATTR is a string of other attributes of the a element."
 	 (caption (org-element-property :caption caption-from))
 	 (caption (org-element-property :caption caption-from))
 	 (short-caption (cdr caption))
 	 (short-caption (cdr caption))
 	 ;; transcode captions.
 	 ;; transcode captions.
-	 (caption (and (car caption) (org-export-secondary-string
-				      (car caption) 'e-odt info)))
-	 (short-caption (and short-caption (org-export-secondary-string
-					    short-caption 'e-odt info))))
+	 (caption (and (car caption)
+		       (org-export-secondary-string (car caption) info)))
+	 (short-caption (and short-caption
+			     (org-export-secondary-string short-caption info))))
     (when (or label caption)
     (when (or label caption)
       (let* ((default-category
       (let* ((default-category
 	       (cond
 	       (cond
@@ -1081,11 +1079,9 @@ ATTR is a string of other attributes of the a element."
       (insert "\n</manifest:manifest>"))))
       (insert "\n</manifest:manifest>"))))
 
 
 (defun org-e-odt-update-meta-file (info) ; FIXME opt-plist
 (defun org-e-odt-update-meta-file (info) ; FIXME opt-plist
-  (let ((title (org-export-secondary-string
-		(plist-get info :title) 'e-odt info))
+  (let ((title (org-export-secondary-string (plist-get info :title) info))
 	(author (or (let ((auth (plist-get info :author)))
 	(author (or (let ((auth (plist-get info :author)))
-		      (and auth (org-export-secondary-string
-				 auth 'e-odt info))) ""))
+		      (and auth (org-export-secondary-string auth info))) ""))
 	(date (org-e-odt-format-date (plist-get info :date)))
 	(date (org-e-odt-format-date (plist-get info :date)))
 	(email (plist-get info :email))
 	(email (plist-get info :email))
 	(keywords (plist-get info :keywords))
 	(keywords (plist-get info :keywords))
@@ -1352,8 +1348,7 @@ formula file."
 (defvar org-element-string-restrictions)
 (defvar org-element-string-restrictions)
 (defvar org-element-object-restrictions)
 (defvar org-element-object-restrictions)
 
 
-(declare-function org-export-clean-table "org-export" (table specialp))
-(declare-function org-export-data "org-export" (data backend info))
+(declare-function org-export-data "org-export" (data info))
 (declare-function org-export-directory "org-export" (type plist))
 (declare-function org-export-directory "org-export" (type plist))
 (declare-function org-export-expand-macro "org-export" (macro info))
 (declare-function org-export-expand-macro "org-export" (macro info))
 (declare-function org-export-first-sibling-p "org-export" (headline info))
 (declare-function org-export-first-sibling-p "org-export" (headline info))
@@ -1376,10 +1371,8 @@ formula file."
 		  "org-export" (extension &optional subtreep pub-dir))
 		  "org-export" (extension &optional subtreep pub-dir))
 (declare-function org-export-resolve-coderef "org-export" (ref info))
 (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-fuzzy-link "org-export" (link info))
-(declare-function org-export-secondary-string "org-export"
-		  (secondary backend info))
+(declare-function org-export-secondary-string "org-export" (secondary info))
 (declare-function org-export-solidify-link-text "org-export" (s))
 (declare-function org-export-solidify-link-text "org-export" (s))
-(declare-function org-export-table-format-info "org-export" (table))
 (declare-function
 (declare-function
  org-export-to-buffer "org-export"
  org-export-to-buffer "org-export"
  (backend buffer &optional subtreep visible-only body-only ext-plist))
  (backend buffer &optional subtreep visible-only body-only ext-plist))
@@ -2750,15 +2743,15 @@ For non-floats, see `org-e-odt--wrap-label'."
      ;; Option caption format with short name.
      ;; Option caption format with short name.
      ((cdr caption)
      ((cdr caption)
       (format "\\caption[%s]{%s%s}\n"
       (format "\\caption[%s]{%s%s}\n"
-	      (org-export-secondary-string (cdr caption) 'e-odt info)
+	      (org-export-secondary-string (cdr caption) info)
 	      label-str
 	      label-str
-	      (org-export-secondary-string (car caption) 'e-odt info)))
+	      (org-export-secondary-string (car caption) info)))
      ;; Standard caption format.
      ;; Standard caption format.
      ;; (t (format "\\caption{%s%s}\n"
      ;; (t (format "\\caption{%s%s}\n"
      ;; 		label-str
      ;; 		label-str
-     ;; 		(org-export-secondary-string (car caption) 'e-odt info)))
+     ;; 		(org-export-secondary-string (car caption) info)))
 
 
-     (t (org-export-secondary-string (car caption) 'e-odt info)))))
+     (t (org-export-secondary-string (car caption) info)))))
 
 
 (defun org-e-odt--find-verb-separator (s)
 (defun org-e-odt--find-verb-separator (s)
   "Return a character not used in string S.
   "Return a character not used in string S.
@@ -2976,8 +2969,7 @@ holding contextual information."
 (defun org-e-odt-dynamic-block (dynamic-block contents info)
 (defun org-e-odt-dynamic-block (dynamic-block contents info)
   "Transcode a DYNAMIC-BLOCK element from Org to HTML.
   "Transcode a DYNAMIC-BLOCK element from Org to HTML.
 CONTENTS holds the contents of the block.  INFO is a plist
 CONTENTS holds the contents of the block.  INFO is a plist
-holding contextual information.  See
-`org-export-data'."
+holding contextual information.  See `org-export-data'."
   (org-e-odt--wrap-label dynamic-block contents))
   (org-e-odt--wrap-label dynamic-block contents))
 
 
 
 
@@ -3065,10 +3057,9 @@ CONTENTS is nil.  INFO is a plist holding contextual information."
 
 
 (defun org-e-odt-footnote-def (raw info) ; FIXME
 (defun org-e-odt-footnote-def (raw info) ; FIXME
   (if (equal (org-element-type raw) 'org-data)
   (if (equal (org-element-type raw) 'org-data)
-      (org-trim (org-export-data raw 'e-odt info)) ; fix paragraph
-					; style
+      (org-trim (org-export-data raw info)) ; fix paragraph style
     (org-e-odt-format-stylized-paragraph
     (org-e-odt-format-stylized-paragraph
-     'footnote (org-trim (org-export-secondary-string raw 'e-odt info)))))
+     'footnote (org-trim (org-export-secondary-string raw info)))))
 
 
 (defvar org-e-odt-footnote-separator
 (defvar org-e-odt-footnote-separator
   (org-e-odt-format-fontify "," 'superscript))
   (org-e-odt-format-fontify "," 'superscript))
@@ -3125,12 +3116,12 @@ holding contextual information."
 		    (let ((todo (org-element-property
 		    (let ((todo (org-element-property
 				 :todo-keyword headline)))
 				 :todo-keyword headline)))
 		      (and todo
 		      (and todo
-			   (org-export-secondary-string todo 'e-odt info)))))
+			   (org-export-secondary-string todo info)))))
 	 (todo-type (and todo (org-element-property :todo-type headline)))
 	 (todo-type (and todo (org-element-property :todo-type headline)))
 	 (priority (and (plist-get info :with-priority)
 	 (priority (and (plist-get info :with-priority)
 			(org-element-property :priority headline)))
 			(org-element-property :priority headline)))
 	 (text (org-export-secondary-string
 	 (text (org-export-secondary-string
-		(org-element-property :title headline) 'e-odt info))
+		(org-element-property :title headline) info))
 	 (tags (and (plist-get info :with-tags)
 	 (tags (and (plist-get info :with-tags)
 		    (org-element-property :tags headline)))
 		    (org-element-property :tags headline)))
 	 (headline-label (concat "sec-" (mapconcat 'number-to-string
 	 (headline-label (concat "sec-" (mapconcat 'number-to-string
@@ -3157,7 +3148,7 @@ holding contextual information."
 	 ;; Get level relative to current parsed data.
 	 ;; Get level relative to current parsed data.
 	 (level (org-export-get-relative-level headline info))
 	 (level (org-export-get-relative-level headline info))
 	 (text (org-export-secondary-string
 	 (text (org-export-secondary-string
-		(org-element-property :title headline) 'e-odt info))
+		(org-element-property :title headline) info))
 	 ;; Create the headline text.
 	 ;; Create the headline text.
 	 (full-text (org-e-odt-format-headline--wrap headline info)))
 	 (full-text (org-e-odt-format-headline--wrap headline info)))
     (cond
     (cond
@@ -3286,7 +3277,7 @@ contextual information."
 	 (counter (org-element-property :counter item))
 	 (counter (org-element-property :counter item))
 	 (checkbox (org-element-property :checkbox item))
 	 (checkbox (org-element-property :checkbox item))
 	 (tag (let ((tag (org-element-property :tag item)))
 	 (tag (let ((tag (org-element-property :tag item)))
-		(and tag (org-export-secondary-string tag 'e-odt info)))))
+		(and tag (org-export-secondary-string tag info)))))
     (org-e-odt-format-list-item
     (org-e-odt-format-list-item
      contents type checkbox (or tag counter))))
      contents type checkbox (or tag counter))))
 
 
@@ -3350,10 +3341,10 @@ CONTENTS is nil.  INFO is a plist holding contextual information."
 	    (org-element-property :value latex-environment)))
 	    (org-element-property :value latex-environment)))
 	  (processing-type (plist-get info :LaTeX-fragments))
 	  (processing-type (plist-get info :LaTeX-fragments))
 	  (caption (org-element-property :caption latex-environment))
 	  (caption (org-element-property :caption latex-environment))
-	  (short-caption (and (cdr caption) (org-export-secondary-string
-					     (cdr caption) 'e-odt info)))
-	  (caption (and (car caption) (org-export-secondary-string
-				       (car caption) 'e-odt info)))
+	  (short-caption (and (cdr caption)
+			      (org-export-secondary-string (cdr caption) info)))
+	  (caption (and (car caption)
+			(org-export-secondary-string (car caption) info)))
 	  (label (org-element-property :name latex-environment))
 	  (label (org-element-property :name latex-environment))
 	  (attr nil)			; FIXME
 	  (attr nil)			; FIXME
 	  (label (org-element-property :name latex-environment)))
 	  (label (org-element-property :name latex-environment)))
@@ -3583,7 +3574,7 @@ INFO is a plist holding contextual information.  See
        (org-export-secondary-string
        (org-export-secondary-string
 	(org-element-parse-secondary-string
 	(org-element-parse-secondary-string
 	 path (org-element-restriction 'radio-target))
 	 path (org-element-restriction 'radio-target))
-	'e-odt info)
+	info)
        (org-export-solidify-link-text path)))
        (org-export-solidify-link-text path)))
      ;; Links pointing to an headline: Find destination and build
      ;; Links pointing to an headline: Find destination and build
      ;; appropriate referencing command.
      ;; appropriate referencing command.
@@ -3596,8 +3587,8 @@ INFO is a plist holding contextual information.  See
 	  ('nil
 	  ('nil
 	   (org-e-odt-format-fontify
 	   (org-e-odt-format-fontify
 	    (or desc (org-export-secondary-string
 	    (or desc (org-export-secondary-string
-		      (org-element-property :raw-link link)
-		      'e-odt info)) 'emphasis))
+		      (org-element-property :raw-link link) info))
+	    'emphasis))
 	  ;; Fuzzy link points to an invisible target.
 	  ;; Fuzzy link points to an invisible target.
 	  (keyword nil)
 	  (keyword nil)
 	  ;; LINK points to an headline.  If headlines are numbered
 	  ;; LINK points to an headline.  If headlines are numbered
@@ -3614,8 +3605,7 @@ INFO is a plist holding contextual information.  See
 		    (desc desc)
 		    (desc desc)
 		    ((plist-get info :section-numbers) section-no)
 		    ((plist-get info :section-numbers) section-no)
 		    (t (org-export-secondary-string
 		    (t (org-export-secondary-string
-			(org-element-property :title destination)
-			'e-odt info))))
+			(org-element-property :title destination) info))))
 	     (org-e-odt-format-internal-link desc label)))
 	     (org-e-odt-format-internal-link desc label)))
 	  ;; Fuzzy link points to a target.  Do as above.
 	  ;; Fuzzy link points to a target.  Do as above.
 	  (otherwise
 	  (otherwise
@@ -3831,15 +3821,15 @@ CONTENTS holds the contents of the item.  INFO is a plist holding
 contextual information."
 contextual information."
   (let* ((lang (org-element-property :language src-block))
   (let* ((lang (org-element-property :language src-block))
 	 (caption (org-element-property :caption src-block))
 	 (caption (org-element-property :caption src-block))
-	 (short-caption (and (cdr caption) (org-export-secondary-string
-					    (cdr caption) 'e-odt info)))
-	 (caption (and (car caption) (org-export-secondary-string
-				      (car caption) 'e-odt info)))
+	 (short-caption (and (cdr caption)
+			     (org-export-secondary-string (cdr caption) info)))
+	 (caption (and (car caption)
+		       (org-export-secondary-string (car caption) info)))
 	 (label (org-element-property :name src-block)))
 	 (label (org-element-property :name src-block)))
     ;; FIXME: Handle caption
     ;; FIXME: Handle caption
     ;; caption-str (when caption)
     ;; caption-str (when caption)
-    ;; (main (org-export-secondary-string (car caption) 'e-odt info))
-    ;; (secondary (org-export-secondary-string (cdr caption) 'e-odt info))
+    ;; (main (org-export-secondary-string (car caption) info))
+    ;; (secondary (org-export-secondary-string (cdr caption) info))
     ;; (caption-str (org-e-odt--caption/label-string caption label info))
     ;; (caption-str (org-e-odt--caption/label-string caption label info))
     (let* ((captions (org-e-odt-format-label src-block info 'definition))
     (let* ((captions (org-e-odt-format-label src-block info 'definition))
 	   (caption (car captions)) (short-caption (cdr captions)))
 	   (caption (car captions)) (short-caption (cdr captions)))
@@ -4122,7 +4112,7 @@ information."
   (let ((value (org-element-property :value time-stamp))
   (let ((value (org-element-property :value time-stamp))
         (type (org-element-property :type time-stamp))
         (type (org-element-property :type time-stamp))
         (appt-type (org-element-property :appt-type time-stamp)))
         (appt-type (org-element-property :appt-type time-stamp)))
-    (setq value (org-export-secondary-string value 'e-odt info))
+    (setq value (org-export-secondary-string value info))
     (org-e-odt-format-fontify
     (org-e-odt-format-fontify
      (concat
      (concat
       (org-e-odt-format-fontify
       (org-e-odt-format-fontify

+ 40 - 52
contrib/lisp/org-export.el

@@ -943,7 +943,9 @@ inferior to file-local settings."
 		   (and buffer-file-name
 		   (and buffer-file-name
 			(org-remove-double-quotes buffer-file-name)))
 			(org-remove-double-quotes buffer-file-name)))
 		  ;; ... and from subtree, when appropriate.
 		  ;; ... and from subtree, when appropriate.
-		  (and subtreep (org-export-get-subtree-options)))))
+		  (and subtreep (org-export-get-subtree-options))
+		  ;; Also install back-end symbol.
+		  `(:back-end ,backend))))
     ;; Return plist.
     ;; Return plist.
     options))
     options))
 
 
@@ -1259,16 +1261,13 @@ retrieved."
 ;; `org-export-collect-headline-numbering' builds an alist between
 ;; `org-export-collect-headline-numbering' builds an alist between
 ;; headlines and their numbering.
 ;; headlines and their numbering.
 
 
-(defun org-export-collect-tree-properties (data info backend)
+(defun org-export-collect-tree-properties (data info)
   "Extract tree properties from parse tree.
   "Extract tree properties from parse tree.
 
 
 DATA is the parse tree from which information is retrieved.  INFO
 DATA is the parse tree from which information is retrieved.  INFO
-is a list holding export options.  BACKEND is the back-end called
-for transcoding, as a symbol.
+is a list holding export options.
 
 
 Following tree properties are set or updated:
 Following tree properties are set or updated:
-`:back-end'        Back-end used for transcoding.
-
 `:footnote-definition-alist' List of footnotes definitions in
 `:footnote-definition-alist' List of footnotes definitions in
                    original buffer and current parse tree.
                    original buffer and current parse tree.
 
 
@@ -1283,8 +1282,6 @@ Following tree properties are set or updated:
 `:ignore-list'     List of elements that should be ignored during
 `:ignore-list'     List of elements that should be ignored during
                    export.
                    export.
 
 
-`:parse-tree'      Whole parse tree.
-
 `:target-list'     List of all targets in the parse tree."
 `:target-list'     List of all targets in the parse tree."
   ;; Install the parse tree in the communication channel, in order to
   ;; Install the parse tree in the communication channel, in order to
   ;; use `org-export-get-genealogy' and al.
   ;; use `org-export-get-genealogy' and al.
@@ -1325,8 +1322,7 @@ Following tree properties are set or updated:
 	 (when (or (eq (org-element-type blob) 'target)
 	 (when (or (eq (org-element-type blob) 'target)
 		   (string= (org-element-property :key blob) "TARGET"))
 		   (string= (org-element-property :key blob) "TARGET"))
 	   blob)) info)
 	   blob)) info)
-     :headline-numbering ,(org-export-collect-headline-numbering data info)
-     :back-end ,backend)
+     :headline-numbering ,(org-export-collect-headline-numbering data info))
    info))
    info))
 
 
 (defun org-export-get-min-level (data options)
 (defun org-export-get-min-level (data options)
@@ -1499,17 +1495,14 @@ OPTIONS is the plist holding export options."
 ;; `org-export-expand' transforms the others back into their original
 ;; `org-export-expand' transforms the others back into their original
 ;; shape.
 ;; shape.
 
 
-(defun org-export-data (data backend info)
-  "Convert DATA to a string into BACKEND format.
+(defun org-export-data (data info)
+  "Convert DATA into current back-end format.
 
 
 DATA is a nested list as returned by `org-element-parse-buffer'.
 DATA is a nested list as returned by `org-element-parse-buffer'.
 
 
-BACKEND is a symbol among supported exporters.
-
 INFO is a plist holding export options and also used as
 INFO is a plist holding export options and also used as
 a communication channel between elements when walking the nested
 a communication channel between elements when walking the nested
-list.  See `org-export-update-info' function for more
-details.
+list.
 
 
 Return transcoded string."
 Return transcoded string."
   (mapconcat
   (mapconcat
@@ -1522,11 +1515,12 @@ Return transcoded string."
       ;; return string.  Also update INFO and call
       ;; return string.  Also update INFO and call
       ;; `org-export-filter-plain-text-functions'.
       ;; `org-export-filter-plain-text-functions'.
       ((stringp blob)
       ((stringp blob)
-       (let ((transcoder (intern (format "org-%s-plain-text" backend))))
+       (let ((transcoder (intern (format "org-%s-plain-text"
+					 (plist-get info :back-end)))))
 	 (org-export-filter-apply-functions
 	 (org-export-filter-apply-functions
 	  (plist-get info :filter-plain-text)
 	  (plist-get info :filter-plain-text)
 	  (if (fboundp transcoder) (funcall transcoder blob info) blob)
 	  (if (fboundp transcoder) (funcall transcoder blob info) blob)
-	  backend info)))
+	  info)))
       ;; BLOB is an element or an object.
       ;; BLOB is an element or an object.
       (t
       (t
        (let* ((type (org-element-type blob))
        (let* ((type (org-element-type blob))
@@ -1541,7 +1535,9 @@ Return transcoded string."
 		;;      back into Org syntax.
 		;;      back into Org syntax.
 		((not (org-export-interpret-p blob info)) 'org-export-expand)
 		((not (org-export-interpret-p blob info)) 'org-export-expand)
 		;; 1.3. Else apply naming convention.
 		;; 1.3. Else apply naming convention.
-		(t (let ((trans (intern (format "org-%s-%s" backend type))))
+		(t (let ((trans (intern (format "org-%s-%s"
+						(plist-get info :back-end)
+						type))))
 		     (and (fboundp trans) trans)))))
 		     (and (fboundp trans) trans)))))
 	      ;; 2. Compute CONTENTS of BLOB.
 	      ;; 2. Compute CONTENTS of BLOB.
 	      (contents
 	      (contents
@@ -1549,7 +1545,7 @@ Return transcoded string."
 		;; Case 0. No transcoder or no contents: ignore BLOB.
 		;; Case 0. No transcoder or no contents: ignore BLOB.
 		((or (not transcoder) (not (org-element-contents blob))) nil)
 		((or (not transcoder) (not (org-element-contents blob))) nil)
 		;; Case 1. Transparently export an Org document.
 		;; Case 1. Transparently export an Org document.
-		((eq type 'org-data) (org-export-data blob backend info))
+		((eq type 'org-data) (org-export-data blob info))
 		;; Case 2. For a greater element.
 		;; Case 2. For a greater element.
 		((memq type org-element-greater-elements)
 		((memq type org-element-greater-elements)
 		 ;; Ignore contents of an archived tree
 		 ;; Ignore contents of an archived tree
@@ -1558,8 +1554,7 @@ Return transcoded string."
 			  (eq type 'headline)
 			  (eq type 'headline)
 			  (eq (plist-get info :with-archived-trees) 'headline)
 			  (eq (plist-get info :with-archived-trees) 'headline)
 			  (org-element-property :archivedp blob))
 			  (org-element-property :archivedp blob))
-		   (org-element-normalize-string
-		    (org-export-data blob backend info))))
+		   (org-element-normalize-string (org-export-data blob info))))
 		;; Case 3. For an element containing objects.
 		;; Case 3. For an element containing objects.
 		(t
 		(t
 		 (org-export-data
 		 (org-export-data
@@ -1574,14 +1569,14 @@ Return transcoded string."
 			(let ((parent (org-export-get-parent blob info)))
 			(let ((parent (org-export-get-parent blob info)))
 			  (memq (org-element-type parent)
 			  (memq (org-element-type parent)
 				'(footnote-definition item)))))
 				'(footnote-definition item)))))
-		  backend info))))
+		  info))))
 	      ;; 3. Transcode BLOB into RESULTS string.
 	      ;; 3. Transcode BLOB into RESULTS string.
 	      (results (cond
 	      (results (cond
 			((not transcoder) nil)
 			((not transcoder) nil)
 			((eq transcoder 'org-export-expand)
 			((eq transcoder 'org-export-expand)
 			 (org-export-data
 			 (org-export-data
 			  `(org-data nil ,(funcall transcoder blob contents))
 			  `(org-data nil ,(funcall transcoder blob contents))
-			  backend info))
+			  info))
 			(t (funcall transcoder blob contents info)))))
 			(t (funcall transcoder blob contents info)))))
 	 ;; 4. Return results.
 	 ;; 4. Return results.
 	 (cond
 	 (cond
@@ -1600,24 +1595,22 @@ Return transcoded string."
 			 (concat (org-element-normalize-string results)
 			 (concat (org-element-normalize-string results)
 				 (make-string post-blank ?\n))
 				 (make-string post-blank ?\n))
 		       (concat results (make-string post-blank ? ))))
 		       (concat results (make-string post-blank ? ))))
-		   backend info)))
+		   info)))
 	     ;; Eventually return string.
 	     ;; Eventually return string.
 	     results)))))))
 	     results)))))))
    (org-element-contents data) ""))
    (org-element-contents data) ""))
 
 
-(defun org-export-secondary-string (secondary backend info)
-  "Convert SECONDARY string into BACKEND format.
+(defun org-export-secondary-string (secondary info)
+  "Convert SECONDARY string into current back-end target format.
 
 
 SECONDARY is a nested list as returned by
 SECONDARY is a nested list as returned by
-`org-element-parse-secondary-string'.
-
-BACKEND is a symbol among supported exporters.  INFO is a plist
-used as a communication channel.
+`org-element-parse-secondary-string'.  INFO is a plist used as
+a communication channel.
 
 
 Return transcoded string."
 Return transcoded string."
   ;; Make SECONDARY acceptable for `org-export-data'.
   ;; Make SECONDARY acceptable for `org-export-data'.
   (let ((s (if (listp secondary) secondary (list secondary))))
   (let ((s (if (listp secondary) secondary (list secondary))))
-    (org-export-data `(org-data nil ,@s) backend (copy-sequence info))))
+    (org-export-data `(org-data nil ,@s) (copy-sequence info))))
 
 
 (defun org-export-interpret-p (blob info)
 (defun org-export-interpret-p (blob info)
   "Non-nil if element or object BLOB should be interpreted as Org syntax.
   "Non-nil if element or object BLOB should be interpreted as Org syntax.
@@ -2044,21 +2037,20 @@ verbatim, as a string, the back-end, as a symbol, and the
 communication channel, as a plist.  It must return a string or
 communication channel, as a plist.  It must return a string or
 nil.")
 nil.")
 
 
-(defun org-export-filter-apply-functions (filters value backend info)
-  "Call every function in FILTERS with arguments VALUE, BACKEND and INFO.
-Functions are called in a LIFO fashion, to be sure that developer
-specified filters, if any, are called first."
+(defun org-export-filter-apply-functions (filters value info)
+  "Call every function in FILTERS.
+Functions are called with arguments VALUE, current export
+back-end and INFO.  Call is done in a LIFO fashion, to be sure
+that developer specified filters, if any, are called first."
   (loop for filter in filters
   (loop for filter in filters
 	if (not value) return nil else
 	if (not value) return nil else
-	do (setq value (funcall filter value backend info)))
+	do (setq value (funcall filter value (plist-get info :back-end) info)))
   value)
   value)
 
 
-(defun org-export-install-filters (backend info)
+(defun org-export-install-filters (info)
   "Install filters properties in communication channel.
   "Install filters properties in communication channel.
 
 
-BACKEND is a symbol specifying which back-end specific filters to
-install, if any.  INFO is a plist containing the current
-communication channel.
+INFO is a plist containing the current communication channel.
 
 
 Return the updated communication channel."
 Return the updated communication channel."
   (let (plist)
   (let (plist)
@@ -2067,7 +2059,8 @@ Return the updated communication channel."
 	    (setq plist (plist-put plist (car p) (eval (cdr p)))))
 	    (setq plist (plist-put plist (car p) (eval (cdr p)))))
 	  org-export-filters-alist)
 	  org-export-filters-alist)
     ;; Prepend back-end specific filters to that list.
     ;; Prepend back-end specific filters to that list.
-    (let ((back-end-filters (intern (format "org-%s-filters-alist" backend))))
+    (let ((back-end-filters (intern (format "org-%s-filters-alist"
+					    (plist-get info :back-end)))))
       (when (boundp back-end-filters)
       (when (boundp back-end-filters)
 	(mapc (lambda (p)
 	(mapc (lambda (p)
 		;; Single values get consed, lists are prepended.
 		;; Single values get consed, lists are prepended.
@@ -2153,7 +2146,6 @@ Return code as a string."
       ;;    they might not be accessible anymore in a narrowed parse
       ;;    they might not be accessible anymore in a narrowed parse
       ;;    tree.  Also install user's and developer's filters.
       ;;    tree.  Also install user's and developer's filters.
       (let ((info (org-export-install-filters
       (let ((info (org-export-install-filters
-		   backend
 		   (org-export-store-footnote-definitions
 		   (org-export-store-footnote-definitions
 		    (org-export-get-environment backend subtreep ext-plist))))
 		    (org-export-get-environment backend subtreep ext-plist))))
 	    ;; 2. Get parse tree.  Buffer isn't parsed directly.
 	    ;; 2. Get parse tree.  Buffer isn't parsed directly.
@@ -2175,24 +2167,22 @@ Return code as a string."
 	;; 3. Call parse-tree filters to get the final tree.
 	;; 3. Call parse-tree filters to get the final tree.
 	(setq tree
 	(setq tree
 	      (org-export-filter-apply-functions
 	      (org-export-filter-apply-functions
-	       (plist-get info :filter-parse-tree) tree backend info))
+	       (plist-get info :filter-parse-tree) tree info))
 	;; 4. Now tree is complete, compute its properties and add
 	;; 4. Now tree is complete, compute its properties and add
 	;;    them to communication channel.
 	;;    them to communication channel.
 	(setq info
 	(setq info
 	      (org-combine-plists
 	      (org-combine-plists
-	       info
-	       (org-export-collect-tree-properties tree info backend)))
+	       info (org-export-collect-tree-properties tree info)))
 	;; 5. Eventually transcode TREE.  Wrap the resulting string
 	;; 5. Eventually transcode TREE.  Wrap the resulting string
 	;;    into a template, if required.  Eventually call
 	;;    into a template, if required.  Eventually call
 	;;    final-output filter.
 	;;    final-output filter.
-	(let* ((body (org-element-normalize-string
-		      (org-export-data tree backend info)))
+	(let* ((body (org-element-normalize-string (org-export-data tree info)))
 	       (template (intern (format "org-%s-template" backend)))
 	       (template (intern (format "org-%s-template" backend)))
 	       (output (org-export-filter-apply-functions
 	       (output (org-export-filter-apply-functions
 			(plist-get info :filter-final-output)
 			(plist-get info :filter-final-output)
 			(if (or (not (fboundp template)) body-only) body
 			(if (or (not (fboundp template)) body-only) body
 			  (funcall template body info))
 			  (funcall template body info))
-			backend info)))
+			info)))
 	  ;; Maybe add final OUTPUT to kill ring, then return it.
 	  ;; Maybe add final OUTPUT to kill ring, then return it.
 	  (when org-export-copy-to-kill-ring (org-kill-new output))
 	  (when org-export-copy-to-kill-ring (org-kill-new output))
 	  output)))))
 	  output)))))
@@ -2906,9 +2896,7 @@ INFO is a plist holding export options."
 	 ;; expanded recursively.
 	 ;; expanded recursively.
 	 (value
 	 (value
 	  (let ((val (plist-get info (intern (format ":macro-%s" key)))))
 	  (let ((val (plist-get info (intern (format ":macro-%s" key)))))
-	    (if (stringp val) val
-	      (org-export-secondary-string
-	       val (plist-get info :back-end) info)))))
+	    (if (stringp val) val (org-export-secondary-string val info)))))
     ;; Replace arguments in VALUE.
     ;; Replace arguments in VALUE.
     (let ((s 0) n)
     (let ((s 0) n)
       (while (string-match "\\$\\([0-9]+\\)" value s)
       (while (string-match "\\$\\([0-9]+\\)" value s)

+ 55 - 67
testing/lisp/test-org-export.el

@@ -52,7 +52,7 @@ already filled in `info'."
   (declare (debug (form body)) (indent 1))
   (declare (debug (form body)) (indent 1))
   `(org-test-with-temp-text ,data
   `(org-test-with-temp-text ,data
      (let* ((tree (org-element-parse-buffer))
      (let* ((tree (org-element-parse-buffer))
-	    (info (org-export-collect-tree-properties tree nil nil)))
+	    (info (org-export-collect-tree-properties tree nil)))
        ,@body)))
        ,@body)))
 
 
 (ert-deftest test-org-export/parse-option-keyword ()
 (ert-deftest test-org-export/parse-option-keyword ()
@@ -349,10 +349,10 @@ body\n")))
   (org-test-with-backend "test"
   (org-test-with-backend "test"
     (org-test-with-temp-text "* Headline 1\nBody 1\n* Headline 2\nBody 2"
     (org-test-with-temp-text "* Headline 1\nBody 1\n* Headline 2\nBody 2"
       (let ((org-export-before-parsing-hook
       (let ((org-export-before-parsing-hook
-	     ((lambda ()
-		(org-map-entries
-		 (lambda ()
-		   (delete-region (point) (progn (forward-line) (point)))))))))
+	     '((lambda ()
+		 (org-map-entries
+		  (lambda ()
+		    (delete-region (point) (progn (forward-line) (point)))))))))
 	(should (equal (org-export-as 'test) "Body 1\nBody 2\n"))))))
 	(should (equal (org-export-as 'test) "Body 1\nBody 2\n"))))))
 
 
 
 
@@ -437,81 +437,69 @@ Paragraph[fn:1]"
 (ert-deftest test-org-export/fuzzy-links ()
 (ert-deftest test-org-export/fuzzy-links ()
   "Test fuzzy link export specifications."
   "Test fuzzy link export specifications."
   ;; 1. Links to invisible (keyword) targets should be ignored.
   ;; 1. Links to invisible (keyword) targets should be ignored.
-  (org-test-with-temp-text
+  (org-test-with-parsed-data
       "Paragraph.\n#+TARGET: Test\n[[Test]]"
       "Paragraph.\n#+TARGET: Test\n[[Test]]"
-    (let* ((tree (org-element-parse-buffer))
-	   (info (org-export-collect-tree-properties tree nil 'test)))
-      (should-not
-       (org-element-map
-	tree 'link
-	(lambda (link)
-	  (org-export-get-ordinal
-	   (org-export-resolve-fuzzy-link link info) info)) info))))
+    (should-not
+     (org-element-map
+      tree 'link
+      (lambda (link)
+	(org-export-get-ordinal
+	 (org-export-resolve-fuzzy-link link info) info)) info)))
   ;; 2. Link to an headline should return headline's number.
   ;; 2. Link to an headline should return headline's number.
-  (org-test-with-temp-text
+  (org-test-with-parsed-data
       "Paragraph.\n* Head1\n* Head2\n* Head3\n[[Head2]]"
       "Paragraph.\n* Head1\n* Head2\n* Head3\n[[Head2]]"
-    (let* ((tree (org-element-parse-buffer))
-	   (info (org-export-collect-tree-properties tree nil 'test)))
-      (should
-       ;; Note: Headline's number is in fact a list of numbers.
-       (equal '(2)
-	      (org-element-map
-	       tree 'link
-	       (lambda (link)
-		 (org-export-get-ordinal
-		  (org-export-resolve-fuzzy-link link info) info)) info t)))))
+    (should
+     ;; Note: Headline's number is in fact a list of numbers.
+     (equal '(2)
+	    (org-element-map
+	     tree 'link
+	     (lambda (link)
+	       (org-export-get-ordinal
+		(org-export-resolve-fuzzy-link link info) info)) info t))))
   ;; 3. Link to a target in an item should return item's number.
   ;; 3. Link to a target in an item should return item's number.
-  (org-test-with-temp-text
+  (org-test-with-parsed-data
       "- Item1\n  - Item11\n  - <<test>>Item12\n- Item2\n\n\n[[test]]"
       "- Item1\n  - Item11\n  - <<test>>Item12\n- Item2\n\n\n[[test]]"
-    (let* ((tree (org-element-parse-buffer))
-	   (info (org-export-collect-tree-properties tree nil 'test)))
-      (should
-       ;; Note: Item's number is in fact a list of numbers.
-       (equal '(1 2)
-	      (org-element-map
-	       tree 'link
-	       (lambda (link)
-		 (org-export-get-ordinal
-		  (org-export-resolve-fuzzy-link link info) info)) info t)))))
+    (should
+     ;; Note: Item's number is in fact a list of numbers.
+     (equal '(1 2)
+	    (org-element-map
+	     tree 'link
+	     (lambda (link)
+	       (org-export-get-ordinal
+		(org-export-resolve-fuzzy-link link info) info)) info t))))
   ;; 4. Link to a target in a footnote should return footnote's
   ;; 4. Link to a target in a footnote should return footnote's
   ;;    number.
   ;;    number.
-  (org-test-with-temp-text
-      "Paragraph[1][2][fn:lbl3:C<<target>>][[test]][[target]]\n[1] A\n\n[2] <<test>>B"
-    (let* ((tree (org-element-parse-buffer))
-	   (info (org-export-collect-tree-properties tree nil 'test)))
-      (should
-       (equal '(2 3)
-	      (org-element-map
-	       tree 'link
-	       (lambda (link)
-		 (org-export-get-ordinal
-		  (org-export-resolve-fuzzy-link link info) info)) info)))))
+  (org-test-with-parsed-data "
+Paragraph[1][2][fn:lbl3:C<<target>>][[test]][[target]]\n[1] A\n\n[2] <<test>>B"
+    (should
+     (equal '(2 3)
+	    (org-element-map
+	     tree 'link
+	     (lambda (link)
+	       (org-export-get-ordinal
+		(org-export-resolve-fuzzy-link link info) info)) info))))
   ;; 5. Link to a named element should return sequence number of that
   ;; 5. Link to a named element should return sequence number of that
   ;;    element.
   ;;    element.
-  (org-test-with-temp-text
+  (org-test-with-parsed-data
       "#+NAME: tbl1\n|1|2|\n#+NAME: tbl2\n|3|4|\n#+NAME: tbl3\n|5|6|\n[[tbl2]]"
       "#+NAME: tbl1\n|1|2|\n#+NAME: tbl2\n|3|4|\n#+NAME: tbl3\n|5|6|\n[[tbl2]]"
-    (let* ((tree (org-element-parse-buffer))
-	   (info (org-export-collect-tree-properties tree nil 'test)))
-      (should
-       (= 2
-	  (org-element-map
-	   tree 'link
-	   (lambda (link)
-	     (org-export-get-ordinal
-	      (org-export-resolve-fuzzy-link link info) info)) info t)))))
+    (should
+     (= 2
+	(org-element-map
+	 tree 'link
+	 (lambda (link)
+	   (org-export-get-ordinal
+	    (org-export-resolve-fuzzy-link link info) info)) info t))))
   ;; 6. Link to a target not within an item, a table, a footnote
   ;; 6. Link to a target not within an item, a table, a footnote
   ;;    reference or definition should return section number.
   ;;    reference or definition should return section number.
-  (org-test-with-temp-text
+  (org-test-with-parsed-data
       "* Head1\n* Head2\nParagraph<<target>>\n* Head3\n[[target]]"
       "* Head1\n* Head2\nParagraph<<target>>\n* Head3\n[[target]]"
-    (let* ((tree (org-element-parse-buffer))
-	   (info (org-export-collect-tree-properties tree nil 'test)))
-      (should
-       (equal '(2)
-	      (org-element-map
-	       tree 'link
-	       (lambda (link)
-		 (org-export-get-ordinal
-		  (org-export-resolve-fuzzy-link link info) info)) info t))))))
+    (should
+     (equal '(2)
+	    (org-element-map
+	     tree 'link
+	     (lambda (link)
+	       (org-export-get-ordinal
+		(org-export-resolve-fuzzy-link link info) info)) info t)))))
 
 
 (defun test-org-export/resolve-coderef ()
 (defun test-org-export/resolve-coderef ()
   "Test `org-export-resolve-coderef' specifications."
   "Test `org-export-resolve-coderef' specifications."