From f3b7cee8fcb4cbcfe0d62228c7061a555d11277a Mon Sep 17 00:00:00 2001 From: Vasilij Schneidermann Date: Sat, 28 Nov 2020 10:22:50 +0100 Subject: Fix Org warnings --- nov.el | 38 ++++++++++++++++++++++++-------------- 1 file changed, 24 insertions(+), 14 deletions(-) diff --git a/nov.el b/nov.el index b89489f..a5eefd0 100644 --- a/nov.el +++ b/nov.el @@ -856,20 +856,30 @@ See also `nov-bookmark-make-record'." (when (and (eq major-mode 'nov-mode) nov-file-name) (when (not (integerp nov-documents-index)) (setq nov-documents-index 0)) - (org-store-link-props - :type "nov" - :link (format "nov:%s::%d:%d" nov-file-name nov-documents-index (point)) - :description (format "EPUB file at %s" nov-file-name)))) - -(cond - ((version< org-version "9.0") - (org-add-link-type "nov" 'nov-org-link-follow) - (add-hook 'org-store-link-functions 'nov-org-link-store)) - (t - (org-link-set-parameters - "nov" - :follow 'nov-org-link-follow - :store 'nov-org-link-store))) + (let ((org-store-props-function + (if (version< org-version "9.3") + 'org-store-link-props + 'org-link-store-props)) + (link (format "nov:%s::%d:%d" + nov-file-name + nov-documents-index + (point))) + (description (format "EPUB file at %s" nov-file-name))) + (funcall org-store-props-function + :type "nov" + :link link + :description description)))) + +(with-suppressed-warnings ((obsolete org-add-link-type)) + (cond + ((version< org-version "9.0") + (org-add-link-type "nov" 'nov-org-link-follow) + (add-hook 'org-store-link-functions 'nov-org-link-store)) + (t + (org-link-set-parameters + "nov" + :follow 'nov-org-link-follow + :store 'nov-org-link-store)))) ;;; Imenu interop -- cgit v1.2.3