summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2019-07-14 16:02:23 +0100
committerSean Whitton <spwhitton@spwhitton.name>2019-07-14 16:02:23 +0100
commitbac2b80790681f429cce62f28d18672336dbf692 (patch)
tree1691f20dd9488efe6029b297d27c8c3cffbfe46f
parent089ddf3cd029712b09557acd014077d534858c92 (diff)
parentb57fae0814502496796ce5b8170d779b64df42a9 (diff)
Merge tag '0.2.8'
-rw-r--r--nov.el16
1 files changed, 13 insertions, 3 deletions
diff --git a/nov.el b/nov.el
index 432acda..2a8b3a6 100644
--- a/nov.el
+++ b/nov.el
@@ -1,10 +1,10 @@
;;; nov.el --- Featureful EPUB reader mode
-;; Copyright (C) 2017-2018 Vasilij Schneidermann <mail@vasilij.de>
+;; Copyright (C) 2017-2019 Vasilij Schneidermann <mail@vasilij.de>
;; Author: Vasilij Schneidermann <mail@vasilij.de>
;; URL: https://github.com/wasamasa/nov.el
-;; Version: 0.2.7
+;; Version: 0.2.8
;; Package-Requires: ((dash "2.12.0") (esxml "0.3.3") (emacs "24.4"))
;; Keywords: hypermedia, multimedia, epub
@@ -80,7 +80,9 @@ effect in Emacs 25.1 or greater."
(defcustom nov-render-html-function 'nov-render-html
"Function used to render HTML.
It's called without arguments with a buffer containing HTML and
-should change it to contain the rendered version of it.")
+should change it to contain the rendered version of it."
+ :type 'function
+ :group 'nov)
(defcustom nov-pre-html-render-hook nil
"Hook run before `nov-render-html'."
@@ -371,6 +373,7 @@ Each alist item consists of the identifier and full path."
(define-key map (kbd "g") 'nov-render-document)
(define-key map (kbd "v") 'nov-view-source)
(define-key map (kbd "V") 'nov-view-content-source)
+ (define-key map (kbd "a") 'nov-reopen-as-archive)
(define-key map (kbd "m") 'nov-display-metadata)
(define-key map (kbd "n") 'nov-next-document)
(define-key map (kbd "]") 'nov-next-document)
@@ -546,6 +549,12 @@ the HTML is rendered with `nov-render-html-function'."
(interactive)
(find-file nov-content-file))
+(defun nov-reopen-as-archive ()
+ "Reopen the EPUB document using `archive-mode'."
+ (interactive)
+ (with-current-buffer (find-file-literally nov-file-name)
+ (archive-mode)))
+
(defun nov-display-metadata ()
"View the metadata of the EPUB document in a new buffer."
(interactive)
@@ -718,6 +727,7 @@ Saving is only done if `nov-save-place-file' is set."
(recentf-add-file nov-file-name)))
(add-hook 'nov-mode-hook 'nov-add-to-recentf)
+(add-hook 'nov-mode-hook 'hack-dir-local-variables-non-file-buffer)
(provide 'nov)
;;; nov.el ends here