From 5ed6b514351132c07d65054cdfc9b3da747a26d2 Mon Sep 17 00:00:00 2001 From: Anders Johansson Date: Tue, 11 Oct 2016 10:06:41 +0200 Subject: [PATCH] Conditionally use new org (v. 9) api for link type --- org-pdfview.el | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/org-pdfview.el b/org-pdfview.el index 16f3c70..66e17ef 100644 --- a/org-pdfview.el +++ b/org-pdfview.el @@ -36,8 +36,12 @@ (require 'pdf-tools) (require 'pdf-view) -(org-add-link-type "pdfview" 'org-pdfview-open 'org-pdfview-export) -(add-hook 'org-store-link-functions 'org-pdfview-store-link) +(if (fboundp 'org-link-set-parameters) + (org-link-set-parameters "pdfview" + :follow #'org-pdfview-open + :store #'org-pdfview-store-link) + (org-add-link-type "pdfview" 'org-pdfview-open) + (add-hook 'org-store-link-functions 'org-pdfview-store-link)) (defun org-pdfview-open (link) "Open LINK in pdf-view-mode."