Gnus development mailing list
 help / color / mirror / Atom feed
* [PATCH] Allow nil as shr-width value => full emacs window width
@ 2010-12-30 10:22 Tassilo Horn
  2011-01-02  5:21 ` Lars Magne Ingebrigtsen
  0 siblings, 1 reply; 2+ messages in thread
From: Tassilo Horn @ 2010-12-30 10:22 UTC (permalink / raw)
  To: ding

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



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] Allow nil as shr-width value => full emacs window width
  2010-12-30 10:22 [PATCH] Allow nil as shr-width value => full emacs window width Tassilo Horn
@ 2011-01-02  5:21 ` Lars Magne Ingebrigtsen
  0 siblings, 0 replies; 2+ messages in thread
From: Lars Magne Ingebrigtsen @ 2011-01-02  5:21 UTC (permalink / raw)
  To: ding

Tassilo Horn <tassilo@member.fsf.org> writes:

> this patch adds nil as possible customize option for `shr-width'.  With
> that, rendering uses up the full emacs window width for rendering.

Ok; applied with some modifications for even more dynamism.

-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@gnus.org * Lars Magne Ingebrigtsen




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-01-02  5:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-12-30 10:22 [PATCH] Allow nil as shr-width value => full emacs window width Tassilo Horn
2011-01-02  5:21 ` Lars Magne Ingebrigtsen

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).