aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Griffith <griffitaj@gmail.com>2018-03-05 16:24:20 -0500
committerGitHub <noreply@github.com>2018-03-05 16:24:20 -0500
commitd2388f1584a593e40aa826a0386021f812695175 (patch)
tree0240110c658f0f06ab69c225e099cc03ccefb2f8
parenta5d0c22e0cab6771d3fc3e7e7244de32d497c994 (diff)
parent1e6b9b0b84c52a7d7cc94173079251dad0c2abbd (diff)
Merge pull request #169 from hdurer/maybe-use-shr-fonts
Add new customization flag to switch between fixed width / proportional fonts.
-rw-r--r--lisp/mastodon-tl.el9
1 files changed, 8 insertions, 1 deletions
diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el
index 58b50ab..c78211d 100644
--- a/lisp/mastodon-tl.el
+++ b/lisp/mastodon-tl.el
@@ -55,6 +55,11 @@ keep the timestamps current as time progresses."
:group 'mastodon-tl
:type '(boolean :tag "Enable relative timestamps and background updater task"))
+(defcustom mastodon-tl--enable-proportional-fonts nil
+ "Nonnil to enable using proportional (rather than the default fixed width) fonts when rendering HTML."
+ :group 'mastodon-tl
+ :type '(boolean :tag "Enable using proportional rather than fixed width fonts when rendering HTML text"))
+
(defvar mastodon-tl--buffer-spec nil
"A unique identifier and functions for each Mastodon buffer.")
(make-variable-buffer-local 'mastodon-tl--buffer-spec)
@@ -311,7 +316,9 @@ TIME-STAMP is assumed to be in the past."
"Returns a propertized text giving the rendering of the given HTML string."
(with-temp-buffer
(insert string)
- (let ((shr-use-fonts nil))
+ (let ((shr-use-fonts mastodon-tl--enable-proportional-fonts)
+ (shr-width (when mastodon-tl--enable-proportional-fonts
+ (window-width))))
(shr-render-region (point-min) (point-max)))
;; Make all links a tab stop recognized by our own logic and
;; update keymaps where needed.