From mboxrd@z Thu Jan 1 00:00:00 1970 From: nicolas.pouillard@gmail.com (Nicolas Pouillard) Date: Tue, 04 Nov 2008 14:29:40 +0100 Subject: [sup-talk] [PATCH] Wrap text attachments In-Reply-To: <1225757268-sup-9251@elly> References: <1225757268-sup-9251@elly> Message-ID: <1225805250-sup-3958@ausone.local> Excerpts from Israel Herraiz's message of Tue Nov 04 01:08:41 +0100 2008: > Hi, Hi, > this patch wrap text attachaments, as well as messages. For me is > quite annoying to have to scroll to see the text attachments. Perhaps > it is useful for others too. I have no opinion about this change. However there is already a WRAP_LEN constant in this file, please provide a patch that reuse the same constant. Best regards, > --- > lib/sup/message-chunks.rb | 3 +++ > 1 files changed, 3 insertions(+), 0 deletions(-) > > diff --git a/lib/sup/message-chunks.rb b/lib/sup/message-chunks.rb > index cc895f3..99bd12b 100644 > --- a/lib/sup/message-chunks.rb > +++ b/lib/sup/message-chunks.rb > @@ -65,6 +65,8 @@ Return value: > EOS > #' stupid ruby-mode > > + WRAP_LEN = 80 # wrap text attachments at this width > + > ## raw_content is the post-MIME-decode content. this is used for > ## saving the attachment to disk. > attr_reader :content_type, :filename, :lines, :raw_content > @@ -95,6 +97,7 @@ EOS > @lines = nil > if text > @lines = text.gsub("\r\n", "\n").gsub(/\t/, " ").gsub(/\r/, "").split("\n") > + @lines = lines.map {|l| l.chomp.wrap WRAP_LEN}.flatten > @quotable = true > end > end -- Nicolas Pouillard aka Ertai