Function: org-export-custom-protocol-maybe

org-export-custom-protocol-maybe is a byte-compiled function defined in ox.el.gz.

Signature

(org-export-custom-protocol-maybe LINK DESC BACKEND &optional INFO)

Documentation

Try exporting LINK object with a dedicated function.

DESC is its description, as a string, or nil. BACKEND is the back-end used for export, as a symbol.

Return output as a string, or nil if no protocol handles LINK.

A custom protocol has precedence over regular back-end export. The function ignores links with an implicit type (e.g.,
"custom-id").

Source Code

;; Defined in /usr/src/emacs/lisp/org/ox.el.gz
(defun org-export-custom-protocol-maybe (link desc backend &optional info)
  "Try exporting LINK object with a dedicated function.

DESC is its description, as a string, or nil.  BACKEND is the
back-end used for export, as a symbol.

Return output as a string, or nil if no protocol handles LINK.

A custom protocol has precedence over regular back-end export.
The function ignores links with an implicit type (e.g.,
\"custom-id\")."
  (let ((type (org-element-property :type link)))
    (unless (or (member type '("coderef" "custom-id" "fuzzy" "radio" nil))
		(not backend))
      (let ((protocol (org-link-get-parameter type :export))
	    (path (org-element-property :path link)))
	(and (functionp protocol)
	     (condition-case nil
		 (funcall protocol path desc backend info)
	       ;; XXX: The function used (< Org 9.4) to accept only
	       ;; three mandatory arguments.  Type-specific `:export'
	       ;; functions in the wild may not handle current
	       ;; signature.  Provide backward compatibility support
	       ;; for them.
	       (wrong-number-of-arguments
		(funcall protocol path desc backend))))))))