ox.el (org-export-define-backend, org-export-define-derived-backend): Use defuns

* ox.el (org-export-define-backend)
(org-export-define-derived-backend): Make defuns and update
docstrings.

* ox-texinfo.el (texinfo):
* ox-org.el (org):
* ox-odt.el (odt):
* ox-md.el (md):
* ox-man.el (man):
* ox-latex.el (latex):
* ox-icalendar.el (icalendar):
* ox-html.el (html):
* ox-beamer.el (beamer):
* ox-ascii.el (ascii): Use the defuns.
This commit is contained in:
Bastien Guerry 2013-03-19 16:24:40 +01:00
parent d8969931a9
commit a13b19e384
11 changed files with 589 additions and 597 deletions

View File

@ -54,83 +54,83 @@
;; We also install a filter for headlines and sections, in order to ;; We also install a filter for headlines and sections, in order to
;; control blank lines separating them in output string. ;; control blank lines separating them in output string.
(org-export-define-backend ascii (org-export-define-backend 'ascii
((bold . org-ascii-bold) '((bold . org-ascii-bold)
(center-block . org-ascii-center-block) (center-block . org-ascii-center-block)
(clock . org-ascii-clock) (clock . org-ascii-clock)
(code . org-ascii-code) (code . org-ascii-code)
(comment . (lambda (&rest args) "")) (comment . (lambda (&rest args) ""))
(comment-block . (lambda (&rest args) "")) (comment-block . (lambda (&rest args) ""))
(drawer . org-ascii-drawer) (drawer . org-ascii-drawer)
(dynamic-block . org-ascii-dynamic-block) (dynamic-block . org-ascii-dynamic-block)
(entity . org-ascii-entity) (entity . org-ascii-entity)
(example-block . org-ascii-example-block) (example-block . org-ascii-example-block)
(export-block . org-ascii-export-block) (export-block . org-ascii-export-block)
(export-snippet . org-ascii-export-snippet) (export-snippet . org-ascii-export-snippet)
(fixed-width . org-ascii-fixed-width) (fixed-width . org-ascii-fixed-width)
(footnote-definition . org-ascii-footnote-definition) (footnote-definition . org-ascii-footnote-definition)
(footnote-reference . org-ascii-footnote-reference) (footnote-reference . org-ascii-footnote-reference)
(headline . org-ascii-headline) (headline . org-ascii-headline)
(horizontal-rule . org-ascii-horizontal-rule) (horizontal-rule . org-ascii-horizontal-rule)
(inline-src-block . org-ascii-inline-src-block) (inline-src-block . org-ascii-inline-src-block)
(inlinetask . org-ascii-inlinetask) (inlinetask . org-ascii-inlinetask)
(inner-template . org-ascii-inner-template) (inner-template . org-ascii-inner-template)
(italic . org-ascii-italic) (italic . org-ascii-italic)
(item . org-ascii-item) (item . org-ascii-item)
(keyword . org-ascii-keyword) (keyword . org-ascii-keyword)
(latex-environment . org-ascii-latex-environment) (latex-environment . org-ascii-latex-environment)
(latex-fragment . org-ascii-latex-fragment) (latex-fragment . org-ascii-latex-fragment)
(line-break . org-ascii-line-break) (line-break . org-ascii-line-break)
(link . org-ascii-link) (link . org-ascii-link)
(paragraph . org-ascii-paragraph) (paragraph . org-ascii-paragraph)
(plain-list . org-ascii-plain-list) (plain-list . org-ascii-plain-list)
(plain-text . org-ascii-plain-text) (plain-text . org-ascii-plain-text)
(planning . org-ascii-planning) (planning . org-ascii-planning)
(quote-block . org-ascii-quote-block) (quote-block . org-ascii-quote-block)
(quote-section . org-ascii-quote-section) (quote-section . org-ascii-quote-section)
(radio-target . org-ascii-radio-target) (radio-target . org-ascii-radio-target)
(section . org-ascii-section) (section . org-ascii-section)
(special-block . org-ascii-special-block) (special-block . org-ascii-special-block)
(src-block . org-ascii-src-block) (src-block . org-ascii-src-block)
(statistics-cookie . org-ascii-statistics-cookie) (statistics-cookie . org-ascii-statistics-cookie)
(strike-through . org-ascii-strike-through) (strike-through . org-ascii-strike-through)
(subscript . org-ascii-subscript) (subscript . org-ascii-subscript)
(superscript . org-ascii-superscript) (superscript . org-ascii-superscript)
(table . org-ascii-table) (table . org-ascii-table)
(table-cell . org-ascii-table-cell) (table-cell . org-ascii-table-cell)
(table-row . org-ascii-table-row) (table-row . org-ascii-table-row)
(target . org-ascii-target) (target . org-ascii-target)
(template . org-ascii-template) (template . org-ascii-template)
(timestamp . org-ascii-timestamp) (timestamp . org-ascii-timestamp)
(underline . org-ascii-underline) (underline . org-ascii-underline)
(verbatim . org-ascii-verbatim) (verbatim . org-ascii-verbatim)
(verse-block . org-ascii-verse-block)) (verse-block . org-ascii-verse-block))
:export-block "ASCII" :export-block "ASCII"
:menu-entry :menu-entry
(?t "Export to Plain Text" '(?t "Export to Plain Text"
((?A "As ASCII buffer" ((?A "As ASCII buffer"
(lambda (a s v b) (lambda (a s v b)
(org-ascii-export-as-ascii a s v b '(:ascii-charset ascii)))) (org-ascii-export-as-ascii a s v b '(:ascii-charset ascii))))
(?a "As ASCII file" (?a "As ASCII file"
(lambda (a s v b) (lambda (a s v b)
(org-ascii-export-to-ascii a s v b '(:ascii-charset ascii)))) (org-ascii-export-to-ascii a s v b '(:ascii-charset ascii))))
(?L "As Latin1 buffer" (?L "As Latin1 buffer"
(lambda (a s v b) (lambda (a s v b)
(org-ascii-export-as-ascii a s v b '(:ascii-charset latin1)))) (org-ascii-export-as-ascii a s v b '(:ascii-charset latin1))))
(?l "As Latin1 file" (?l "As Latin1 file"
(lambda (a s v b) (lambda (a s v b)
(org-ascii-export-to-ascii a s v b '(:ascii-charset latin1)))) (org-ascii-export-to-ascii a s v b '(:ascii-charset latin1))))
(?U "As UTF-8 buffer" (?U "As UTF-8 buffer"
(lambda (a s v b) (lambda (a s v b)
(org-ascii-export-as-ascii a s v b '(:ascii-charset utf-8)))) (org-ascii-export-as-ascii a s v b '(:ascii-charset utf-8))))
(?u "As UTF-8 file" (?u "As UTF-8 file"
(lambda (a s v b) (lambda (a s v b)
(org-ascii-export-to-ascii a s v b '(:ascii-charset utf-8)))))) (org-ascii-export-to-ascii a s v b '(:ascii-charset utf-8))))))
:filters-alist ((:filter-headline . org-ascii-filter-headline-blank-lines) :filters-alist '((:filter-headline . org-ascii-filter-headline-blank-lines)
(:filter-parse-tree org-ascii-filter-paragraph-spacing (:filter-parse-tree org-ascii-filter-paragraph-spacing
org-ascii-filter-comment-spacing) org-ascii-filter-comment-spacing)
(:filter-section . org-ascii-filter-headline-blank-lines)) (:filter-section . org-ascii-filter-headline-blank-lines))
:options-alist ((:ascii-charset nil nil org-ascii-charset))) :options-alist '((:ascii-charset nil nil org-ascii-charset)))
@ -239,8 +239,8 @@ Possible values are:
(const :tag "UTF-8" utf-8))) (const :tag "UTF-8" utf-8)))
(defcustom org-ascii-underline '((ascii ?= ?~ ?-) (defcustom org-ascii-underline '((ascii ?= ?~ ?-)
(latin1 ?= ?~ ?-) (latin1 ?= ?~ ?-)
(utf-8 ?═ ?─ ?╌ ?┄ ?┈)) (utf-8 ?═ ?─ ?╌ ?┄ ?┈))
"Characters for underlining headings in ASCII export. "Characters for underlining headings in ASCII export.
Alist whose key is a symbol among `ascii', `latin1' and `utf-8' Alist whose key is a symbol among `ascii', `latin1' and `utf-8'
@ -1895,15 +1895,15 @@ is non-nil."
(interactive) (interactive)
(if async (if async
(org-export-async-start (org-export-async-start
(lambda (output) (lambda (output)
(with-current-buffer (get-buffer-create "*Org ASCII Export*") (with-current-buffer (get-buffer-create "*Org ASCII Export*")
(erase-buffer) (erase-buffer)
(insert output) (insert output)
(goto-char (point-min)) (goto-char (point-min))
(text-mode) (text-mode)
(org-export-add-to-stack (current-buffer) 'ascii))) (org-export-add-to-stack (current-buffer) 'ascii)))
`(org-export-as 'ascii ,subtreep ,visible-only ,body-only `(org-export-as 'ascii ,subtreep ,visible-only ,body-only
',ext-plist)) ',ext-plist))
(let ((outbuf (org-export-to-buffer (let ((outbuf (org-export-to-buffer
'ascii "*Org ASCII Export*" 'ascii "*Org ASCII Export*"
subtreep visible-only body-only ext-plist))) subtreep visible-only body-only ext-plist)))
@ -1944,10 +1944,10 @@ Return output file's name."
(let ((outfile (org-export-output-file-name ".txt" subtreep))) (let ((outfile (org-export-output-file-name ".txt" subtreep)))
(if async (if async
(org-export-async-start (org-export-async-start
(lambda (f) (org-export-add-to-stack f 'ascii)) (lambda (f) (org-export-add-to-stack f 'ascii))
`(expand-file-name `(expand-file-name
(org-export-to-file (org-export-to-file
'ascii ,outfile ,subtreep ,visible-only ,body-only ',ext-plist))) 'ascii ,outfile ,subtreep ,visible-only ,body-only ',ext-plist)))
(org-export-to-file (org-export-to-file
'ascii outfile subtreep visible-only body-only ext-plist)))) 'ascii outfile subtreep visible-only body-only ext-plist))))

View File

@ -293,36 +293,36 @@ Return overlay specification, as a string, or nil."
;;; Define Back-End ;;; Define Back-End
(org-export-define-derived-backend beamer latex (org-export-define-derived-backend 'beamer 'latex
:export-block "BEAMER" :export-block "BEAMER"
:menu-entry :menu-entry
(?l 1 '(?l 1
((?B "As LaTeX buffer (Beamer)" org-beamer-export-as-latex) ((?B "As LaTeX buffer (Beamer)" org-beamer-export-as-latex)
(?b "As LaTeX file (Beamer)" org-beamer-export-to-latex) (?b "As LaTeX file (Beamer)" org-beamer-export-to-latex)
(?P "As PDF file (Beamer)" org-beamer-export-to-pdf) (?P "As PDF file (Beamer)" org-beamer-export-to-pdf)
(?O "As PDF file and open (Beamer)" (?O "As PDF file and open (Beamer)"
(lambda (a s v b) (lambda (a s v b)
(if a (org-beamer-export-to-pdf t s v b) (if a (org-beamer-export-to-pdf t s v b)
(org-open-file (org-beamer-export-to-pdf nil s v b))))))) (org-open-file (org-beamer-export-to-pdf nil s v b)))))))
:options-alist :options-alist
((:beamer-theme "BEAMER_THEME" nil org-beamer-theme) '((:beamer-theme "BEAMER_THEME" nil org-beamer-theme)
(:beamer-color-theme "BEAMER_COLOR_THEME" nil nil t) (:beamer-color-theme "BEAMER_COLOR_THEME" nil nil t)
(:beamer-font-theme "BEAMER_FONT_THEME" nil nil t) (:beamer-font-theme "BEAMER_FONT_THEME" nil nil t)
(:beamer-inner-theme "BEAMER_INNER_THEME" nil nil t) (:beamer-inner-theme "BEAMER_INNER_THEME" nil nil t)
(:beamer-outer-theme "BEAMER_OUTER_THEME" nil nil t) (:beamer-outer-theme "BEAMER_OUTER_THEME" nil nil t)
(:beamer-header-extra "BEAMER_HEADER" nil nil newline) (:beamer-header-extra "BEAMER_HEADER" nil nil newline)
(:headline-levels nil "H" org-beamer-frame-level)) (:headline-levels nil "H" org-beamer-frame-level))
:translate-alist ((bold . org-beamer-bold) :translate-alist '((bold . org-beamer-bold)
(export-block . org-beamer-export-block) (export-block . org-beamer-export-block)
(export-snippet . org-beamer-export-snippet) (export-snippet . org-beamer-export-snippet)
(headline . org-beamer-headline) (headline . org-beamer-headline)
(item . org-beamer-item) (item . org-beamer-item)
(keyword . org-beamer-keyword) (keyword . org-beamer-keyword)
(link . org-beamer-link) (link . org-beamer-link)
(plain-list . org-beamer-plain-list) (plain-list . org-beamer-plain-list)
(radio-target . org-beamer-radio-target) (radio-target . org-beamer-radio-target)
(target . org-beamer-target) (target . org-beamer-target)
(template . org-beamer-template))) (template . org-beamer-template)))

View File

@ -49,86 +49,86 @@
;;; Define Back-End ;;; Define Back-End
(org-export-define-backend html (org-export-define-backend 'html
((bold . org-html-bold) '((bold . org-html-bold)
(center-block . org-html-center-block) (center-block . org-html-center-block)
(clock . org-html-clock) (clock . org-html-clock)
(code . org-html-code) (code . org-html-code)
(drawer . org-html-drawer) (drawer . org-html-drawer)
(dynamic-block . org-html-dynamic-block) (dynamic-block . org-html-dynamic-block)
(entity . org-html-entity) (entity . org-html-entity)
(example-block . org-html-example-block) (example-block . org-html-example-block)
(export-block . org-html-export-block) (export-block . org-html-export-block)
(export-snippet . org-html-export-snippet) (export-snippet . org-html-export-snippet)
(fixed-width . org-html-fixed-width) (fixed-width . org-html-fixed-width)
(footnote-definition . org-html-footnote-definition) (footnote-definition . org-html-footnote-definition)
(footnote-reference . org-html-footnote-reference) (footnote-reference . org-html-footnote-reference)
(headline . org-html-headline) (headline . org-html-headline)
(horizontal-rule . org-html-horizontal-rule) (horizontal-rule . org-html-horizontal-rule)
(inline-src-block . org-html-inline-src-block) (inline-src-block . org-html-inline-src-block)
(inlinetask . org-html-inlinetask) (inlinetask . org-html-inlinetask)
(inner-template . org-html-inner-template) (inner-template . org-html-inner-template)
(italic . org-html-italic) (italic . org-html-italic)
(item . org-html-item) (item . org-html-item)
(keyword . org-html-keyword) (keyword . org-html-keyword)
(latex-environment . org-html-latex-environment) (latex-environment . org-html-latex-environment)
(latex-fragment . org-html-latex-fragment) (latex-fragment . org-html-latex-fragment)
(line-break . org-html-line-break) (line-break . org-html-line-break)
(link . org-html-link) (link . org-html-link)
(paragraph . org-html-paragraph) (paragraph . org-html-paragraph)
(plain-list . org-html-plain-list) (plain-list . org-html-plain-list)
(plain-text . org-html-plain-text) (plain-text . org-html-plain-text)
(planning . org-html-planning) (planning . org-html-planning)
(property-drawer . org-html-property-drawer) (property-drawer . org-html-property-drawer)
(quote-block . org-html-quote-block) (quote-block . org-html-quote-block)
(quote-section . org-html-quote-section) (quote-section . org-html-quote-section)
(radio-target . org-html-radio-target) (radio-target . org-html-radio-target)
(section . org-html-section) (section . org-html-section)
(special-block . org-html-special-block) (special-block . org-html-special-block)
(src-block . org-html-src-block) (src-block . org-html-src-block)
(statistics-cookie . org-html-statistics-cookie) (statistics-cookie . org-html-statistics-cookie)
(strike-through . org-html-strike-through) (strike-through . org-html-strike-through)
(subscript . org-html-subscript) (subscript . org-html-subscript)
(superscript . org-html-superscript) (superscript . org-html-superscript)
(table . org-html-table) (table . org-html-table)
(table-cell . org-html-table-cell) (table-cell . org-html-table-cell)
(table-row . org-html-table-row) (table-row . org-html-table-row)
(target . org-html-target) (target . org-html-target)
(template . org-html-template) (template . org-html-template)
(timestamp . org-html-timestamp) (timestamp . org-html-timestamp)
(underline . org-html-underline) (underline . org-html-underline)
(verbatim . org-html-verbatim) (verbatim . org-html-verbatim)
(verse-block . org-html-verse-block)) (verse-block . org-html-verse-block))
:export-block "HTML" :export-block "HTML"
:filters-alist ((:filter-options . org-html-infojs-install-script) :filters-alist '((:filter-options . org-html-infojs-install-script)
(:filter-final-output . org-html-final-function)) (:filter-final-output . org-html-final-function))
:menu-entry :menu-entry
(?h "Export to HTML" '(?h "Export to HTML"
((?H "As HTML buffer" org-html-export-as-html) ((?H "As HTML buffer" org-html-export-as-html)
(?h "As HTML file" org-html-export-to-html) (?h "As HTML file" org-html-export-to-html)
(?o "As HTML file and open" (?o "As HTML file and open"
(lambda (a s v b) (lambda (a s v b)
(if a (org-html-export-to-html t s v b) (if a (org-html-export-to-html t s v b)
(org-open-file (org-html-export-to-html nil s v b))))))) (org-open-file (org-html-export-to-html nil s v b)))))))
:options-alist :options-alist
((:html-extension nil nil org-html-extension) '((:html-extension nil nil org-html-extension)
(:html-doctype "HTML_DOCTYPE" nil org-html-doctype) (:html-doctype "HTML_DOCTYPE" nil org-html-doctype)
(:html-container "HTML_CONTAINER" nil org-html-container-element) (:html-container "HTML_CONTAINER" nil org-html-container-element)
(:html-link-home "HTML_LINK_HOME" nil org-html-link-home) (:html-link-home "HTML_LINK_HOME" nil org-html-link-home)
(:html-link-up "HTML_LINK_UP" nil org-html-link-up) (:html-link-up "HTML_LINK_UP" nil org-html-link-up)
(:html-mathjax "HTML_MATHJAX" nil "" space) (:html-mathjax "HTML_MATHJAX" nil "" space)
(:html-postamble nil "html-postamble" org-html-postamble) (:html-postamble nil "html-postamble" org-html-postamble)
(:html-preamble nil "html-preamble" org-html-preamble) (:html-preamble nil "html-preamble" org-html-preamble)
(:html-head "HTML_HEAD" nil org-html-head newline) (:html-head "HTML_HEAD" nil org-html-head newline)
(:html-head-extra "HTML_HEAD_EXTRA" nil org-html-head-extra newline) (:html-head-extra "HTML_HEAD_EXTRA" nil org-html-head-extra newline)
(:html-head-include-default-style "HTML_INCLUDE_STYLE" nil org-html-head-include-default-style newline) (:html-head-include-default-style "HTML_INCLUDE_STYLE" nil org-html-head-include-default-style newline)
(:html-head-include-scripts "HTML_INCLUDE_SCRIPTS" nil org-html-head-include-scripts newline) (:html-head-include-scripts "HTML_INCLUDE_SCRIPTS" nil org-html-head-include-scripts newline)
(:html-table-tag nil nil org-html-table-tag) (:html-table-tag nil nil org-html-table-tag)
;; Redefine regular options. ;; Redefine regular options.
(:creator "CREATOR" nil org-html-creator-string) (:creator "CREATOR" nil org-html-creator-string)
(:with-latex nil "tex" org-html-with-latex) (:with-latex nil "tex" org-html-with-latex)
;; Leave room for "ox-infojs.el" extension. ;; Leave room for "ox-infojs.el" extension.
(:infojs-opt "INFOJS_OPT" nil nil))) (:infojs-opt "INFOJS_OPT" nil nil)))
;;; Internal Variables ;;; Internal Variables

View File

@ -255,31 +255,31 @@ re-read the iCalendar file.")
;;; Define Back-End ;;; Define Back-End
(org-export-define-derived-backend icalendar ascii (org-export-define-derived-backend 'icalendar 'ascii
:translate-alist ((clock . ignore) :translate-alist '((clock . ignore)
(headline . org-icalendar-entry) (headline . org-icalendar-entry)
(inlinetask . ignore) (inlinetask . ignore)
(planning . ignore) (planning . ignore)
(section . ignore) (section . ignore)
(template . org-icalendar-template)) (template . org-icalendar-template))
:options-alist :options-alist
((:exclude-tags '((:exclude-tags
"ICALENDAR_EXCLUDE_TAGS" nil org-icalendar-exclude-tags split) "ICALENDAR_EXCLUDE_TAGS" nil org-icalendar-exclude-tags split)
(:with-timestamps nil "<" org-icalendar-with-timestamps) (:with-timestamps nil "<" org-icalendar-with-timestamps)
(:with-vtodo nil nil org-icalendar-include-todo) (:with-vtodo nil nil org-icalendar-include-todo)
;; The following property will be non-nil when export has been ;; The following property will be non-nil when export has been
;; started from org-agenda-mode. In this case, any entry without ;; started from org-agenda-mode. In this case, any entry without
;; a non-nil "ICALENDAR_MARK" property will be ignored. ;; a non-nil "ICALENDAR_MARK" property will be ignored.
(:icalendar-agenda-view nil nil nil)) (:icalendar-agenda-view nil nil nil))
:filters-alist :filters-alist
((:filter-headline . org-icalendar-clear-blank-lines)) '((:filter-headline . org-icalendar-clear-blank-lines))
:menu-entry :menu-entry
(?c "Export to iCalendar" '(?c "Export to iCalendar"
((?f "Current file" org-icalendar-export-to-ics) ((?f "Current file" org-icalendar-export-to-ics)
(?a "All agenda files" (?a "All agenda files"
(lambda (a s v b) (org-icalendar-export-agenda-files a))) (lambda (a s v b) (org-icalendar-export-agenda-files a)))
(?c "Combine all agenda files" (?c "Combine all agenda files"
(lambda (a s v b) (org-icalendar-combine-agenda-files a)))))) (lambda (a s v b) (org-icalendar-combine-agenda-files a))))))

View File

@ -115,76 +115,76 @@
;;; Define Back-End ;;; Define Back-End
(org-export-define-backend latex (org-export-define-backend 'latex
((bold . org-latex-bold) '((bold . org-latex-bold)
(center-block . org-latex-center-block) (center-block . org-latex-center-block)
(clock . org-latex-clock) (clock . org-latex-clock)
(code . org-latex-code) (code . org-latex-code)
(comment . (lambda (&rest args) "")) (comment . (lambda (&rest args) ""))
(comment-block . (lambda (&rest args) "")) (comment-block . (lambda (&rest args) ""))
(drawer . org-latex-drawer) (drawer . org-latex-drawer)
(dynamic-block . org-latex-dynamic-block) (dynamic-block . org-latex-dynamic-block)
(entity . org-latex-entity) (entity . org-latex-entity)
(example-block . org-latex-example-block) (example-block . org-latex-example-block)
(export-block . org-latex-export-block) (export-block . org-latex-export-block)
(export-snippet . org-latex-export-snippet) (export-snippet . org-latex-export-snippet)
(fixed-width . org-latex-fixed-width) (fixed-width . org-latex-fixed-width)
(footnote-definition . org-latex-footnote-definition) (footnote-definition . org-latex-footnote-definition)
(footnote-reference . org-latex-footnote-reference) (footnote-reference . org-latex-footnote-reference)
(headline . org-latex-headline) (headline . org-latex-headline)
(horizontal-rule . org-latex-horizontal-rule) (horizontal-rule . org-latex-horizontal-rule)
(inline-src-block . org-latex-inline-src-block) (inline-src-block . org-latex-inline-src-block)
(inlinetask . org-latex-inlinetask) (inlinetask . org-latex-inlinetask)
(italic . org-latex-italic) (italic . org-latex-italic)
(item . org-latex-item) (item . org-latex-item)
(keyword . org-latex-keyword) (keyword . org-latex-keyword)
(latex-environment . org-latex-latex-environment) (latex-environment . org-latex-latex-environment)
(latex-fragment . org-latex-latex-fragment) (latex-fragment . org-latex-latex-fragment)
(line-break . org-latex-line-break) (line-break . org-latex-line-break)
(link . org-latex-link) (link . org-latex-link)
(paragraph . org-latex-paragraph) (paragraph . org-latex-paragraph)
(plain-list . org-latex-plain-list) (plain-list . org-latex-plain-list)
(plain-text . org-latex-plain-text) (plain-text . org-latex-plain-text)
(planning . org-latex-planning) (planning . org-latex-planning)
(property-drawer . (lambda (&rest args) "")) (property-drawer . (lambda (&rest args) ""))
(quote-block . org-latex-quote-block) (quote-block . org-latex-quote-block)
(quote-section . org-latex-quote-section) (quote-section . org-latex-quote-section)
(radio-target . org-latex-radio-target) (radio-target . org-latex-radio-target)
(section . org-latex-section) (section . org-latex-section)
(special-block . org-latex-special-block) (special-block . org-latex-special-block)
(src-block . org-latex-src-block) (src-block . org-latex-src-block)
(statistics-cookie . org-latex-statistics-cookie) (statistics-cookie . org-latex-statistics-cookie)
(strike-through . org-latex-strike-through) (strike-through . org-latex-strike-through)
(subscript . org-latex-subscript) (subscript . org-latex-subscript)
(superscript . org-latex-superscript) (superscript . org-latex-superscript)
(table . org-latex-table) (table . org-latex-table)
(table-cell . org-latex-table-cell) (table-cell . org-latex-table-cell)
(table-row . org-latex-table-row) (table-row . org-latex-table-row)
(target . org-latex-target) (target . org-latex-target)
(template . org-latex-template) (template . org-latex-template)
(timestamp . org-latex-timestamp) (timestamp . org-latex-timestamp)
(underline . org-latex-underline) (underline . org-latex-underline)
(verbatim . org-latex-verbatim) (verbatim . org-latex-verbatim)
(verse-block . org-latex-verse-block)) (verse-block . org-latex-verse-block))
:export-block ("LATEX" "TEX") :export-block '("LATEX" "TEX")
:menu-entry :menu-entry
(?l "Export to LaTeX" '(?l "Export to LaTeX"
((?L "As LaTeX buffer" org-latex-export-as-latex) ((?L "As LaTeX buffer" org-latex-export-as-latex)
(?l "As LaTeX file" org-latex-export-to-latex) (?l "As LaTeX file" org-latex-export-to-latex)
(?p "As PDF file" org-latex-export-to-pdf) (?p "As PDF file" org-latex-export-to-pdf)
(?o "As PDF file and open" (?o "As PDF file and open"
(lambda (a s v b) (lambda (a s v b)
(if a (org-latex-export-to-pdf t s v b) (if a (org-latex-export-to-pdf t s v b)
(org-open-file (org-latex-export-to-pdf nil s v b))))))) (org-open-file (org-latex-export-to-pdf nil s v b)))))))
:options-alist ((:date-format nil nil org-latex-date-timestamp-format) :options-alist '((:date-format nil nil org-latex-date-timestamp-format)
(:latex-class "LATEX_CLASS" nil org-latex-default-class t) (:latex-class "LATEX_CLASS" nil org-latex-default-class t)
(:latex-class-options "LATEX_CLASS_OPTIONS" nil nil t) (:latex-class-options "LATEX_CLASS_OPTIONS" nil nil t)
(:latex-header "LATEX_HEADER" nil nil newline) (:latex-header "LATEX_HEADER" nil nil newline)
(:latex-header-extra "LATEX_HEADER_EXTRA" nil nil newline) (:latex-header-extra "LATEX_HEADER_EXTRA" nil nil newline)
(:latex-hyperref-p nil "texht" org-latex-with-hyperref t) (:latex-hyperref-p nil "texht" org-latex-with-hyperref t)
;; Redefine regular options. ;; Redefine regular options.
(:date "DATE" nil "\\today" t) (:date "DATE" nil "\\today" t)
(:with-smart-quotes nil "'" t))) (:with-smart-quotes nil "'" t)))

View File

@ -49,70 +49,70 @@
;;; Define Back-End ;;; Define Back-End
(org-export-define-backend man (org-export-define-backend 'man
((babel-call . org-man-babel-call) '((babel-call . org-man-babel-call)
(bold . org-man-bold) (bold . org-man-bold)
(center-block . org-man-center-block) (center-block . org-man-center-block)
(clock . org-man-clock) (clock . org-man-clock)
(code . org-man-code) (code . org-man-code)
(comment . (lambda (&rest args) "")) (comment . (lambda (&rest args) ""))
(comment-block . (lambda (&rest args) "")) (comment-block . (lambda (&rest args) ""))
(drawer . org-man-drawer) (drawer . org-man-drawer)
(dynamic-block . org-man-dynamic-block) (dynamic-block . org-man-dynamic-block)
(entity . org-man-entity) (entity . org-man-entity)
(example-block . org-man-example-block) (example-block . org-man-example-block)
(export-block . org-man-export-block) (export-block . org-man-export-block)
(export-snippet . org-man-export-snippet) (export-snippet . org-man-export-snippet)
(fixed-width . org-man-fixed-width) (fixed-width . org-man-fixed-width)
(footnote-definition . org-man-footnote-definition) (footnote-definition . org-man-footnote-definition)
(footnote-reference . org-man-footnote-reference) (footnote-reference . org-man-footnote-reference)
(headline . org-man-headline) (headline . org-man-headline)
(horizontal-rule . org-man-horizontal-rule) (horizontal-rule . org-man-horizontal-rule)
(inline-babel-call . org-man-inline-babel-call) (inline-babel-call . org-man-inline-babel-call)
(inline-src-block . org-man-inline-src-block) (inline-src-block . org-man-inline-src-block)
(inlinetask . org-man-inlinetask) (inlinetask . org-man-inlinetask)
(italic . org-man-italic) (italic . org-man-italic)
(item . org-man-item) (item . org-man-item)
(keyword . org-man-keyword) (keyword . org-man-keyword)
(line-break . org-man-line-break) (line-break . org-man-line-break)
(link . org-man-link) (link . org-man-link)
(paragraph . org-man-paragraph) (paragraph . org-man-paragraph)
(plain-list . org-man-plain-list) (plain-list . org-man-plain-list)
(plain-text . org-man-plain-text) (plain-text . org-man-plain-text)
(planning . org-man-planning) (planning . org-man-planning)
(property-drawer . (lambda (&rest args) "")) (property-drawer . (lambda (&rest args) ""))
(quote-block . org-man-quote-block) (quote-block . org-man-quote-block)
(quote-section . org-man-quote-section) (quote-section . org-man-quote-section)
(radio-target . org-man-radio-target) (radio-target . org-man-radio-target)
(section . org-man-section) (section . org-man-section)
(special-block . org-man-special-block) (special-block . org-man-special-block)
(src-block . org-man-src-block) (src-block . org-man-src-block)
(statistics-cookie . org-man-statistics-cookie) (statistics-cookie . org-man-statistics-cookie)
(strike-through . org-man-strike-through) (strike-through . org-man-strike-through)
(subscript . org-man-subscript) (subscript . org-man-subscript)
(superscript . org-man-superscript) (superscript . org-man-superscript)
(table . org-man-table) (table . org-man-table)
(table-cell . org-man-table-cell) (table-cell . org-man-table-cell)
(table-row . org-man-table-row) (table-row . org-man-table-row)
(target . org-man-target) (target . org-man-target)
(template . org-man-template) (template . org-man-template)
(timestamp . org-man-timestamp) (timestamp . org-man-timestamp)
(underline . org-man-underline) (underline . org-man-underline)
(verbatim . org-man-verbatim) (verbatim . org-man-verbatim)
(verse-block . org-man-verse-block)) (verse-block . org-man-verse-block))
:export-block "MAN" :export-block "MAN"
:menu-entry :menu-entry
(?m "Export to MAN" '(?m "Export to MAN"
((?m "As MAN file" org-man-export-to-man) ((?m "As MAN file" org-man-export-to-man)
(?p "As PDF file" org-man-export-to-pdf) (?p "As PDF file" org-man-export-to-pdf)
(?o "As PDF file and open" (?o "As PDF file and open"
(lambda (a s v b) (lambda (a s v b)
(if a (org-man-export-to-pdf t s v b) (if a (org-man-export-to-pdf t s v b)
(org-open-file (org-man-export-to-pdf nil s v b))))))) (org-open-file (org-man-export-to-pdf nil s v b)))))))
:options-alist :options-alist
((:man-class "MAN_CLASS" nil nil t) '((:man-class "MAN_CLASS" nil nil t)
(:man-class-options "MAN_CLASS_OPTIONS" nil nil t) (:man-class-options "MAN_CLASS_OPTIONS" nil nil t)
(:man-header-extra "MAN_HEADER" nil nil newline))) (:man-header-extra "MAN_HEADER" nil nil newline)))

