From 58c7dc69db07130519ff2e1f818eb5422f6225d8 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 18 Jul 2020 17:40:44 +0300 Subject: [PATCH] Fix documentation of a recent change in shr.el * lisp/net/shr.el (shr-max-width, shr-width): Fix typo and wording of the doc strings. * etc/NEWS: Fix the wording of the 'shr-max-width's entry, and move it to the SHR section. --- etc/NEWS | 18 ++++++++++-------- lisp/net/shr.el | 25 ++++++++++++------------- 2 files changed, 22 insertions(+), 21 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index b8cb22c7f74..7e6be008614 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -476,15 +476,17 @@ This is still the case by default, but if you customize 'browse-url-mailto-function' or 'browse-url-handlers' to call some other function, it will now be called instead of the default. -** EWW - +++ -*** New variable 'shr-max-width' -This defaults to 120 characters, which means that even if you have -very wide frames, HTML text will be rendered more narrowly, which -usually leads to a more readable text. If nil, 'shr-width' is adhered -to as before, and as that defaults to nil, the window width is always -used. +*** New variable 'shr-max-width'. +If this variable is non-nil, and 'shr-width' is nil, then SHR will use +the value of 'shr-max-width' to limit the width of the rendered HTML. +The default is 120 characters, so even if you have very wide frames, +HTML text will be rendered more narrowly, which usually leads to a +more readable text. Set this variable to nil to get the previous +behavior of rendering as wide as the window-width allows. If +'shr-width' is non-nil, it overrides this variable. + +** EWW --- *** The command 'eww-follow-link' now supports custom mailto handlers. diff --git a/lisp/net/shr.el b/lisp/net/shr.el index d6bdb4c17e0..ddd81127213 100644 --- a/lisp/net/shr.el +++ b/lisp/net/shr.el @@ -95,11 +95,11 @@ If nil, don't draw horizontal table lines." :type 'character) (defcustom shr-width nil - "Frame width to use for rendering. + "Window width to use for HTML rendering. May either be an integer specifying a fixed width in characters, -or nil, meaning that the full width of the window should be used. -If `shr-use-fonts' is set, the mean character width is used to -compute the pixel width, which is used instead. +or nil, meaning use the full width of the window. +If `shr-use-fonts' is set, the value is interpreted as a multiple +of the mean character width of the default face's font. Also see `shr-max-width'." :version "25.1" @@ -107,19 +107,18 @@ Also see `shr-max-width'." (const :tag "Use the width of the window" nil))) (defcustom shr-max-width 120 - "Maximum text width to use for rendering. -May either be an intereger specifying a fixed width in characters, -or nil, meaning that there is no maximum width. + "Maximum text width to use for HTML rendering. +May either be an integer specifying a fixed width in characters, +or nil, meaning that there is no width limit. -If `shr-use-fonts' is set, the mean character width is used to -compute the pixel width, which is used instead. +If `shr-use-fonts' is set, the value of this variable is +interpreted as a multiple of the mean character width of the +default face's font. -Also see `shr-width'. If `shr-width' is set, it overrides -`shr-max-width', and if `shr-width' is nil, the frame width is -used to compute the width to use." +If `shr-width' is non-nil, it overrides this variable." :version "28.1" :type '(choice (integer :tag "Fixed width in characters") - (const :tag "No maximum width" nil))) + (const :tag "No width limit" nil))) (defcustom shr-bullet "* " "Bullet used for unordered lists. -- 2.39.2