aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVasilij Schneidermann <mail@vasilij.de>2017-09-09 22:01:51 +0200
committerVasilij Schneidermann <mail@vasilij.de>2017-09-09 22:01:51 +0200
commite0df960b4361c5c8298569337bbeef4e5c90749a (patch)
tree95627a8474653ce002981ffef02bd70276042412
parent21505a9581bc54bbe5bd1e3612fec251281adee0 (diff)
Allow using a different text width
-rw-r--r--nov.el12
1 files changed, 11 insertions, 1 deletions
diff --git a/nov.el b/nov.el
index 46d980b..04f3aa5 100644
--- a/nov.el
+++ b/nov.el
@@ -65,6 +65,15 @@ Otherwise the default face is used."
:type 'boolean
:group 'nov)
+(defcustom nov-text-width nil
+ "Width filled text shall occupy.
+An integer is interpreted as the number of columns. If nil, use
+the full window's width. Note that this variable only has an
+effect in Emacs 25.1 or greater."
+ :type '(choice (integer :tag "Fixed width in characters")
+ (const :tag "Use the width of the window" nil))
+ :group 'nov)
+
(defvar-local nov-temp-dir nil
"Temporary directory containing the buffer's EPUB files.")
@@ -427,7 +436,8 @@ the HTML is rendered with `shr-render-region'."
(let (;; HACK: make buttons use our own commands
(shr-map nov-mode-map)
(shr-external-rendering-functions nov-rendering-functions)
- (shr-use-fonts nov-variable-pitch))
+ (shr-use-fonts nov-variable-pitch)
+ (shr-width nov-text-width))
;; HACK: `shr-external-rendering-functions' doesn't cover
;; every usage of `shr-tag-img'
(cl-letf (((symbol-function 'shr-tag-img) 'nov-render-img))