diff options
Diffstat (limited to 'nov.el')
-rw-r--r-- | nov.el | 16 |
1 files changed, 10 insertions, 6 deletions
@@ -71,10 +71,11 @@ Otherwise the default face is used." (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." +the full window's width. If t, disable filling completely. 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)) + (const :tag "Use the width of the window" nil) + (const :tag "Disable filling" t)) :group 'nov) (defcustom nov-render-html-function 'nov-render-html @@ -489,12 +490,15 @@ chapter title." (let (;; HACK: make buttons use our own commands (shr-map nov-mode-map) (shr-external-rendering-functions nov-shr-rendering-functions) - (shr-use-fonts nov-variable-pitch) - (shr-width nov-text-width)) + (shr-use-fonts nov-variable-pitch)) ;; HACK: `shr-external-rendering-functions' doesn't cover ;; every usage of `shr-tag-img' (cl-letf (((symbol-function 'shr-tag-img) 'nov-render-img)) - (shr-render-region (point-min) (point-max)))) + (if (eq nov-text-width t) + (cl-letf (((symbol-function 'shr-fill-line) 'ignore)) + (shr-render-region (point-min) (point-max))) + (let ((shr-width nov-text-width)) + (shr-render-region (point-min) (point-max)))))) (run-hooks 'nov-post-html-render-hook)) (defun nov-render-document () |