* lisp/ol-docview.el (org-docview-export): Update docstring and arglist

Document all the arguments. Add fourth argument as require by the
latest :export link property spec.  Rename FORMAT to BACKEND for more
clarity.
This commit is contained in:
Ihor Radchenko 2023-10-09 16:33:28 +03:00
parent 681f3fc8f9
commit ac108a3ac1
No known key found for this signature in database
GPG Key ID: 6470762A7DA11D8B
1 changed files with 5 additions and 5 deletions

View File

@ -57,17 +57,17 @@
:export #'org-docview-export :export #'org-docview-export
:store #'org-docview-store-link) :store #'org-docview-store-link)
(defun org-docview-export (link description format) (defun org-docview-export (link description backend _info)
"Export a docview link from Org files." "Export a docview LINK with DESCRIPTION for BACKEND."
(let ((path (if (string-match "\\(.+\\)::.+" link) (match-string 1 link) (let ((path (if (string-match "\\(.+\\)::.+" link) (match-string 1 link)
link)) link))
(desc (or description link))) (desc (or description link)))
(when (stringp path) (when (stringp path)
(setq path (expand-file-name path)) (setq path (expand-file-name path))
(cond (cond
((eq format 'html) (format "<a href=\"%s\">%s</a>" path desc)) ((eq backend 'html) (format "<a href=\"%s\">%s</a>" path desc))
((eq format 'latex) (format "\\href{%s}{%s}" path desc)) ((eq backend 'latex) (format "\\href{%s}{%s}" path desc))
((eq format 'ascii) (format "%s (%s)" desc path)) ((eq backend 'ascii) (format "%s (%s)" desc path))
(t path))))) (t path)))))
(defun org-docview-open (link _) (defun org-docview-open (link _)