diff --git a/README.in.rst b/README.in.rst index 89f7eac..748c2e2 100644 --- a/README.in.rst +++ b/README.in.rst @@ -30,7 +30,6 @@ Then :: M-x package-refresh-contents RET - M-x package-initialize RET M-x package-install RET nnhackernews RET Alternatively, copy ``nnhackernews.el`` to a directory among ``C-h v RET load-path`` and add ``(require 'nnhackernews)`` to ``.emacs``. diff --git a/README.rst b/README.rst index ccc9a5f..4ded675 100644 --- a/README.rst +++ b/README.rst @@ -30,7 +30,6 @@ Then :: M-x package-refresh-contents RET - M-x package-initialize RET M-x package-install RET nnhackernews RET Alternatively, copy ``nnhackernews.el`` to a directory among ``C-h v RET load-path`` and add ``(require 'nnhackernews)`` to ``.emacs``. diff --git a/nnhackernews.el b/nnhackernews.el index c1f84b3..2ebb213 100644 --- a/nnhackernews.el +++ b/nnhackernews.el @@ -81,6 +81,11 @@ Do not set this to \"localhost\" as a numeric IP is required for the oauth hands :type 'integer :group 'nnhackernews) +(defcustom nnhackernews-max-render-bytes 300e3 + "`quoted-printable-encode-region' bogs when the javascript spyware gets out of hand." + :type 'integer + :group 'nnhackernews) + (defvoo nnhackernews-status-string "") (defvar nnhackernews--mutex-display-article (when (fboundp 'make-mutex) @@ -1172,13 +1177,16 @@ Optionally provide STATIC-MAX-ITEM and STATIC-NEWSTORIES to prevent querying out "nnhackernews-request-article" it :success (cl-function (lambda (&key data &allow-other-keys) - (insert data)))) + (if (> (length data) nnhackernews-max-render-bytes) + (insert body) + (insert data))))) (error (gnus-message 5 "nnhackernews-request-article: %s" (error-message-string err)) (insert body))) (insert body)) (insert "\n") (if (mml-validate) + (message-encode-message-body) (gnus-message 2 "nnhackernews-request-article: Invalid mml:\n%s" (buffer-string)))