aboutsummaryrefslogtreecommitdiff
path: root/nov.el
diff options
context:
space:
mode:
authorVasilij Schneidermann <mail@vasilij.de>2020-02-15 22:44:15 +0100
committerVasilij Schneidermann <mail@vasilij.de>2020-02-15 22:44:15 +0100
commit41e6a9cf142465633b7128a3b0e284ff6cb582d7 (patch)
treefbcc5c0919a40637b79cd80754b1cb337ffc2032 /nov.el
parent77a339fa40b32075bd3fc8ca6f1cf338a226e665 (diff)
Conform to org-link-store API
Diffstat (limited to 'nov.el')
-rw-r--r--nov.el15
1 files changed, 7 insertions, 8 deletions
diff --git a/nov.el b/nov.el
index f08c481..09916c7 100644
--- a/nov.el
+++ b/nov.el
@@ -816,14 +816,13 @@ Saving is only done if `nov-save-place-file' is set."
(error "Invalid nov.el link")))
(defun nov-org-link-store ()
- (when (not (and (eq major-mode 'nov-mode) nov-file-name))
- (error "Not in a nov.el buffer"))
- (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)))
+ (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))))
(org-link-set-parameters
"nov"