View File

@ -55,43 +55,43 @@ This variable can be set to either `atx' or `setext'."
;;; Define Back-End ;;; Define Back-End
(org-export-define-derived-backend md html (org-export-define-derived-backend 'md 'html
:export-block ("MD" "MARKDOWN") :export-block '("MD" "MARKDOWN")
:filters-alist ((:filter-parse-tree . org-md-separate-elements)) :filters-alist '((:filter-parse-tree . org-md-separate-elements))
:menu-entry :menu-entry
(?m "Export to Markdown" '(?m "Export to Markdown"
((?M "To temporary buffer" ((?M "To temporary buffer"
(lambda (a s v b) (org-md-export-as-markdown a s v))) (lambda (a s v b) (org-md-export-as-markdown a s v)))
(?m "To file" (lambda (a s v b) (org-md-export-to-markdown a s v))) (?m "To file" (lambda (a s v b) (org-md-export-to-markdown a s v)))
(?o "To file and open" (?o "To file and open"
(lambda (a s v b) (lambda (a s v b)
(if a (org-md-export-to-markdown t s v) (if a (org-md-export-to-markdown t s v)
(org-open-file (org-md-export-to-markdown nil s v))))))) (org-open-file (org-md-export-to-markdown nil s v)))))))
:translate-alist ((bold . org-md-bold) :translate-alist '((bold . org-md-bold)
(code . org-md-verbatim) (code . org-md-verbatim)
(underline . org-md-verbatim) (underline . org-md-verbatim)
(comment . (lambda (&rest args) "")) (comment . (lambda (&rest args) ""))
(comment-block . (lambda (&rest args) "")) (comment-block . (lambda (&rest args) ""))
(example-block . org-md-example-block) (example-block . org-md-example-block)
(fixed-width . org-md-example-block) (fixed-width . org-md-example-block)
(footnote-definition . ignore) (footnote-definition . ignore)
(footnote-reference . ignore) (footnote-reference . ignore)
(headline . org-md-headline) (headline . org-md-headline)
(horizontal-rule . org-md-horizontal-rule) (horizontal-rule . org-md-horizontal-rule)
(inline-src-block . org-md-verbatim) (inline-src-block . org-md-verbatim)
(italic . org-md-italic) (italic . org-md-italic)
(item . org-md-item) (item . org-md-item)
(line-break . org-md-line-break) (line-break . org-md-line-break)
(link . org-md-link) (link . org-md-link)
(paragraph . org-md-paragraph) (paragraph . org-md-paragraph)
(plain-list . org-md-plain-list) (plain-list . org-md-plain-list)
(plain-text . org-md-plain-text) (plain-text . org-md-plain-text)
(quote-block . org-md-quote-block) (quote-block . org-md-quote-block)
(quote-section . org-md-example-block) (quote-section . org-md-example-block)
(section . org-md-section) (section . org-md-section)
(src-block . org-md-example-block) (src-block . org-md-example-block)
(template . org-md-template) (template . org-md-template)
(verbatim . org-md-verbatim))) (verbatim . org-md-verbatim)))

