forked from mirrors/org-mode
* 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:
parent
681f3fc8f9
commit
ac108a3ac1
|
@ -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 _)
|
||||||
|
|
Loading…
Reference in New Issue