summaryrefslogtreecommitdiff
path: root/lisp/org-docview.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/org-docview.el')
-rw-r--r--lisp/org-docview.el13
1 files changed, 7 insertions, 6 deletions
diff --git a/lisp/org-docview.el b/lisp/org-docview.el
index d2a9525..0f0bdaf 100644
--- a/lisp/org-docview.el
+++ b/lisp/org-docview.el
@@ -1,4 +1,4 @@
-;;; org-docview.el --- support for links to doc-view-mode buffers
+;;; org-docview.el --- Support for links to doc-view-mode buffers -*- lexical-binding: t; -*-
;; Copyright (C) 2009-2016 Free Software Foundation, Inc.
@@ -25,7 +25,7 @@
;;; Commentary:
;; This file implements links to open files in doc-view-mode.
-;; Org-mode loads this module by default - if this is not what you want,
+;; Org mode loads this module by default - if this is not what you want,
;; configure the variable `org-modules'.
;; The links take the form
@@ -49,8 +49,10 @@
(declare-function doc-view-goto-page "doc-view" (page))
(declare-function image-mode-window-get "image-mode" (prop &optional winprops))
-(org-add-link-type "docview" 'org-docview-open 'org-docview-export)
-(add-hook 'org-store-link-functions 'org-docview-store-link)
+(org-link-set-parameters "docview"
+ :follow #'org-docview-open
+ :export #'org-docview-export
+ :store #'org-docview-store-link)
(defun org-docview-export (link description format)
"Export a docview link from Org files."
@@ -81,8 +83,7 @@
;; This buffer is in doc-view-mode
(let* ((path buffer-file-name)
(page (image-mode-window-get 'page))
- (link (concat "docview:" path "::" (number-to-string page)))
- (description ""))
+ (link (concat "docview:" path "::" (number-to-string page))))
(org-store-link-props
:type "docview"
:link link