View File

@ -34,71 +34,71 @@
;;; Define Back-End ;;; Define Back-End
(org-export-define-backend odt (org-export-define-backend 'odt
((bold . org-odt-bold) '((bold . org-odt-bold)
(center-block . org-odt-center-block) (center-block . org-odt-center-block)
(clock . org-odt-clock) (clock . org-odt-clock)
(code . org-odt-code) (code . org-odt-code)
(drawer . org-odt-drawer) (drawer . org-odt-drawer)
(dynamic-block . org-odt-dynamic-block) (dynamic-block . org-odt-dynamic-block)
(entity . org-odt-entity) (entity . org-odt-entity)
(example-block . org-odt-example-block) (example-block . org-odt-example-block)
(export-block . org-odt-export-block) (export-block . org-odt-export-block)
(export-snippet . org-odt-export-snippet) (export-snippet . org-odt-export-snippet)
(fixed-width . org-odt-fixed-width) (fixed-width . org-odt-fixed-width)
(footnote-definition . org-odt-footnote-definition) (footnote-definition . org-odt-footnote-definition)
(footnote-reference . org-odt-footnote-reference) (footnote-reference . org-odt-footnote-reference)
(headline . org-odt-headline) (headline . org-odt-headline)
(horizontal-rule . org-odt-horizontal-rule) (horizontal-rule . org-odt-horizontal-rule)
(inline-src-block . org-odt-inline-src-block) (inline-src-block . org-odt-inline-src-block)
(inlinetask . org-odt-inlinetask) (inlinetask . org-odt-inlinetask)
(italic . org-odt-italic) (italic . org-odt-italic)
(item . org-odt-item) (item . org-odt-item)
(keyword . org-odt-keyword) (keyword . org-odt-keyword)
(latex-environment . org-odt-latex-environment) (latex-environment . org-odt-latex-environment)
(latex-fragment . org-odt-latex-fragment) (latex-fragment . org-odt-latex-fragment)
(line-break . org-odt-line-break) (line-break . org-odt-line-break)
(link . org-odt-link) (link . org-odt-link)
(paragraph . org-odt-paragraph) (paragraph . org-odt-paragraph)
(plain-list . org-odt-plain-list) (plain-list . org-odt-plain-list)
(plain-text . org-odt-plain-text) (plain-text . org-odt-plain-text)
(planning . org-odt-planning) (planning . org-odt-planning)
(property-drawer . org-odt-property-drawer) (property-drawer . org-odt-property-drawer)
(quote-block . org-odt-quote-block) (quote-block . org-odt-quote-block)
(quote-section . org-odt-quote-section) (quote-section . org-odt-quote-section)
(radio-target . org-odt-radio-target) (radio-target . org-odt-radio-target)
(section . org-odt-section) (section . org-odt-section)
(special-block . org-odt-special-block) (special-block . org-odt-special-block)
(src-block . org-odt-src-block) (src-block . org-odt-src-block)
(statistics-cookie . org-odt-statistics-cookie) (statistics-cookie . org-odt-statistics-cookie)
(strike-through . org-odt-strike-through) (strike-through . org-odt-strike-through)
(subscript . org-odt-subscript) (subscript . org-odt-subscript)
(superscript . org-odt-superscript) (superscript . org-odt-superscript)
(table . org-odt-table) (table . org-odt-table)
(table-cell . org-odt-table-cell) (table-cell . org-odt-table-cell)
(table-row . org-odt-table-row) (table-row . org-odt-table-row)
(target . org-odt-target) (target . org-odt-target)
(template . org-odt-template) (template . org-odt-template)
(timestamp . org-odt-timestamp) (timestamp . org-odt-timestamp)
(underline . org-odt-underline) (underline . org-odt-underline)
(verbatim . org-odt-verbatim) (verbatim . org-odt-verbatim)
(verse-block . org-odt-verse-block)) (verse-block . org-odt-verse-block))
:export-block "ODT" :export-block "ODT"
:filters-alist ((:filter-parse-tree :filters-alist '((:filter-parse-tree
. (org-odt--translate-latex-fragments . (org-odt--translate-latex-fragments
org-odt--translate-description-lists org-odt--translate-description-lists
org-odt--translate-list-tables))) org-odt--translate-list-tables)))
:menu-entry :menu-entry
(?o "Export to ODT" '(?o "Export to ODT"
((?o "As ODT file" org-odt-export-to-odt) ((?o "As ODT file" org-odt-export-to-odt)
(?O "As ODT file and open" (?O "As ODT file and open"
(lambda (a s v b) (lambda (a s v b)
(if a (org-odt-export-to-odt t s v) (if a (org-odt-export-to-odt t s v)
(org-open-file (org-odt-export-to-odt nil s v) 'system)))))) (org-open-file (org-odt-export-to-odt nil s v) 'system))))))
:options-alist :options-alist
((:odt-styles-file "ODT_STYLES_FILE" nil nil t) '((:odt-styles-file "ODT_STYLES_FILE" nil nil t)
;; Redefine regular option. ;; Redefine regular option.
(:with-latex nil "tex" org-odt-with-latex))) (:with-latex nil "tex" org-odt-with-latex)))
;;; Dependencies ;;; Dependencies

View File

@ -52,57 +52,57 @@ setting of `org-html-htmlize-output-type' is 'css."
(const :tag "Don't include external stylesheet link" nil) (const :tag "Don't include external stylesheet link" nil)
(string :tag "URL or local href"))) (string :tag "URL or local href")))
(org-export-define-backend org (org-export-define-backend 'org
((babel-call . org-org-identity) '((babel-call . org-org-identity)
(bold . org-org-identity) (bold . org-org-identity)
(center-block . org-org-identity) (center-block . org-org-identity)
(clock . org-org-identity) (clock . org-org-identity)
(code . org-org-identity) (code . org-org-identity)
(comment . (lambda (&rest args) "")) (comment . (lambda (&rest args) ""))
(comment-block . (lambda (&rest args) "")) (comment-block . (lambda (&rest args) ""))
(diary-sexp . org-org-identity) (diary-sexp . org-org-identity)
(drawer . org-org-identity) (drawer . org-org-identity)
(dynamic-block . org-org-identity) (dynamic-block . org-org-identity)
(entity . org-org-identity) (entity . org-org-identity)
(example-block . org-org-identity) (example-block . org-org-identity)
(fixed-width . org-org-identity) (fixed-width . org-org-identity)
(footnote-definition . org-org-identity) (footnote-definition . org-org-identity)
(footnote-reference . org-org-identity) (footnote-reference . org-org-identity)
(headline . org-org-headline) (headline . org-org-headline)
(horizontal-rule . org-org-identity) (horizontal-rule . org-org-identity)
(inline-babel-call . org-org-identity) (inline-babel-call . org-org-identity)
(inline-src-block . org-org-identity) (inline-src-block . org-org-identity)
(inlinetask . org-org-identity) (inlinetask . org-org-identity)
(italic . org-org-identity) (italic . org-org-identity)
(item . org-org-identity) (item . org-org-identity)
(keyword . org-org-keyword) (keyword . org-org-keyword)
(latex-environment . org-org-identity) (latex-environment . org-org-identity)
(latex-fragment . org-org-identity) (latex-fragment . org-org-identity)
(line-break . org-org-identity) (line-break . org-org-identity)
(link . org-org-identity) (link . org-org-identity)
(node-property . org-org-identity) (node-property . org-org-identity)
(paragraph . org-org-identity) (paragraph . org-org-identity)
(plain-list . org-org-identity) (plain-list . org-org-identity)
(planning . org-org-identity) (planning . org-org-identity)
(property-drawer . org-org-identity) (property-drawer . org-org-identity)
(quote-block . org-org-identity) (quote-block . org-org-identity)
(quote-section . org-org-identity) (quote-section . org-org-identity)
(radio-target . org-org-identity) (radio-target . org-org-identity)
(section . org-org-identity) (section . org-org-identity)
(special-block . org-org-identity) (special-block . org-org-identity)
(src-block . org-org-identity) (src-block . org-org-identity)
(statistics-cookie . org-org-identity) (statistics-cookie . org-org-identity)
(strike-through . org-org-identity) (strike-through . org-org-identity)
(subscript . org-org-identity) (subscript . org-org-identity)
(superscript . org-org-identity) (superscript . org-org-identity)
(table . org-org-identity) (table . org-org-identity)
(table-cell . org-org-identity) (table-cell . org-org-identity)
(table-row . org-org-identity) (table-row . org-org-identity)
(target . org-org-identity) (target . org-org-identity)
(timestamp . org-org-identity) (timestamp . org-org-identity)
(underline . org-org-identity) (underline . org-org-identity)
(verbatim . org-org-identity) (verbatim . org-org-identity)
(verse-block . org-org-identity))) (verse-block . org-org-identity)))
(defun org-org-identity (blob contents info) (defun org-org-identity (blob contents info)
"Transcode BLOB element or object back into Org syntax." "Transcode BLOB element or object back into Org syntax."

View File

@ -65,70 +65,70 @@
;;; Define Back-End ;;; Define Back-End
(org-export-define-backend texinfo (org-export-define-backend 'texinfo
((bold . org-texinfo-bold) '((bold . org-texinfo-bold)
(center-block . org-texinfo-center-block) (center-block . org-texinfo-center-block)
(clock . org-texinfo-clock) (clock . org-texinfo-clock)
(code . org-texinfo-code) (code . org-texinfo-code)
(comment . org-texinfo-comment) (comment . org-texinfo-comment)
(comment-block . org-texinfo-comment-block) (comment-block . org-texinfo-comment-block)
(drawer . org-texinfo-drawer) (drawer . org-texinfo-drawer)
(dynamic-block . org-texinfo-dynamic-block) (dynamic-block . org-texinfo-dynamic-block)
(entity . org-texinfo-entity) (entity . org-texinfo-entity)
(example-block . org-texinfo-example-block) (example-block . org-texinfo-example-block)
(export-block . org-texinfo-export-block) (export-block . org-texinfo-export-block)
(export-snippet . org-texinfo-export-snippet) (export-snippet . org-texinfo-export-snippet)
(fixed-width . org-texinfo-fixed-width) (fixed-width . org-texinfo-fixed-width)
(footnote-definition . org-texinfo-footnote-definition) (footnote-definition . org-texinfo-footnote-definition)
(footnote-reference . org-texinfo-footnote-reference) (footnote-reference . org-texinfo-footnote-reference)
(headline . org-texinfo-headline) (headline . org-texinfo-headline)
(inline-src-block . org-texinfo-inline-src-block) (inline-src-block . org-texinfo-inline-src-block)
(inlinetask . org-texinfo-inlinetask) (inlinetask . org-texinfo-inlinetask)
(italic . org-texinfo-italic) (italic . org-texinfo-italic)
(item . org-texinfo-item) (item . org-texinfo-item)
(keyword . org-texinfo-keyword) (keyword . org-texinfo-keyword)
(line-break . org-texinfo-line-break) (line-break . org-texinfo-line-break)
(link . org-texinfo-link) (link . org-texinfo-link)
(paragraph . org-texinfo-paragraph) (paragraph . org-texinfo-paragraph)
(plain-list . org-texinfo-plain-list) (plain-list . org-texinfo-plain-list)
(plain-text . org-texinfo-plain-text) (plain-text . org-texinfo-plain-text)
(planning . org-texinfo-planning) (planning . org-texinfo-planning)
(property-drawer . org-texinfo-property-drawer) (property-drawer . org-texinfo-property-drawer)
(quote-block . org-texinfo-quote-block) (quote-block . org-texinfo-quote-block)
(quote-section . org-texinfo-quote-section) (quote-section . org-texinfo-quote-section)
(radio-target . org-texinfo-radio-target) (radio-target . org-texinfo-radio-target)
(section . org-texinfo-section) (section . org-texinfo-section)
(special-block . org-texinfo-special-block) (special-block . org-texinfo-special-block)
(src-block . org-texinfo-src-block) (src-block . org-texinfo-src-block)
(statistics-cookie . org-texinfo-statistics-cookie) (statistics-cookie . org-texinfo-statistics-cookie)
(subscript . org-texinfo-subscript) (subscript . org-texinfo-subscript)
(superscript . org-texinfo-superscript) (superscript . org-texinfo-superscript)
(table . org-texinfo-table) (table . org-texinfo-table)
(table-cell . org-texinfo-table-cell) (table-cell . org-texinfo-table-cell)
(table-row . org-texinfo-table-row) (table-row . org-texinfo-table-row)
(target . org-texinfo-target) (target . org-texinfo-target)
(template . org-texinfo-template) (template . org-texinfo-template)
(timestamp . org-texinfo-timestamp) (timestamp . org-texinfo-timestamp)
(verbatim . org-texinfo-verbatim) (verbatim . org-texinfo-verbatim)
(verse-block . org-texinfo-verse-block)) (verse-block . org-texinfo-verse-block))
:export-block "TEXINFO" :export-block "TEXINFO"
:filters-alist :filters-alist
((:filter-headline . org-texinfo-filter-section-blank-lines) '((:filter-headline . org-texinfo-filter-section-blank-lines)
(:filter-section . org-texinfo-filter-section-blank-lines)) (:filter-section . org-texinfo-filter-section-blank-lines))
:menu-entry :menu-entry
(?i "Export to Texinfo" '(?i "Export to Texinfo"
((?t "As TEXI file" org-texinfo-export-to-texinfo) ((?t "As TEXI file" org-texinfo-export-to-texinfo)
(?i "As INFO file" org-texinfo-export-to-info))) (?i "As INFO file" org-texinfo-export-to-info)))
:options-alist :options-alist
((:texinfo-filename "TEXINFO_FILENAME" nil org-texinfo-filename t) '((:texinfo-filename "TEXINFO_FILENAME" nil org-texinfo-filename t)
(:texinfo-class "TEXINFO_CLASS" nil org-texinfo-default-class t) (:texinfo-class "TEXINFO_CLASS" nil org-texinfo-default-class t)
(:texinfo-header "TEXINFO_HEADER" nil nil newline) (:texinfo-header "TEXINFO_HEADER" nil nil newline)
(:texinfo-post-header "TEXINFO_POST_HEADER" nil nil newline) (:texinfo-post-header "TEXINFO_POST_HEADER" nil nil newline)
(:subtitle "SUBTITLE" nil nil newline) (:subtitle "SUBTITLE" nil nil newline)
(:subauthor "SUBAUTHOR" nil nil newline) (:subauthor "SUBAUTHOR" nil nil newline)
(:texinfo-dircat "TEXINFO_DIR_CATEGORY" nil nil t) (:texinfo-dircat "TEXINFO_DIR_CATEGORY" nil nil t)
(:texinfo-dirtitle "TEXINFO_DIR_TITLE" nil nil t) (:texinfo-dirtitle "TEXINFO_DIR_TITLE" nil nil t)
(:texinfo-dirdesc "TEXINFO_DIR_DESC" nil nil t))) (:texinfo-dirdesc "TEXINFO_DIR_DESC" nil nil t)))

View File

@ -842,7 +842,7 @@ mode."
;; Eventually `org-export-barf-if-invalid-backend' returns an error ;; Eventually `org-export-barf-if-invalid-backend' returns an error
;; when a given back-end hasn't been registered yet. ;; when a given back-end hasn't been registered yet.
(defmacro org-export-define-backend (backend translators &rest body) (defun org-export-define-backend (backend translators &rest body)
"Define a new back-end BACKEND. "Define a new back-end BACKEND.
TRANSLATORS is an alist between object or element types and TRANSLATORS is an alist between object or element types and
@ -905,7 +905,7 @@ keywords are understood:
Menu entry for the export dispatcher. It should be a list Menu entry for the export dispatcher. It should be a list
like: like:
\(KEY DESCRIPTION-OR-ORDINAL ACTION-OR-MENU) '(KEY DESCRIPTION-OR-ORDINAL ACTION-OR-MENU)
where : where :
@ -929,17 +929,17 @@ keywords are understood:
If it is an alist, associations should follow the If it is an alist, associations should follow the
pattern: pattern:
\(KEY DESCRIPTION ACTION) '(KEY DESCRIPTION ACTION)
where KEY, DESCRIPTION and ACTION are described above. where KEY, DESCRIPTION and ACTION are described above.
Valid values include: Valid values include:
\(?m \"My Special Back-end\" my-special-export-function) '(?m \"My Special Back-end\" my-special-export-function)
or or
\(?l \"Export to LaTeX\" '(?l \"Export to LaTeX\"
\(?p \"As PDF file\" org-latex-export-to-pdf) \(?p \"As PDF file\" org-latex-export-to-pdf)
\(?o \"As PDF file and open\" \(?o \"As PDF file and open\"
\(lambda (a s v b) \(lambda (a s v b)
@ -950,7 +950,7 @@ keywords are understood:
or the following, which will be added to the previous or the following, which will be added to the previous
sub-menu, sub-menu,
\(?l 1 '(?l 1
\((?B \"As TEX buffer (Beamer)\" org-beamer-export-as-latex) \((?B \"As TEX buffer (Beamer)\" org-beamer-export-as-latex)
\(?P \"As PDF file (Beamer)\" org-beamer-export-to-pdf))) \(?P \"As PDF file (Beamer)\" org-beamer-export-to-pdf)))
@ -960,8 +960,7 @@ keywords are understood:
communication channel and how their value are acquired. See communication channel and how their value are acquired. See
`org-export-options-alist' for more information about `org-export-options-alist' for more information about
structure of the values." structure of the values."
(declare (debug (&define name sexp [&rest [keywordp sexp]] defbody)) (declare (indent 1))
(indent 1))
(let (export-block filters menu-entry options contents) (let (export-block filters menu-entry options contents)
(while (keywordp (car body)) (while (keywordp (car body))
(case (pop body) (case (pop body)
@ -977,22 +976,19 @@ keywords are understood:
(and filters (list :filters-alist filters)) (and filters (list :filters-alist filters))
(and options (list :options-alist options)) (and options (list :options-alist options))
(and menu-entry (list :menu-entry menu-entry)))) (and menu-entry (list :menu-entry menu-entry))))
`(progn ;; Register back-end.
;; Register back-end. (let ((registeredp (assq backend org-export-registered-backends)))
(let ((registeredp (assq ',backend org-export-registered-backends))) (if registeredp (setcdr registeredp contents)
(if registeredp (setcdr registeredp ',contents) (push (cons backend contents) org-export-registered-backends)))
(push (cons ',backend ',contents) org-export-registered-backends))) ;; Tell parser to not parse EXPORT-BLOCK blocks.
;; Tell parser to not parse EXPORT-BLOCK blocks. (when export-block
,(when export-block (mapc
`(mapc (lambda (name)
(lambda (name) (add-to-list 'org-element-block-name-alist
(add-to-list 'org-element-block-name-alist `(,name . org-element-export-block-parser)))
`(,name . org-element-export-block-parser))) export-block))))
',export-block))
;; Splice in the body, if any.
,@body)))
(defmacro org-export-define-derived-backend (child parent &rest body) (defun org-export-define-derived-backend (child parent &rest body)
"Create a new back-end as a variant of an existing one. "Create a new back-end as a variant of an existing one.
CHILD is the name of the derived back-end. PARENT is the name of CHILD is the name of the derived back-end. PARENT is the name of
@ -1038,14 +1034,13 @@ keywords are understood:
As an example, here is how one could define \"my-latex\" back-end As an example, here is how one could define \"my-latex\" back-end
as a variant of `latex' back-end with a custom template function: as a variant of `latex' back-end with a custom template function:
\(org-export-define-derived-backend my-latex latex \(org-export-define-derived-backend 'my-latex 'latex
:translate-alist ((template . my-latex-template-fun))) :translate-alist '((template . my-latex-template-fun)))
The back-end could then be called with, for example: The back-end could then be called with, for example:
\(org-export-to-buffer 'my-latex \"*Test my-latex*\")" \(org-export-to-buffer 'my-latex \"*Test my-latex*\")"
(declare (debug (&define name sexp [&rest [keywordp sexp]] def-body)) (declare (indent 2))
(indent 2))
(let (export-block filters menu-entry options translators contents) (let (export-block filters menu-entry options translators contents)
(while (keywordp (car body)) (while (keywordp (car body))
(case (pop body) (case (pop body)
@ -1067,21 +1062,18 @@ The back-end could then be called with, for example:
(let ((p-options (org-export-backend-options parent))) (let ((p-options (org-export-backend-options parent)))
(list :options-alist (append options p-options))) (list :options-alist (append options p-options)))
(and menu-entry (list :menu-entry menu-entry)))) (and menu-entry (list :menu-entry menu-entry))))
`(progn (org-export-barf-if-invalid-backend parent)
(org-export-barf-if-invalid-backend ',parent) ;; Register back-end.
;; Register back-end. (let ((registeredp (assq child org-export-registered-backends)))
(let ((registeredp (assq ',child org-export-registered-backends))) (if registeredp (setcdr registeredp contents)
(if registeredp (setcdr registeredp ',contents) (push (cons child contents) org-export-registered-backends)))
(push (cons ',child ',contents) org-export-registered-backends))) ;; Tell parser to not parse EXPORT-BLOCK blocks.
;; Tell parser to not parse EXPORT-BLOCK blocks. (when export-block
,(when export-block (mapc
`(mapc (lambda (name)
(lambda (name) (add-to-list org-element-block-name-alist
(add-to-list 'org-element-block-name-alist `(,name . org-element-export-block-parser)))
`(,name . org-element-export-block-parser))) export-block))))
',export-block))
;; Splice in the body, if any.
,@body)))
(defun org-export-backend-parent (backend) (defun org-export-backend-parent (backend)
"Return back-end from which BACKEND is derived, or nil." "Return back-end from which BACKEND is derived, or nil."