Subject: [sup-talk] Enter on links

From: [email-masked] (Daniel Wagner)
Date: Tue, 29 Jan 2008 11:47:22 -0800

Hello!

One thing I find myself doing all the time is highlighting a web address
and pasting it into Firefox.  For long URLs (a sad but common truth),
it's even more annoying... hit 'D' to open it up in vim, navigate to the
link, Jx a few times, then *finally* copy and paste.  Is there a better
way to do this?  Since I couldn't find any feature like this in the
help, I'm going to assume the answer is no.

So, here's my real question: how hard would it be for me to allow Enter
to try to open a (potentially-multiline) link?  I am aware that there
are some subtleties about detecting addresses' beginning/ending points
here; what I'm really interested in is whether it is easy within sup's
architecture.

Thanks!
~d

---

From: [email-masked] (William Morgan)
Date: Tue, 29 Jan 2008 19:58:15 -0800

Reformatted excerpts from Daniel Wagner's message of 2008-01-29:
> One thing I find myself doing all the time is highlighting a web
> address and pasting it into Firefox.  For long URLs (a sad but common
> truth), it's even more annoying... hit 'D' to open it up in vim,
> navigate to the link, Jx a few times, then *finally* copy and paste.
> Is there a better way to do this?

On my system this is actually handled by the terminal (I'm using
gnome-terminal) directly. You can click on any link and it launches the
default web browser.

> So, here's my real question: how hard would it be for me to allow
> Enter to try to open a (potentially-multiline) link?  I am aware that
> there are some subtleties about detecting addresses' beginning/ending
> points here; what I'm really interested in is whether it is easy
> within sup's architecture.

Fairly easy, with some caveats. Sup is fundamentally line-based, at
least at this point. A URL-detecting regex could pick out individual
URLs from the message, pack them into their own kind of Chunk (see
message-chunks.rb) the same way that quoted regions and attachments are
handled, and the rest would follow more or less trivially.

That might make the email look a little weird, as any URLs would sit on
their own line. But Sup has never shied away from reformatting emails
for display. :)

-- 
William <wmorgan-sup at masanjin.net>

---

From: [email-masked] (Nicolas Pouillard)
Date: Wed, 30 Jan 2008 10:21:28 +0100

> help, I'm going to assume the answer is no.

Concerning  multiline  links,  I've hacked sup to don't wrap at 80 columns but
at  160. This fixes the problem at least when the mail has not been wrapped by
the sender.

-- 
Nicolas Pouillard aka Ertai
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 186 bytes
Desc: not available
Url : http://rubyforge.org/pipermail/sup-talk/attachments/20080130/5a26c0cd/attachment.bin

---

From: [email-masked] (vasudeva)
Date: Wed, 30 Jan 2008 19:29:17 -0500

> at  160. This fixes the problem at least when the mail has not been wrapped by

Care to share? I'd like to see this so I can figure out a way to make
sup wrap where I want to.

-- 
linkswarm.com :: Collaborative Insolence
vasudeva.linkswarm.com/gallery :: For The Faint of Heart

---

From: [email-masked] (Nicolas Pouillard)
Date: Thu, 31 Jan 2008 12:58:13 +0100

> sup wrap where I want to.

That's not really clean and produce a warning the first time.

I've added this line to one of my hooks (after-poll.rb)
Redwood::Chunk::Text.const_set :WRAP_LEN, 160 unless Redwood::Chunk::Text::WRAP_LEN == 160

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 232 bytes
Desc: not available
Url : http://rubyforge.org/pipermail/sup-talk/attachments/20080131/911bc2df/attachment.bin