From: Tassilo Horn <tassilo@member.fsf.org>
To: ding@gnus.org
Subject: [PATCH] Allow nil as shr-width value => full emacs window width
Date: Thu, 30 Dec 2010 11:22:49 +0100 [thread overview]
Message-ID: <87wrmrmufa.fsf@member.fsf.org> (raw)
Hi all,
this patch adds nil as possible customize option for `shr-width'. With
that, rendering uses up the full emacs window width for rendering.
Bye,
Tassilo
---
lisp/ChangeLog | 5 +++++
lisp/shr.el | 10 ++++++++--
2 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 417f737..6288501 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
+2010-12-30 Tassilo Horn <tassilo@member.fsf.org>
+
+ * shr.el (shr-width, shr-insert-document): Allow nil as shr-width value
+ with the meaning of using the full emacs window width for rendering.
+
2010-12-27 Daiki Ueno <ueno@unixuser.org>
* mml2015.el (mml2015-epg-sign, mml2015-epg-encrypt): Take care the
diff --git a/lisp/shr.el b/lisp/shr.el
index 1e95dde..c403c6d 100644
--- a/lisp/shr.el
+++ b/lisp/shr.el
@@ -74,8 +74,12 @@ fit these criteria."
:type 'character)
(defcustom shr-width fill-column
- "Frame width to use for rendering."
- :type 'integer
+ "Frame width to use for 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."
+ :type '(choice (integer :tag "Fixed width in characters")
+ (const :tag "Use the width of the window" nil))
:group 'shr)
(defvar shr-content-function nil
@@ -111,6 +115,8 @@ cid: URL as the argument.")
;;;###autoload
(defun shr-insert-document (dom)
+ (unless (integerp shr-width)
+ (set (make-local-variable 'shr-width) (window-width)))
(setq shr-content-cache nil)
(let ((shr-state nil)
(shr-start nil))
--
1.7.3.4
Sent from my Emacs
next reply other threads:[~2010-12-30 10:22 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-30 10:22 Tassilo Horn [this message]
2011-01-02 5:21 ` Lars Magne Ingebrigtsen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87wrmrmufa.fsf@member.fsf.org \
--to=tassilo@member.fsf.org \
--cc=ding@gnus.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).