ox: Fix Wrong type argument error with empty footnotes

* lisp/ox.el (org-export-data): Always return a string, as specified
  by the docstring.

Thanks to kuanyui for reporting it.
http://permalink.gmane.org/gmane.emacs.orgmode/86183
This commit is contained in:
Nicolas Goaziou 2014-05-12 22:18:00 +02:00
parent aaae4a55ca
commit e242bc5180
1 changed files with 18 additions and 19 deletions

View File

@ -2146,9 +2146,8 @@ INFO is a plist containing export directives."
DATA is a parse tree, an element or an object or a secondary
string. INFO is a plist holding export options.
Return transcoded string."
(let ((memo (gethash data (plist-get info :exported-data) 'no-memo)))
(if (not (eq memo 'no-memo)) memo
Return a string."
(or (gethash data (plist-get info :exported-data))
(let* ((type (org-element-type data))
(results
(cond
@ -2174,9 +2173,9 @@ Return transcoded string."
;; Secondary string.
((not type)
(mapconcat (lambda (obj) (org-export-data obj info)) data ""))
;; Element/Object without contents or, as a special case,
;; headline with archive tag and archived trees restricted
;; to title only.
;; Element/Object without contents or, as a special
;; case, headline with archive tag and archived trees
;; restricted to title only.
((or (not (org-element-contents data))
(and (eq type 'headline)
(eq (plist-get info :with-archived-trees) 'headline)
@ -2201,16 +2200,16 @@ Return transcoded string."
(lambda (element) (org-export-data element info))
(org-element-contents
(if (or greaterp objectp) data
;; Elements directly containing objects
;; must have their indentation normalized
;; first.
;; Elements directly containing
;; objects must have their indentation
;; normalized first.
(org-element-normalize-contents
data
;; When normalizing contents of the first
;; paragraph in an item or a footnote
;; definition, ignore first line's
;; indentation: there is none and it
;; might be misleading.
;; When normalizing contents of the
;; first paragraph in an item or
;; a footnote definition, ignore
;; first line's indentation: there is
;; none and it might be misleading.
(when (eq type 'paragraph)
(let ((parent (org-export-get-parent data)))
(and
@ -2227,10 +2226,10 @@ Return transcoded string."
(puthash
data
(cond
((not results) nil)
((not results) "")
((memq type '(org-data plain-text nil)) results)
;; Append the same white space between elements or objects as in
;; the original buffer, and call appropriate filters.
;; Append the same white space between elements or objects
;; as in the original buffer, and call appropriate filters.
(t
(let ((results
(org-export-filter-apply-functions
@ -2240,10 +2239,10 @@ Return transcoded string."
(if (memq type org-element-all-elements)
(concat (org-element-normalize-string results)
(make-string post-blank ?\n))
(concat results (make-string post-blank ? ))))
(concat results (make-string post-blank ?\s))))
info)))
results)))
(plist-get info :exported-data))))))
(plist-get info :exported-data)))))
(defun org-export-data-with-backend (data backend info)
"Convert DATA into BACKEND format.