* [sup-talk] [PATCH] Use terminal width instead of hardcoded 80 as the wrap length.
@ 2009-05-23 18:19 Mark Alexander
2009-05-23 19:23 ` Ben Walton
[not found] ` <4c4248150905231318kab3819dw68e3a3a614241c0d@mail.gmail.com>
0 siblings, 2 replies; 9+ messages in thread
From: Mark Alexander @ 2009-05-23 18:19 UTC (permalink / raw)
---
lib/sup/message-chunks.rb | 5 ++---
1 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/lib/sup/message-chunks.rb b/lib/sup/message-chunks.rb
index 1bf7796..a463fd4 100644
--- a/lib/sup/message-chunks.rb
+++ b/lib/sup/message-chunks.rb
@@ -41,7 +41,6 @@ end
module Redwood
module Chunk
- WRAP_LEN = 80 # wrap messages and text attachments at this width
class Attachment
HookManager.register "mime-decode", <<EOS
@@ -109,7 +108,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
+ @lines = lines.map {|l| l.chomp.wrap Ncurses.cols}.flatten
@quotable = true
end
end
@@ -161,7 +160,7 @@ EOS
attr_reader :lines
def initialize lines
- @lines = lines.map { |l| l.chomp.wrap WRAP_LEN }.flatten # wrap
+ @lines = lines.map { |l| l.chomp.wrap Ncurses.cols }.flatten # wrap
## trim off all empty lines except one
@lines.pop while @lines.length > 1 && @lines[-1] =~ /^\s*$/ && @lines[-2] =~ /^\s*$/
--
1.5.6.3
^ permalink raw reply [flat|nested] 9+ messages in thread
* [sup-talk] [PATCH] Use terminal width instead of hardcoded 80 as the wrap length.
2009-05-23 18:19 [sup-talk] [PATCH] Use terminal width instead of hardcoded 80 as the wrap length Mark Alexander
@ 2009-05-23 19:23 ` Ben Walton
[not found] ` <4c4248150905231318kab3819dw68e3a3a614241c0d@mail.gmail.com>
1 sibling, 0 replies; 9+ messages in thread
From: Ben Walton @ 2009-05-23 19:23 UTC (permalink / raw)
Excerpts from Mark Alexander's message of Sat May 23 14:19:03 -0400 2009:
+1 to this also.
-Ben
--
Ben Walton
Systems Programmer - CHASS
University of Toronto
C:416.407.5610 | W:416.978.4302
GPG Key Id: 8E89F6D2; Key Server: pgp.mit.edu
Contact me to arrange for a CAcert assurance meeting.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://rubyforge.org/pipermail/sup-talk/attachments/20090523/1c908b26/attachment.bin>
^ permalink raw reply [flat|nested] 9+ messages in thread
* [sup-talk] [PATCH] Use terminal width instead of hardcoded 80 as the wrap length.
[not found] ` <4c4248150905231318kab3819dw68e3a3a614241c0d@mail.gmail.com>
@ 2009-05-24 0:00 ` Ben Walton
2009-05-27 15:58 ` William Morgan
0 siblings, 1 reply; 9+ messages in thread
From: Ben Walton @ 2009-05-24 0:00 UTC (permalink / raw)
Excerpts from Michael Stipicevic's message of Sat May 23 16:18:03 -0400 2009:
> I don't know, reading little e-mails on a widescreen monitor gets really
> annoying. Forcing 80 columns keeps it easier on the eyes. Could this be put
> into an option somehow?
But if you leave sup's "we dont' force wrapping" rules alone, this
makes reading mail scroll free if your terminal is wide enough and
doesn't change the behaviour if the terminal is narrower. (Not that
I'm against making it an option either.)
-Ben
--
Ben Walton
Systems Programmer - CHASS
University of Toronto
C:416.407.5610 | W:416.978.4302
GPG Key Id: 8E89F6D2; Key Server: pgp.mit.edu
Contact me to arrange for a CAcert assurance meeting.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://rubyforge.org/pipermail/sup-talk/attachments/20090523/6fdee8b1/attachment.bin>
^ permalink raw reply [flat|nested] 9+ messages in thread
* [sup-talk] [PATCH] Use terminal width instead of hardcoded 80 as the wrap length.
2009-05-24 0:00 ` Ben Walton
@ 2009-05-27 15:58 ` William Morgan
2009-05-27 16:05 ` Ben Walton
` (3 more replies)
0 siblings, 4 replies; 9+ messages in thread
From: William Morgan @ 2009-05-27 15:58 UTC (permalink / raw)
Reformatted excerpts from Ben Walton's message of 2009-05-23:
> But if you leave sup's "we dont' force wrapping" rules alone, this
> makes reading mail scroll free if your terminal is wide enough and
> doesn't change the behaviour if the terminal is narrower. (Not that
> I'm against making it an option either.)
Seems like there are three main modes of operation that would be
desirable:
1. wrap at 80 chars;
2. wrap at current terminal width;
3. don't wrap.
(In all cases, existing line breaks in the message are left alone.)
Would a three-way toggle irritate anyone?
--
William <wmorgan-sup at masanjin.net>
^ permalink raw reply [flat|nested] 9+ messages in thread
* [sup-talk] [PATCH] Use terminal width instead of hardcoded 80 as the wrap length.
2009-05-27 15:58 ` William Morgan
@ 2009-05-27 16:05 ` Ben Walton
2009-05-27 16:13 ` Mark Alexander
` (2 subsequent siblings)
3 siblings, 0 replies; 9+ messages in thread
From: Ben Walton @ 2009-05-27 16:05 UTC (permalink / raw)
Excerpts from William Morgan's message of Wed May 27 11:58:23 -0400 2009:
> Seems like there are three main modes of operation that would be
> desirable:
>
> 1. wrap at 80 chars;
> 2. wrap at current terminal width;
> 3. don't wrap.
>
> (In all cases, existing line breaks in the message are left alone.)
>
> Would a three-way toggle irritate anyone?
Yes, for the message itself, this would work just fine. I'm ok with
the toggle too.
For the header display though, the terminal width should be honoured,
I think.
Thanks
-Ben
--
Ben Walton
Systems Programmer - CHASS
University of Toronto
C:416.407.5610 | W:416.978.4302
GPG Key Id: 8E89F6D2; Key Server: pgp.mit.edu
Contact me to arrange for a CAcert assurance meeting.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://rubyforge.org/pipermail/sup-talk/attachments/20090527/4914d9ff/attachment.bin>
^ permalink raw reply [flat|nested] 9+ messages in thread
* [sup-talk] [PATCH] Use terminal width instead of hardcoded 80 as the wrap length.
2009-05-27 15:58 ` William Morgan
2009-05-27 16:05 ` Ben Walton
@ 2009-05-27 16:13 ` Mark Alexander
2009-05-27 17:43 ` Nicolas Pouillard
2009-06-06 0:35 ` Ingmar Vanhassel
[not found] ` <1244392518-sup-9746@cabinet>
3 siblings, 1 reply; 9+ messages in thread
From: Mark Alexander @ 2009-05-27 16:13 UTC (permalink / raw)
On Wed, May 27, 2009 at 8:58 AM, William Morgan
<wmorgan-sup at masanjin.net> wrote:
> Would a three-way toggle irritate anyone?
Sounds good to me.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [sup-talk] [PATCH] Use terminal width instead of hardcoded 80 as the wrap length.
2009-05-27 16:13 ` Mark Alexander
@ 2009-05-27 17:43 ` Nicolas Pouillard
0 siblings, 0 replies; 9+ messages in thread
From: Nicolas Pouillard @ 2009-05-27 17:43 UTC (permalink / raw)
Excerpts from Mark Alexander's message of Wed May 27 18:13:30 +0200 2009:
> On Wed, May 27, 2009 at 8:58 AM, William Morgan
> <wmorgan-sup at masanjin.net> wrote:
> > Would a three-way toggle irritate anyone?
>
> Sounds good to me.
It would also fit my needs.
--
Nicolas Pouillard
http://nicolaspouillard.fr
^ permalink raw reply [flat|nested] 9+ messages in thread
* [sup-talk] [PATCH] Use terminal width instead of hardcoded 80 as the wrap length.
2009-05-27 15:58 ` William Morgan
2009-05-27 16:05 ` Ben Walton
2009-05-27 16:13 ` Mark Alexander
@ 2009-06-06 0:35 ` Ingmar Vanhassel
[not found] ` <1244392518-sup-9746@cabinet>
3 siblings, 0 replies; 9+ messages in thread
From: Ingmar Vanhassel @ 2009-06-06 0:35 UTC (permalink / raw)
Excerpts from William Morgan's message of Wed May 27 17:58:23 +0200 2009:
> Reformatted excerpts from Ben Walton's message of 2009-05-23:
> > But if you leave sup's "we dont' force wrapping" rules alone, this
> > makes reading mail scroll free if your terminal is wide enough and
> > doesn't change the behaviour if the terminal is narrower. (Not that
> > I'm against making it an option either.)
>
> Seems like there are three main modes of operation that would be
> desirable:
>
> 1. wrap at 80 chars;
> 2. wrap at current terminal width;
> 3. don't wrap.
>
> (In all cases, existing line breaks in the message are left alone.)
>
> Would a three-way toggle irritate anyone?
Works for me.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [sup-talk] [PATCH] Use terminal width instead of hardcoded 80 as the wrap length.
[not found] ` <1244392518-sup-9746@cabinet>
@ 2009-06-12 19:29 ` William Morgan
0 siblings, 0 replies; 9+ messages in thread
From: William Morgan @ 2009-06-12 19:29 UTC (permalink / raw)
Reformatted excerpts from Marc Hartstein's message of 2009-06-07:
> Do we currently honor format=flowed email?
No.
> If we don't, it would be desirable to take this into account when
> designing the display wrapping options, and it seems like it would be
> worth implementing down the road.
Yes, I suppose so.
> It might be useful to be able to specify the wrap margin to something
> other than 80. I don't know if anybody would actually use this,
> though.
I will leave that kind of thing for the Sup GUI clients. :)
--
William <wmorgan-sup at masanjin.net>
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2009-06-12 19:29 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-05-23 18:19 [sup-talk] [PATCH] Use terminal width instead of hardcoded 80 as the wrap length Mark Alexander
2009-05-23 19:23 ` Ben Walton
[not found] ` <4c4248150905231318kab3819dw68e3a3a614241c0d@mail.gmail.com>
2009-05-24 0:00 ` Ben Walton
2009-05-27 15:58 ` William Morgan
2009-05-27 16:05 ` Ben Walton
2009-05-27 16:13 ` Mark Alexander
2009-05-27 17:43 ` Nicolas Pouillard
2009-06-06 0:35 ` Ingmar Vanhassel
[not found] ` <1244392518-sup-9746@cabinet>
2009-06-12 19:29 ` William Morgan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox