Rename `org-export--registered-backends'

* lisp/ox.el (org-export-registered-backends): Renamed from
  `org-export--registered-backends'.
(org-export-get-backend):
(org-export-register-backend):
(org-export-insert-default-template):
(org-export--dispatch-ui):

* lisp/org.el (org-export-registered-backends):
(org-export-backends):
(org-get-export-keywords):

* lisp/org-pcomplete.el (pcomplete/org-mode/file-option/options):

* testing/lisp/test-ox.el (test-org-export/define-backend):
(test-org-export/define-derived-backend):
(test-org-export/derived-backend-p):
(test-org-export/get-all-transcoders):
(test-org-export/get-all-options):
(test-org-export/get-all-filters):
(test-org-export/with-backend): Apply renaming.

Since the variable is copiously used outside of "ox.el", there's no
reason to mark it as internal.
This commit is contained in:
Nicolas Goaziou 2015-04-22 10:24:02 +02:00
parent 9290395405
commit e040ad58a1
4 changed files with 44 additions and 44 deletions

View File

@ -272,7 +272,7 @@ When completing for #+STARTUP, for example, this function returns
;; OPTION items from registered back-ends.
(let (items)
(dolist (backend (org-bound-and-true-p
org-export--registered-backends))
org-export-registered-backends))
(dolist (option (org-export-backend-options backend))
(let ((item (nth 2 option)))
(when item (push (concat item ":") items)))))

View File

@ -752,7 +752,7 @@ For export specific modules, see also `org-export-backends'."
(const :tag "C wl: Links to Wanderlust folders/messages" org-wl)
(repeat :tag "External packages" :inline t (symbol :tag "Package"))))
(defvar org-export--registered-backends) ; From ox.el.
(defvar org-export-registered-backends) ; From ox.el.
(declare-function org-export-derived-backend-p "ox" (backend &rest backends))
(declare-function org-export-backend-name "ox" (backend))
(defcustom org-export-backends '(ascii html icalendar latex)
@ -772,7 +772,7 @@ interface or run the following code, where VAL stands for the new
value of the variable, after updating it:
\(progn
\(setq org-export--registered-backends
\(setq org-export-registered-backends
\(org-remove-if-not
\(lambda (backend)
\(let ((name (org-export-backend-name backend)))
@ -781,9 +781,9 @@ value of the variable, after updating it:
\(dolist (b val)
\(and (org-export-derived-backend-p b name)
\(throw 'parentp t)))))))
org-export--registered-backends))
\(let ((new-list (mapcar 'org-export-backend-name
org-export--registered-backends)))
org-export-registered-backends))
\(let ((new-list (mapcar #'org-export-backend-name
org-export-registered-backends)))
\(dolist (backend val)
\(cond
\((not (load (format \"ox-%s\" backend) t t))
@ -804,7 +804,7 @@ depends on, if any."
;; Any back-end not required anymore (not present in VAL and not
;; a parent of any back-end in the new value) is removed from the
;; list of registered back-ends.
(setq org-export--registered-backends
(setq org-export-registered-backends
(org-remove-if-not
(lambda (backend)
(let ((name (org-export-backend-name backend)))
@ -813,11 +813,11 @@ depends on, if any."
(dolist (b val)
(and (org-export-derived-backend-p b name)
(throw 'parentp t)))))))
org-export--registered-backends))
org-export-registered-backends))
;; Now build NEW-LIST of both new back-ends and required
;; parents.
(let ((new-list (mapcar 'org-export-backend-name
org-export--registered-backends)))
(let ((new-list (mapcar #'org-export-backend-name
org-export-registered-backends)))
(dolist (backend val)
(cond
((not (load (format "ox-%s" backend) t t))
@ -12297,7 +12297,7 @@ Export keywords include options, block names, attributes and
keywords relative to each registered export back-end."
(let (keywords)
(dolist (backend
(org-bound-and-true-p org-export--registered-backends)
(org-bound-and-true-p org-export-registered-backends)
(delq nil keywords))
;; Back-end name (for keywords, like #+LATEX:)
(push (upcase (symbol-name (org-export-backend-name backend))) keywords)

View File

@ -285,7 +285,7 @@ containing the back-end used, as a symbol, and either a process
or the time at which it finished. It is used to build the menu
from `org-export-stack'.")
(defvar org-export--registered-backends nil
(defvar org-export-registered-backends nil
"List of backends currently available in the exporter.
This variable is set with `org-export-define-backend' and
`org-export-define-derived-backend' functions.")
@ -929,7 +929,7 @@ mode."
"Return export back-end named after NAME.
NAME is a symbol. Return nil if no such back-end is found."
(catch 'found
(dolist (b org-export--registered-backends)
(dolist (b org-export-registered-backends)
(when (eq (org-export-backend-name b) name)
(throw 'found b)))))
@ -951,8 +951,8 @@ BACKEND is a structure with `org-export-backend' type."
;; registered, replace it with BACKEND. Otherwise, simply add
;; BACKEND to the list of registered back-ends.
(let ((old (org-export-get-backend (org-export-backend-name backend))))
(if old (setcar (memq old org-export--registered-backends) backend)
(push backend org-export--registered-backends))))
(if old (setcar (memq old org-export-registered-backends) backend)
(push backend org-export-registered-backends))))
(defun org-export-barf-if-invalid-backend (backend)
"Signal an error if BACKEND isn't defined."
@ -3014,9 +3014,9 @@ locally for the subtree through node properties."
(org-completing-read
"Options category: "
(cons "default"
(mapcar #'(lambda (b)
(symbol-name (org-export-backend-name b)))
org-export--registered-backends))
(mapcar (lambda (b)
(symbol-name (org-export-backend-name b)))
org-export-registered-backends))
nil t))))
options keywords)
;; Populate OPTIONS and KEYWORDS.
@ -6132,8 +6132,8 @@ back to standard interface."
;; if any.
(entries
(sort (sort (delq nil
(mapcar 'org-export-backend-menu
org-export--registered-backends))
(mapcar #'org-export-backend-menu
org-export-registered-backends))
(lambda (a b)
(let ((key-a (nth 1 a))
(key-b (nth 1 b)))

View File

@ -1289,13 +1289,13 @@ Footnotes[fn:2], foot[fn:test], digit only[3], and [fn:inline:anonymous footnote
;; Translate table.
(should
(equal '((headline . my-headline-test))
(let (org-export--registered-backends)
(let (org-export-registered-backends)
(org-export-define-backend 'test '((headline . my-headline-test)))
(org-export-get-all-transcoders 'test))))
;; Filters.
(should
(equal '((:filter-headline . my-filter))
(let (org-export--registered-backends)
(let (org-export-registered-backends)
(org-export-define-backend 'test
'((headline . my-headline-test))
:filters-alist '((:filter-headline . my-filter)))
@ -1303,7 +1303,7 @@ Footnotes[fn:2], foot[fn:test], digit only[3], and [fn:inline:anonymous footnote
;; Options.
(should
(equal '((:prop value))
(let (org-export--registered-backends)
(let (org-export-registered-backends)
(org-export-define-backend 'test
'((headline . my-headline-test))
:options-alist '((:prop value)))
@ -1311,7 +1311,7 @@ Footnotes[fn:2], foot[fn:test], digit only[3], and [fn:inline:anonymous footnote
;; Menu.
(should
(equal '(?k "Test Export" test)
(let (org-export--registered-backends)
(let (org-export-registered-backends)
(org-export-define-backend 'test
'((headline . my-headline-test))
:menu-entry '(?k "Test Export" test))
@ -1319,7 +1319,7 @@ Footnotes[fn:2], foot[fn:test], digit only[3], and [fn:inline:anonymous footnote
;; Export Blocks.
(should
(equal '(("TEST" . org-element-export-block-parser))
(let (org-export--registered-backends org-element-block-name-alist)
(let (org-export-registered-backends org-element-block-name-alist)
(org-export-define-backend 'test
'((headline . my-headline-test))
:export-block '("test"))
@ -1329,12 +1329,12 @@ Footnotes[fn:2], foot[fn:test], digit only[3], and [fn:inline:anonymous footnote
"Test `org-export-define-derived-backend' specifications."
;; Error when parent back-end is not defined.
(should-error
(let (org-export--registered-backends)
(let (org-export-registered-backends)
(org-export-define-derived-backend 'test 'parent)))
;; Append translation table to parent's.
(should
(equal '((:headline . test) (:headline . parent))
(let (org-export--registered-backends)
(let (org-export-registered-backends)
(org-export-define-backend 'parent '((:headline . parent)))
(org-export-define-derived-backend 'test 'parent
:translate-alist '((:headline . test)))
@ -1343,7 +1343,7 @@ Footnotes[fn:2], foot[fn:test], digit only[3], and [fn:inline:anonymous footnote
;; in parent.
(should
(eq 'test
(let (org-export--registered-backends)
(let (org-export-registered-backends)
(org-export-define-backend 'parent
'((:headline . parent))
:options-alist '((:a nil nil 'parent)))
@ -1357,35 +1357,35 @@ Footnotes[fn:2], foot[fn:test], digit only[3], and [fn:inline:anonymous footnote
"Test `org-export-derived-backend-p' specifications."
;; Non-nil with direct match.
(should
(let (org-export--registered-backends)
(let (org-export-registered-backends)
(org-export-define-backend 'test '((headline . test)))
(org-export-derived-backend-p 'test 'test)))
(should
(let (org-export--registered-backends)
(let (org-export-registered-backends)
(org-export-define-backend 'test '((headline . test)))
(org-export-define-derived-backend 'test2 'test)
(org-export-derived-backend-p 'test2 'test2)))
;; Non-nil with a direct parent.
(should
(let (org-export--registered-backends)
(let (org-export-registered-backends)
(org-export-define-backend 'test '((headline . test)))
(org-export-define-derived-backend 'test2 'test)
(org-export-derived-backend-p 'test2 'test)))
;; Non-nil with an indirect parent.
(should
(let (org-export--registered-backends)
(let (org-export-registered-backends)
(org-export-define-backend 'test '((headline . test)))
(org-export-define-derived-backend 'test2 'test)
(org-export-define-derived-backend 'test3 'test2)
(org-export-derived-backend-p 'test3 'test)))
;; Nil otherwise.
(should-not
(let (org-export--registered-backends)
(let (org-export-registered-backends)
(org-export-define-backend 'test '((headline . test)))
(org-export-define-backend 'test2 '((headline . test2)))
(org-export-derived-backend-p 'test2 'test)))
(should-not
(let (org-export--registered-backends)
(let (org-export-registered-backends)
(org-export-define-backend 'test '((headline . test)))
(org-export-define-backend 'test2 '((headline . test2)))
(org-export-define-derived-backend 'test3 'test2)
@ -1404,14 +1404,14 @@ Footnotes[fn:2], foot[fn:test], digit only[3], and [fn:inline:anonymous footnote
;; But inherit from all ancestors whenever possible.
(should
(equal '((section . ignore) (headline . ignore))
(let (org-export--registered-backends)
(let (org-export-registered-backends)
(org-export-define-backend 'b1 '((headline . ignore)))
(org-export-get-all-transcoders
(org-export-create-backend
:parent 'b1 :transcoders '((section . ignore)))))))
(should
(equal '((paragraph . ignore) (section . ignore) (headline . ignore))
(let (org-export--registered-backends)
(let (org-export-registered-backends)
(org-export-define-backend 'b1 '((headline . ignore)))
(org-export-define-derived-backend 'b2 'b1
:translate-alist '((section . ignore)))
@ -1421,7 +1421,7 @@ Footnotes[fn:2], foot[fn:test], digit only[3], and [fn:inline:anonymous footnote
;; Back-end transcoders overrule inherited ones.
(should
(eq 'b
(let (org-export--registered-backends)
(let (org-export-registered-backends)
(org-export-define-backend 'b1 '((headline . a)))
(cdr (assq 'headline
(org-export-get-all-transcoders
@ -1441,14 +1441,14 @@ Footnotes[fn:2], foot[fn:test], digit only[3], and [fn:inline:anonymous footnote
;; But inherit from all ancestors whenever possible.
(should
(equal '((:key2 value2) (:key1 value1))
(let (org-export--registered-backends)
(let (org-export-registered-backends)
(org-export-define-backend 'b1 nil :options-alist '((:key1 value1)))
(org-export-get-all-options
(org-export-create-backend
:parent 'b1 :options '((:key2 value2)))))))
(should
(equal '((:key3 value3) (:key2 value2) (:key1 value1))
(let (org-export--registered-backends)
(let (org-export-registered-backends)
(org-export-define-backend 'b1 nil :options-alist '((:key1 value1)))
(org-export-define-derived-backend 'b2 'b1
:options-alist '((:key2 value2)))
@ -1458,7 +1458,7 @@ Footnotes[fn:2], foot[fn:test], digit only[3], and [fn:inline:anonymous footnote
;; Back-end options overrule inherited ones.
(should
(eq 'b
(let (org-export--registered-backends)
(let (org-export-registered-backends)
(org-export-define-backend 'b1 nil :options-alist '((:key1 . a)))
(cdr (assq :key1
(org-export-get-all-options
@ -1478,7 +1478,7 @@ Footnotes[fn:2], foot[fn:test], digit only[3], and [fn:inline:anonymous footnote
;; But inherit from all ancestors whenever possible.
(should
(equal '((:filter-section . ignore) (:filter-headline . ignore))
(let (org-export--registered-backends)
(let (org-export-registered-backends)
(org-export-define-backend 'b1
nil :filters-alist '((:filter-headline . ignore)))
(org-export-get-all-filters
@ -1488,7 +1488,7 @@ Footnotes[fn:2], foot[fn:test], digit only[3], and [fn:inline:anonymous footnote
(equal '((:filter-paragraph . ignore)
(:filter-section . ignore)
(:filter-headline . ignore))
(let (org-export--registered-backends)
(let (org-export-registered-backends)
(org-export-define-backend 'b1
nil :filters-alist '((:filter-headline . ignore)))
(org-export-define-derived-backend 'b2 'b1
@ -1499,7 +1499,7 @@ Footnotes[fn:2], foot[fn:test], digit only[3], and [fn:inline:anonymous footnote
;; Back-end filters overrule inherited ones.
(should
(eq 'b
(let (org-export--registered-backends)
(let (org-export-registered-backends)
(org-export-define-backend 'b1 '((:filter-headline . a)))
(cdr (assq :filter-headline
(org-export-get-all-filters
@ -1519,7 +1519,7 @@ Footnotes[fn:2], foot[fn:test], digit only[3], and [fn:inline:anonymous footnote
;; Otherwise, export using correct transcoder
(should
(equal "Success"
(let (org-export--registered-backends)
(let (org-export-registered-backends)
(org-export-define-backend 'test
'((plain-text . (lambda (text contents info) "Failure"))))
(org-export-define-backend 'test2